Medical Bill broken
#1

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
Reply
#2

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;
}
Reply
#3

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)