28.11.2009, 12:15
how can i make it like when someone kill another person he get +10 score, i tried it myself but i get everytime errors.
public OnPlayerDeath(playerid, killerid, reason)
{
if(IsPlayerConnected(killerid))
{
new score = GetPlayerScore(killerid);
SetPlayerScore(killerid, score+10);
}
return 1;
}
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)+10); } return 1; }
Originally Posted by diesulke
Remi that code will give the player who died +10 points.
|
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)+10);
GameTextForPlayer(playerid, "+10!",3000,4);
}
return 1;
}
if(killerid == INVALID_PLAYER_ID) {
SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
if(a == 5)
{printf("5");}
else
{printf("%d", a);}