26.05.2014, 15:47
Quote:
Special format indicating the types of values the timer will pass. "i" stands for the integer, which is a decimal number (you can also use "d" instead of the "i". It will cause the same result). "i" operator will provide a timer the player's ID to the function that is supposed to be called.
edit:// Too late. |
One more thing,
I have 1 problem again
Here:
OnPlayerDeath
Код:
OnPlayerDisconnect if(pBankRobbing[giveplayerid] == 1) { RobberBusted[giveplayerid] = 1; SetTimerEx("robtimer", 0 , false, "i", playerid); pBankRobbing[giveplayerid] = 0; }
Код:
public robtimer
Код:
RobberBusted[playerid] == 1
Код:
public robtimer(playerid) { if(RobberBusted[playerid] == 1) { SendClientMessageToAll(COLOR_GREEN, "[BREAKING NEWS]: Bank Robberry Failed! Suspect has been BUSTED!"); SendClientMessage(playerid, COLOR_YELLOW, "You were busted by the POLICE, Bank Robbery Fail!"); RobberBusted[playerid] = 0; pBankRobbing[playerid] = 0; return 1; } else if(RobberBusted[playerid] == 2) { SendClientMessageToAll(COLOR_RED, "[BREAKING NEWS]: Bank Robberry failed! Suspect has been eliminated ((Leaving/Timeout at server))"); RobberBusted[playerid] = 0; pBankRobbing[playerid] = 0; return 1; } else { new string[128];//We are defining a new string for the formatted message that we are displaying later on. new cash = random(2000000); GivePlayerCash(playerid, cash); /* With the fuction above 'new cash = random(200000); GivePlayerMoney(playerid, cash);' we give the player a random amount of money from $0 - $200,000 */ //Here below we use the string we defined above to format the message itself and display it to the player. format(string, sizeof(string), "You have successfully robbed $%d from the bank!", cash); SendClientMessage(playerid, COLOR_GREEN, string); format(string, sizeof(string), "[BREAKING NEWS] The suspect %s has successfully rob the money bank", GetPlayerNameEx(playerid)); SendClientMessageToAll(COLOR_REALRED, string); ++PlayerInfo[playerid][pCrimes]; ++PlayerInfo[playerid][pCrimes]; ++PlayerInfo[playerid][pCrimes]; SetPlayerWantedLevel(playerid, ++PlayerInfo[playerid][pWantedLevel]); SetPlayerWantedLevel(playerid, ++PlayerInfo[playerid][pWantedLevel]); SetPlayerWantedLevel(playerid, ++PlayerInfo[playerid][pWantedLevel]); ++PlayerInfo[playerid][pCrimes]; ++PlayerInfo[playerid][pCrimes]; ++PlayerInfo[playerid][pCrimes]; SetPlayerWantedLevel(playerid, ++PlayerInfo[playerid][pWantedLevel]); SetPlayerWantedLevel(playerid, ++PlayerInfo[playerid][pWantedLevel]); SetPlayerWantedLevel(playerid, ++PlayerInfo[playerid][pWantedLevel]); } return 1; }
EDIT: I use the RobberBusted var OnPlayerDisconnect and OnPlayerDeath, QUESTION: Should i try the pVarInt?