19.01.2014, 20:07
You can put it when the player dies, like below.
^ It worked because you set the timer to repeat witch needs to be killed on different callbacks.
Код:
public OnPlayerDeath(playerid, killerid, reason) { if(LawEnforcementMode[killerid] == true) //check if the killer is a cop or law enforcement { if(PlayerTeam[playerid] != TEAM_CIV || PlayerTeam[playerid] == TEAM_CIV && GetPlayerWantedLevel(playerid)<=3) { //if the player that has been killed is not civilian or civilian and his wanted level is less than 3 DecreaseScore(killerid, 1); // it will decrease the killerid score by 1 SendDeathMessage(killerid, playerid, reason); } else { //else if he is civilian and his wanted level is greater than 3 PlayerInfo[playerid][pJailTime] = (GetPlayerWantedLevel(playerid)*60)/4; KillTimer(JailTimer[playerid]); PutPlayerInJail(playerid); //will put the playerid in jail as a takendown (arrest) IncreaseScore(killerid, 1); SendDeathMessage(killerid, playerid, reason); } } return 1; }
Quote:
worked, i killed it on OnPlayerDeath,, but why it worked ? o,o |