thing wrong with OnPlayerDeath
#5

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
Here is the whole code.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
        new string[128];
        PlayerInfo[killerid][pScore] = (PlayerInfo[killerid][pScore] + 1);
        PlayerInfo[killerid][pCash] = PlayerInfo[killerid][pCash] + 1000;
        PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] - 1000;
        PlayerInfo[killerid][pKills] ++;
        PlayerInfo[playerid][pDeaths] ++;
        // Most important part: Use the SAMP functions to give score and cash to a player.
        GivePlayerMoney(killerid, 1000);
        GivePlayerMoney(playerid, -1000);
        SetPlayerScore(killerid, PlayerInfo[killerid][pScore]);
        format(string, sizeof(string), "You killed %s and recieved $1,000!", Name(playerid));
        SendClientMessage(killerid, COLOR_CYAN, string);
        format(string, sizeof(string), "You've been killed by %s and lost $1,000!", Name(killerid));
        SendClientMessage(playerid, COLOR_CYAN, string);
        SendDeathMessage(killerid, playerid, reason);
     }
     return 1;
}
Still only takes 100 away.
Reply


Messages In This Thread
thing wrong with OnPlayerDeath - by Elysian` - 09.12.2012, 20:11
Re: thing wrong with OnPlayerDeath - by HireMe - 09.12.2012, 20:48
Re: thing wrong with OnPlayerDeath - by Elysian` - 10.12.2012, 10:28
Re: thing wrong with OnPlayerDeath - by [HK]Ryder[AN] - 10.12.2012, 10:50
Re: thing wrong with OnPlayerDeath - by BleverCastard - 10.12.2012, 14:07
Re: thing wrong with OnPlayerDeath - by Lordzy - 10.12.2012, 14:11
Re: thing wrong with OnPlayerDeath - by BleverCastard - 10.12.2012, 14:44
Re: thing wrong with OnPlayerDeath - by LarzI - 10.12.2012, 14:50
Re: thing wrong with OnPlayerDeath - by BleverCastard - 10.12.2012, 14:54
Re: thing wrong with OnPlayerDeath - by Elysian` - 10.12.2012, 19:23

Forum Jump:


Users browsing this thread: 2 Guest(s)