SA-MP Forums Archive
Money Bug - 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: Money Bug (/showthread.php?tid=361726)



Money Bug - AaronKillz - 22.07.2012

For some reason, once you spend money in my script, the funds are deducted then sent back to the player.

This happens with /shop and /pay


Re: Money Bug - [KHK]Khalid - 22.07.2012

So, post the code of those commands (/shop /pay)!


Re: Money Bug - Kindred - 22.07.2012

Interesting story, please tell more.

Either show us some code, or we can't help.

Try to show us your /shop or /pay, or whatever callbacks may be interfering.


Respuesta: Money Bug - HarlemSAMP - 22.07.2012

Quote:
Originally Posted by AaronKillz
Посмотреть сообщение
For some reason, once you spend money in my script, the funds are deducted then sent back to the player.

This happens with /shop and /pay
Oh no... not another NGRP maggot.


Re: Money Bug - AaronKillz - 22.07.2012

Part of /shop

PHP код:
            return 1;
            }
            if(
dialogid == DIALOGID+4)
            {
            if(
response)
            {
            if(
listitem == 0)
            {
            if(
GetPlayerMoney(playerid) <200)
            return 
SendClientMessage(playeridCOLOR_RED"You don't have enough money to purchase this item!");
            
GivePlayerMoney(playerid, -200);
            
SetPlayerArmour(playerid100);
            
SendClientMessage(playeridCOLOR_GREEN"Thank you for purchasing a Armour! ($200)");
            
ShowPlayerDialog(playeridDIALOGIDDIALOG_STYLE_LIST"Shop""Pistols\nSub-Machine Gun\nShotguns\nArmours\nSMG\nAssault""Select""Cancel");
            } 

pay

PHP код:
CMD:pay(playeridparams[])
{
    new 
TargetAmount;
    if( !
sscanf(params"ui"TargetAmount) )
    {
        if( 
Amount ) return SendClientMessage(playerid, -1"Minimum amount: 1"); // if amount is lower as 5
        
if( Target == INVALID_PLAYER_ID ) return SendClientMessage(playerid, -1"Invalid playerid!"); // if target is an invalid playerid
        
if( Target == playerid ) return SendClientMessage(playerid, -1"You cant pay yourself."); // if youre the target
        
if( GetPlayerMoney(playerid) < Amount ) return SendClientMessage(playerid, -1"You dont have that amount of cash."); // if you dont have enough money you wanted to send to the player
        
GivePlayerMoney(playerid, -Amount); // removing the money from you
        
GivePlayerMoney(TargetAmount); // adding the money to you
    
} else return SendClientMessage(playerid, -1"Usage: /pay <playerid> <money>");
    return 
1;




Re: Respuesta: Money Bug - AaronKillz - 22.07.2012

Quote:
Originally Posted by HarlemSAMP
Посмотреть сообщение
Oh no... not another NGRP maggot.
I don't rp.


Re: Money Bug - Tee - 22.07.2012

Using an anti-money cheat?


Re: Money Bug - AaronKillz - 22.07.2012

Quote:
Originally Posted by Tee
Посмотреть сообщение
Using an anti-money cheat?
No, this is really weird.


Re: Money Bug - cessil - 22.07.2012

if it deduces the money and then gives it back, it sounds like a timer is going off and giving their money back

ctrl+f giveplayermoney and you'll figure it out


Re: Money Bug - AaronKillz - 22.07.2012

GivePlayerMoney(playerid, dini_Int(file, "Money")-GetPlayerMoney(playerid));

I don't see anything wrong with it. o.o