05.04.2013, 21:35
Quote:
pawn Код:
|
Is like this?
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new playercash; // new variable to store a value
if(killerid == INVALID_PLAYER_ID) // if killerid is not a valid/connected player (ID 65536)
{
SendDeathMessage(INVALID_PLAYER_ID,playerid,reason); // then it sends the icon of falling/explosion
ResetPlayerMoney(playerid); // it sets money to 0
}
else // else killerid is a valid/connected player
{
SendDeathMessage(killerid,playerid,reason); // it sends the death message (icon killer > player with this weapon)
SetPlayerScore(killerid,GetPlayerScore(killerid)+2); // it sets +2 score ( old score + 2 )
playercash = GetPlayerMoney(playerid); // it assignes a value to the first variable with the playerid's money
if (playercash > 100) // if the cash is greater than 100
{
GivePlayerMoney(killerid, playercash); // then it gives the money to the killer
GivePlayerMoney(playerid, -100); // it sets playerid's money to 0 <<<< I CHANGES THIS.
}
else // if the cash is lower than 100 or equal to 100
{
// do something;
}
}
return 1; // return a value to the callback
}