giving money to a player
#1

So I want to give money to a player automatically when he dies, meaning I want to save it into his variable right away so nobody can hack money. I could use GivePlayerMoney to give a player the money then when he disconnects I can save it to the variable but I don't know how to save it into a variable directly.

If you don't understand what I'm asking by now, I'm trying to add, for example, 500$ directly to the killer's money variable (PlayerInfo[killerid][Money]) so technically he wouldn't even see his money increase.. How would I do that?

public OnPlayerDeath(playerid, killerid, reason)
{
PlayerInfo[killerid][pKills]++;
PlayerInfo[playerid][pDeaths]++;
SendDeathMessage(killerid, playerid, reason);
return 1;
}
Reply
#2

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(IsPlayerConnected(killerid))
{
PlayerInfo[killerid][pKills]++;
PlayerInfo[playerid][pDeaths]++;
SendDeathMessage(killerid, playerid, reason);
PlayerInfo[killerid][Money] += 1000; //the amount you want to give.
ResetPlayerMoney(killerid);
GivePlayerMoney(killerid,PlayerInfo[killerid][Money]);
}
return 1;
}
Reply
#3

thanks homie
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)