SA-MP Forums Archive
[PAWNO ERROR] Undefined symbol "GivePlayerCash" - 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: [PAWNO ERROR] Undefined symbol "GivePlayerCash" (/showthread.php?tid=631292)



[PAWNO ERROR] Undefined symbol "GivePlayerCash" - RobyRbb - 26.03.2017

Hello guys, I have some errors in my gamemode, I try to put an Anti-Cheat but I delet them, now I have this errors:




Re: [PAWNO ERROR] Undefined symbol "GivePlayerCash" - Sibuscus - 26.03.2017

At the top of your script, delete the #define ResetPlayerMoney and then you need to change all of GivePlayerCash to GivePlayerMoney


Re: [PAWNO ERROR] Undefined symbol "GivePlayerCash" - RobyRbb - 26.03.2017

Quote:
Originally Posted by Sibuscus
Посмотреть сообщение
At the top of your script, delete the #define ResetPlayerMoney and then you need to change all of GivePlayerCash to GivePlayerMoney
I don't have #define ResetPlayerMoney, and 30 minutes ago GivePlayerCash works perfectly


Re: [PAWNO ERROR] Undefined symbol "GivePlayerCash" - jasperschellekens - 26.03.2017

Use GivePlayerMoneyEx
PHP код:
//==============================================================================
stock GivePlayerMoneyEx(playerid,amount)
{
    
ResetPlayerMoney(playerid);
    
SetPVarInt(playerid,"cash",GetPVarInt(playerid,"cash") + amount);
    if(
GetPVarInt(playerid,"cash") > GetPVarInt(playerid,"maxcash")) SetPVarInt(playerid,"maxcash",GetPVarInt(playerid,"cash"));
    return 
GivePlayerMoney(playerid,GetPVarInt(playerid,"cash"));
}
//==============================================================================
stock SetPlayerMoneyEx(playerid,amount)
{
    
ResetPlayerMoney(playerid);
    
SetPVarInt(playerid,"cash",amount);
    if(
GetPVarInt(playerid,"cash") > GetPVarInt(playerid,"maxcash")) SetPVarInt(playerid,"maxcash",GetPVarInt(playerid,"cash"));
    return 
GivePlayerMoney(playerid,GetPVarInt(playerid,"cash"));
}
//==============================================================================
stock GetPlayerMoneyEx(playerid)return GetPVarInt(playerid,"cash");
//============================================================================== 



Re: [PAWNO ERROR] Undefined symbol "GivePlayerCash" - RobyRbb - 26.03.2017

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
Use GivePlayerMoneyEx
PHP код:
//==============================================================================
stock GivePlayerMoneyEx(playerid,amount)
{
    
ResetPlayerMoney(playerid);
    
SetPVarInt(playerid,"cash",GetPVarInt(playerid,"cash") + amount);
    if(
GetPVarInt(playerid,"cash") > GetPVarInt(playerid,"maxcash")) SetPVarInt(playerid,"maxcash",GetPVarInt(playerid,"cash"));
    return 
GivePlayerMoney(playerid,GetPVarInt(playerid,"cash"));
}
//==============================================================================
stock SetPlayerMoneyEx(playerid,amount)
{
    
ResetPlayerMoney(playerid);
    
SetPVarInt(playerid,"cash",amount);
    if(
GetPVarInt(playerid,"cash") > GetPVarInt(playerid,"maxcash")) SetPVarInt(playerid,"maxcash",GetPVarInt(playerid,"cash"));
    return 
GivePlayerMoney(playerid,GetPVarInt(playerid,"cash"));
}
//==============================================================================
stock GetPlayerMoneyEx(playerid)return GetPVarInt(playerid,"cash");
//============================================================================== 
I'v solved, it was just a stock function wrong.