11.09.2018, 14:29
Hello, i have a gamemode from 0 and if a player is death drop -100$.
How can i solve this problem?
Im so sorry for my bad eng.
How can i solve this problem?
Im so sorry for my bad eng.
public OnPlayerDeath(playerid, killerid, reason) { GivePlayerMoney(playerid, -100); // Takes off 100$ from the player who is dead. return 1; }
public OnPlayerDeath(playerid, killerid, reason) { GivePlayerMoney(playerid, 100); return 1; }
I'm pretty sure he means he doesn't want players to lose 100$ when they die.
Try doing the opposite, and OnPlayerDeath give the player 100$ As so: Код:
public OnPlayerDeath(playerid, killerid, reason) { GivePlayerMoney(playerid, 100); return 1; } |
#include <a_samp> new Money[MAX_PLAYERS]; public OnPlayerUpdate(playerid) { if(GetPlayerMoney(playerid) != Money[playerid]) { ResetPlayerMoney(playerid); GivePlayerMoney(playerid,Money[playerid]); } return 1; }
That is wrong.
The problem of losing money when dyingh happens sometimes. Solution: Код:
#include <a_samp> new Money[MAX_PLAYERS]; public OnPlayerUpdate(playerid) { if(GetPlayerMoney(playerid) != Money[playerid]) { ResetPlayerMoney(playerid); GivePlayerMoney(playerid, Money[playerid]); } return 1; } |