[Pomoc]Trosenje Bonova

Započeo Retardinjo, April 15, 2011, 19:20:00 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:Cyber
Detaljan opis problema:Ovako ja bih htio napravit da mi trosi bon koj sam kupio umjesto para..pa sad me nesto zeza  :-\ 
Dio skripte:ovo je komanda za davanje oduzimanje bona :
pMobileBon

a ovo je /call i /sms komanda :
if(strcmp(cmd, "/call", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
		{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "KORSITI: /call [broj mobitela]");
				return 1;
			}
			if(PlayerInfo[playerid][pPnumber] == 0)
			{
				SendClientMessage(playerid, COLOR_GRAD2, "  Nemate mobitel !");
				return 1;
			}
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s je izvadio mobitel.", sendername);
			ProxDetector(30.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
			new phonenumb = strvalEx(tmp);
			if(phonenumb == 911)
			{
				SendClientMessage(playerid, BELA, "POMOC: Koristite T da bi ste razgovarali, upisite /hangup da bi ste prekinuli");
				SendClientMessage(playerid, CRVENA, "SLUZBA: Trebate li Vatrogasce/Bolnicare ili Policiju?");
				Mobile[playerid] = 911;
				return 1;
			}
			if(phonenumb == PlayerInfo[playerid][pPnumber])
			{
				SendClientMessage(playerid, COLOR_GRAD2, "  Zauzeto je...");
				return 1;
			}
			if(Mobile[playerid] != 255)
			{
				SendClientMessage(playerid, COLOR_GRAD2, "  Vec zovete...");
				return 1;
			}
			for(new i = 0; i < MAX_PLAYERS; i++)
			{
				if(IsPlayerConnected(i))
				{
					if(PlayerInfo[i][pPnumber] == phonenumb && phonenumb != 0)
					{
						giveplayerid = i;
						Mobile[playerid] = giveplayerid; //caller connecting
						if(IsPlayerConnected(giveplayerid))
						{
						    if(giveplayerid != INVALID_PLAYER_ID)
						    {
						        if(PhoneOnline[giveplayerid] > 0)
						        {
						            SendClientMessage(playerid, CRVENA, "   Igracev Mobitel je iskljucen !");
						            return 1;
						        }
								if (Mobile[giveplayerid] == 255)
								{
									format(string, sizeof(string), "|Zvoni vam [Mobitel] - Pozivatelj %s", sendername);
									SendClientMessage(giveplayerid, 0x00D900C8, string);
									GetPlayerName(giveplayerid, sendername, sizeof(sendername));
									RingTone[giveplayerid] = 10;
									format(string, sizeof(string), "|%s|¤Zvoni ¤Mobitel¤", sendername);
									SendClientMessage(playerid, BELA, "|MOBITEL|¤Koristite /t kako bi napise text,a /h kako bi prekinuli¤");
									ProxDetector(30.0, i, string, CRVENA,CRVENA,CRVENA,CRVENA,CRVENA);
									CellTime[playerid] = 1;
									return 1;
								}
							}
						}
					}
				}
			}
			SendClientMessage(playerid, COLOR_GRAD2, "  zauzeto je...");
		}
		return 1;
	}
/*------------------------------------------------------------------------------*/


/*------------------------------------------------------------------------------*/
if(strcmp(cmd, "/sms", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
		{
		    if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, CRVENA, "Jos se nisi logirao!");
	            return 1;
	        }
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, ZELENA, "KORISTENJE: /sms [Broj mobitela] [Text]");
				return 1;
			}
			if(PlayerInfo[playerid][pPnumber] == 0)
			{
				SendClientMessage(playerid, ZELENA, "Nemas telefon...");
				return 1;
			}
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s salje poruku", sendername);
			ProxDetector(30.0, playerid, string, ZELENA,ZELENA,ZELENA,ZELENA,ZELENA);
			new phonenumb = strval(tmp);
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, ZELENA, "KORISTENJE: /sms [Broj mobitela] [Text]");
				return 1;
			}
			if(phonenumb == 555)
			{
				if ((strcmp("da", result, true, strlen(result)) == 0) && (strlen(result) == strlen("da")))
				{
					SendClientMessage(playerid, BELA, "Dobio si obavijest o primicu poruke.");
					if (gTeam[playerid] == 2 || gTeam[playerid] == 1)
					{
						SendClientMessage(playerid, ZUTA, "SMS: Nemam pojma o cemu ti pricas, Posiljatelj: KRTICA (555)");
						RingTone[playerid] = 20;
						return 1;
					}
					return 1;
				}
				else
				{
					SendClientMessage(playerid, ZUTA, "SMS: Jednostavan da je dovoljan, Posiljatelj: KRTICA (555)");
					RingTone[playerid] = 20;
					return 1;
				}
			}
			foreach(Player, i)
			{
				if(IsPlayerConnected(i))
				{
					if(PlayerInfo[i][pPnumber] == phonenumb && phonenumb != 0)
					{
						giveplayerid = i;
						Mobile[playerid] = giveplayerid; //caller connecting
						if(IsPlayerConnected(giveplayerid))
						{
						    if(giveplayerid != INVALID_PLAYER_ID)
						    {
						        if(PhoneOnline[giveplayerid] > 0)
						        {
						            SendClientMessage(playerid, SIVA, "   Igracev telefon je ugasen!");
						            return 1;
						        }
								format(string, sizeof(string), "SMS: %s, Posiljatelj: %s (%d)", result,sendername,PlayerInfo[playerid][pPnumber]);
								GetPlayerName(giveplayerid, sendername, sizeof(sendername));
								//format(string, sizeof(string), "* %s's phone beeps.", sendername);
								RingTone[giveplayerid] =20;
								SendClientMessage(playerid, BELA, "Poruka dostavljena.");
								SendClientMessage(giveplayerid, ZUTA, string);
								SendClientMessage(playerid,  ZUTA, string);
								format(string, sizeof(string), "~r~$-%d", txtcost);
								GameTextForPlayer(playerid, string, 5000, 1);
								JB_GivePlayerMoney(playerid,-txtcost);
								SBizzInfo[2][sbTill] += txtcost;
								ExtortionSBiz(2, txtcost);
					           	PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
					           	Mobile[playerid] = 255;
								return 1;
							}
						}
					}
				}
			}
			SendClientMessage(playerid, COLOR_GRAD2, "  Poruka nije poslana...");
		}
		return 1;
	}
/*------------------------------------------------------------------------------*/


Evo posto vidim da skripta koristi TXTCOST ona je ovako napisana :
new txtcost = 25;

Neke slike/video za lakse dobivanje pomoci(neobavezno): \\\\

Molim vas pomozite

P.S. zar nitko nezna popravit komandu za enter/exit iz kuce??

pa u /sms cmd imas ovaj red: JB_GivePlayerMoney(playerid,-txtcost);
njega zamjeni sa tvojom varijablom, PlayerInfo[playerid][pMobileBon]--;



ma znam da imam samo nisam znao kako treba stavit tu komandu za skidanje bona umjesto giveplayermoney ;)
btw..fala na odgovoru