31.08.2010, 01:02
Hi People,
I have added a simple bit of script, When an innocent player gets killed, the killer gets a +1 wanted star.
The trouble is.. when I kill someone the first time I dont get the reward money or a wanted star.
In order to get a wanted star or reward, I have to kill the person twice.
Is the code right? or could there be another script messing around with it?![Confused](images/smilies/confused.png)
thanks in advance!
I have added a simple bit of script, When an innocent player gets killed, the killer gets a +1 wanted star.
The trouble is.. when I kill someone the first time I dont get the reward money or a wanted star.
In order to get a wanted star or reward, I have to kill the person twice.
Is the code right? or could there be another script messing around with it?
![Confused](images/smilies/confused.png)
Код:
public OnPlayerSpawn(playerid) { SetPlayerWantedLevel(playerid, 0); //reset wanted level }
Код:
public OnPlayerDeath(playerid, killerid, reason) { if (GetPlayerWantedLevel(playerid) == 0) { SendClientMessage(killerid,COLOR_RED, "You killed an innocent person!, wanted level has been increased."); SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid) + 1); } else if (GetPlayerWantedLevel(playerid) => 1) { GivePlayerMoney(killerid,10000); SendClientMessage(killerid,COLOR_GREEN, "You killed a player with a level 1 wanted level"); SendClientMessage(killerid,COLOR_WHITE, "You get $10,000 reward"); } }
![cool](images/smilies/cool.png)