20.01.2015, 17:58
Quote:
Tengo esto en "OnPlayerDeath"
Код:
public OnPlayerDeath(playerid, killerid, reason) { new playercash; if(killerid == INVALID_PLAYER_ID) { SendDeathMessage(INVALID_PLAYER_ID,playerid,reason); ResetPlayerMoney(playerid); } else { SendDeathMessage(killerid,playerid,reason); SetPlayerScore(killerid,GetPlayerScore(killerid)+1); playercash = GetPlayerMoney(playerid); if (playercash > 0) { GivePlayerMoney(killerid, playercash); ResetPlayerMoney(playerid); } else { } } return 1; } |
pawn Код:
new score[MAX_PLAYERS]; // o tu variable de score
public OnPlayerDeath(playerid, killerid, reason)
{
new playercash;
if(killerid == INVALID_PLAYER_ID)
{
SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
ResetPlayerMoney(playerid);
}
else
{
score[killerid]++;//suma cada vez que mata
SendDeathMessage(killerid,playerid,reason);
SetPlayerScore(killerid,score[killerid]);// pone lo de la variable
playercash = GetPlayerMoney(playerid);
if (playercash > 0)
{
GivePlayerMoney(killerid, playercash);
ResetPlayerMoney(playerid);// porque reseteas luego de darle al player?
}
}
return 1;
}