OnPlayerDeath
#1

Hello, i wanted to ask for a litle code for OnPlayerDeath, when you die you dont lose money but when you are killed by someone he gets for example 1000$ and +1 score, can someone write that to me?
Reply
#2

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);
    if(killerid != INVALID_PLAYER_ID) // Valid killer, give cash+score
    {
        pScore[killerid]++;
        SetPlayerScore(killerid, pScore[killerid]);
 
        pCash[killerid] += 1000;
        GivePlayerMoney(killerid, 1000);
     }
}
You should look on the wiki an learn to do these yourself...getting them like this wont help you that much mate.
Reply
#3

Код:
}

public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);
    pInfo[playerid][Deaths]++;
    GivePlayerCash(playerid, +1000);
    SetPlayerScore(playerid, GetPlayerScore(playerid) +1);
Reply
#4

Oaps sorry for the double post!
Reply
#5

Thank you so much guys!
Reply
#6

No problem,just try to remember to learn these yourself..look on the wiki and on the forums becasue this way you will learn something
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)