Money problem(-100$)
#8

Quote:
Originally Posted by B-rian
Посмотреть сообщение
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; 
}
This is because the money loss is trigerred on spawn, so if you give them 100$ when they die, the 100$ will then be removed when they spawn, so no money is lost.
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;
}
Reply


Messages In This Thread
Money problem(-100$) - by myhay9898 - 11.09.2018, 14:29
Re: Money problem(-100$) - by UFF - 11.09.2018, 14:48
Re: Money problem(-100$) - by myhay9898 - 11.09.2018, 14:58
Re: Money problem(-100$) - by akib - 11.09.2018, 15:02
Re: Money problem(-100$) - by UFF - 11.09.2018, 15:11
Re: Money problem(-100$) - by B-rian - 11.09.2018, 15:13
Re: Money problem(-100$) - by Calisthenics - 11.09.2018, 15:13
Re: Money problem(-100$) - by Alteh - 12.09.2018, 05:53
Re: Money problem(-100$) - by UFF - 12.09.2018, 06:00
Re: Money problem(-100$) - by Burridge - 12.09.2018, 07:18

Forum Jump:


Users browsing this thread: 1 Guest(s)