OnPlayerDeath ????? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerDeath ????? (
/showthread.php?tid=358784)
OnPlayerDeath ????? -
NuLIO - 11.07.2012
i want if player die take from him 1 score and 2000 money and killer get 4000 money and 2 score
but its give killer only 100 money and 2 score and who die did not take from him score or money
this in my gamemode :
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid != INVALID_PLAYER_ID)
{
SetPlayerScore(killerid, GetPlayerScore(killerid)+2);
GivePlayerMoney(killerid, 4000);
SendClientMessage(killerid, -1, "Congratulation!You have gained 4000$ and +2 score.");
SetPlayerScore(playerid, GetPlayerScore( playerid ) -1 );
GivePlayerMoney(playerid, -2000);
SendClientMessage(playerid, -1, "You lost 2000$ because you got killed.");
}
return 1;
Re: OnPlayerDeath ????? -
clarencecuzz - 11.07.2012
Check your filterscripts to make sure there's nothing that would interfere with this code. Example: One of the filterscripts might be giving the killer - money for killing someone.
Re: OnPlayerDeath ????? -
NuLIO - 11.07.2012
no , i checked on all my filterscript but no one of them have this code plz help
Re: OnPlayerDeath ????? -
Captain_Mani - 12.07.2012
Try this:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid != INVALID_PLAYER_ID)
{
SetPlayerScore(killerid, GetPlayerScore(killerid)+2);
GivePlayerMoney(killerid, 4000);
SendClientMessage(killerid, -1, "Congratulation!You have gained 4000$ and +2 score.");
SetPlayerScore(playerid, GetPlayerScore(playerid) -1);
GivePlayerMoney(playerid, -2000);
SendClientMessage(playerid, -1, "You lost 2000$ because you got killed.");
}
return 1;
}
Re: OnPlayerDeath ????? -
NuLIO - 12.07.2012
no this if i kill anyone i get 2 score and no money and if i killed i lose only 100 money ,
if u help me +rep