Player Money On Death
#1

Hey Guys,
I'm only new at this and I was just wondering if its possible to change it so players don't lose any money on death?
I have researched but can't find anything
So if someone could help me out that would be great.
Reply
#2

search in your gamemode for

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{

    return 1;
}
if GivePlayerMoney is in there..remove it
Reply
#3

pawn Код:
new money[MAX_PLAYERS];

public OnPlayerDeath(playerid, killerid, reason)
{
    money[playerid] = GetPlayerMoney(playerid);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    ResetPlayerMoney(playerid);
    GivePlayerMoney(playerid, money[playerid]);
    return 1;
}
Reply
#4

Thanks so much guys
Greatly appreciated.
Reply
#5

Quote:
Originally Posted by AIped
Посмотреть сообщение
search in your gamemode for

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{

    return 1;
}
if GivePlayerMoney is in there..remove it
Tried it, didn't work I think I went wrong somewhere
Reply
#6

Quote:
Originally Posted by [XST]O_x
Посмотреть сообщение
pawn Код:
new money[MAX_PLAYERS];

public OnPlayerDeath(playerid, killerid, reason)
{
    money[playerid] = GetPlayerMoney(playerid);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    ResetPlayerMoney(playerid);
    GivePlayerMoney(playerid, money[playerid]);
    return 1;
}
Yours will work, but I am having problems compiling it, Wont compile because "OnPlayerSpawn" is already used
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)