OnPlayerDeath - Updating Data
#10

Quote:
Originally Posted by RedJohn
Посмотреть сообщение
Actually correct way is:
pawn Код:
pInfo[playerid][pMoney] = GetPlayerMoney(playerid) - 50;
He's running own money system.
pawn Код:
pInfo[playerid][pMoney] = pInfo[playerid][pMoney] - 50;
GivePlayerMoney(playerid, pInfo[playerid][pMoney]);
This should work well...
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);
    if(killerid != INVALID_PLAYER_ID)
    {
        pInfo[killerid][pKills] = pInfo[killerid][pKills] + 1;
        pInfo[killerid][pScore] = pInfo[killerid][pScore] +1;
        pInfo[killerid][pMoney] = pInfo[killerid][pMoney] + 100;
        GivePlayerMoney(killerid, pInfo[killerid][pMoney]);
        SetPlayerScore(killerid, pInfo[killerid][pScore]);
    }
    else
    {
        pInfo[playerid][pDeaths] = pInfo[playerid][pDeaths] + 1;
        pInfo[playerid][pMoney] = pInfo[playerid][pMoney] - 50;
        GivePlayerMoney(playerid, pInfo[playerid][pMoney]);
    }
    return 1;
}
Let me now if something goes bad.
Reply


Messages In This Thread
OnPlayerDeath - Updating Data - by Slepur - 05.08.2013, 22:22
Re: OnPlayerDeath - Updating Data - by RedJohn - 05.08.2013, 22:30
Re: OnPlayerDeath - Updating Data - by Slepur - 05.08.2013, 22:36
Re: OnPlayerDeath - Updating Data - by RedJohn - 05.08.2013, 22:41
Re: OnPlayerDeath - Updating Data - by Slepur - 05.08.2013, 22:50
Re: OnPlayerDeath - Updating Data - by Amel_PAtomAXx - 05.08.2013, 23:16
Re: OnPlayerDeath - Updating Data - by RedJohn - 05.08.2013, 23:19
Re: OnPlayerDeath - Updating Data - by Slepur - 05.08.2013, 23:23
Re: OnPlayerDeath - Updating Data - by SuperViper - 05.08.2013, 23:25
Re: OnPlayerDeath - Updating Data - by Amel_PAtomAXx - 05.08.2013, 23:38

Forum Jump:


Users browsing this thread: 1 Guest(s)