Medical Bill broken - 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: Medical Bill broken (
/showthread.php?tid=290305)
Medical Bill broken -
manchestera - 15.10.2011
SO i trying to make a medical bill on my server but it just wont work it is compling fine but the action isnt happening any thing here im doing wrong or anything ive missed out?
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
PVar[killerid][pKills] += 1;
PVar[playerid][pDeaths] += 1;
GivePlayerMoney(playerid,-2500);//This will not work?
return 1;
}
Many thanks
Re: Medical Bill broken -
SmiT - 15.10.2011
Make a check if killerid isn't equal to INVALID_PLAYER_ID:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if( killerid != INVALID_PLAYER_ID )
{
PVar[ killerid ][ pKills ] += 1;
}
PVar[ playerid ][ pDeaths ] += 1;
GivePlayerMoney( playerid, -2500 );
return 1;
}
Re: Medical Bill broken -
bw_ - 15.10.2011
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new temp = GetPlayerMoney(playerid);
PVar[killerid][pKills] += 1;
PVar[playerid][pDeaths] += 1;
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, temp - 2500);
return 1;
}
Try that, should work