Money Bug
#1

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
Reply
#2

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

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.
Reply
#4

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.
Reply
#5

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;

Reply
#6

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

Using an anti-money cheat?
Reply
#8

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

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
Reply
#10

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)