SA-MP Forums Archive
OnPlayerDeath gives money - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerDeath gives money (/showthread.php?tid=662563)



OnPlayerDeath gives money - Kevinas100 - 05.01.2019

what could be the problem , when the player dies, it doubles the players money

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    
user.priesmirti[playerid] = GetPlayerMoney(playerid);
    
GivePlayerMoney(playerid, -GetPlayerMoney(playerid));
    
SetTimerEx("mire"3000false,"i"playerid);
    return 
1;

PHP код:
public mire(playerid)
{
    
GivePlayerMoney(playeriduser.priesmirti[playerid]);
    
user.priesmirti[playerid] = 0;
    
SetPlayerPos(playerid, -2664.7725,635.7092,14.4531);
    return 
1;

tried it without the user.priesmirti enum but still gives double money


Re: OnPlayerDeath gives money - Rolux - 05.01.2019

Maybe you have
Код:
GivePlayerMoney(playerid, user.priesmirti[playerid]);
under OnPlayerSpawn.


Re: OnPlayerDeath gives money - Kevinas100 - 05.01.2019

no, there are no other giveplayermoneys on playerspawn


Re: OnPlayerDeath gives money - Libbyphay - 05.01.2019

Quote:
Originally Posted by Kevinas100
Посмотреть сообщение
what could be the problem , when the player dies, it doubles the players money

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    
user.priesmirti[playerid] = GetPlayerMoney(playerid);
    
GivePlayerMoney(playerid, -GetPlayerMoney(playerid));
    
SetTimerEx("mire"3000false,"i"playerid);
    return 
1;

PHP код:
public mire(playerid)
{
    
GivePlayerMoney(playeriduser.priesmirti[playerid]);
    
user.priesmirti[playerid] = 0;
    
SetPlayerPos(playerid, -2664.7725,635.7092,14.4531);
    return 
1;

tried it without the user.priesmirti enum but still gives double money
PHP код:
public mire(playerid

    
GivePlayerMoney(playeriduser.priesmirti[playerid]); 
    
user.priesmirti[playerid] = 0;
    
SetPlayerPos(playerid, -2664.7725,635.7092,14.4531); 
    return 
1

to

PHP код:
public mire(playerid

    
user.priesmirti[playerid] = 0
    
GivePlayerMoney(playeriduser.priesmirti[playerid]); 
    
SetPlayerPos(playerid, -2664.7725,635.7092,14.4531); 
    return 
1




Re: OnPlayerDeath gives money - Rolux - 05.01.2019

Can you show me your OnPlayerSpawn?


Re: OnPlayerDeath gives money - Kevinas100 - 05.01.2019

Quote:
Originally Posted by Libbyphay
Посмотреть сообщение
PHP код:
public mire(playerid

    
GivePlayerMoney(playeriduser.priesmirti[playerid]); 
    
user.priesmirti[playerid] = 0;
    
SetPlayerPos(playerid, -2664.7725,635.7092,14.4531); 
    return 
1

to

PHP код:
public mire(playerid

    
user.priesmirti[playerid] = 0
    
GivePlayerMoney(playeriduser.priesmirti[playerid]); 
    
SetPlayerPos(playerid, -2664.7725,635.7092,14.4531); 
    return 
1

helped, thanks