PDA

View Full Version : Medical Bill broken


manchestera
15/10/2011, 09:46 AM
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

SmiT
15/10/2011, 10:00 AM
Make a check if killerid isn't equal to INVALID_PLAYER_ID:
public OnPlayerDeath(playerid, killerid, reason)
{
if( killerid != INVALID_PLAYER_ID )
{
PVar[ killerid ][ pKills ] += 1;
}
PVar[ playerid ][ pDeaths ] += 1;
GivePlayerMoney( playerid, -2500 );
return 1;
}

bw_
15/10/2011, 10:07 AM
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