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=473434)
OnPlayerDeath -
fonetic - 02.11.2013
Hello, i wanted to ask for a litle code for OnPlayerDeath, when you die you dont lose money but when you are killed by someone he gets for example 1000$ and +1 score, can someone write that to me?
Re: OnPlayerDeath -
rappy93 - 02.11.2013
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
if(killerid != INVALID_PLAYER_ID) // Valid killer, give cash+score
{
pScore[killerid]++;
SetPlayerScore(killerid, pScore[killerid]);
pCash[killerid] += 1000;
GivePlayerMoney(killerid, 1000);
}
}
You should look on the wiki an learn to do these yourself...getting them like this wont help you that much mate.
Re: OnPlayerDeath -
Hamam - 02.11.2013
Код:
}
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
pInfo[playerid][Deaths]++;
GivePlayerCash(playerid, +1000);
SetPlayerScore(playerid, GetPlayerScore(playerid) +1);
Re: OnPlayerDeath -
Hamam - 02.11.2013
Oaps sorry for the double post!
Re: OnPlayerDeath -
fonetic - 02.11.2013
Thank you so much guys!
Re: OnPlayerDeath -
rappy93 - 02.11.2013
No problem,just try to remember to learn these yourself..look on the wiki and on the forums becasue this way you will learn something