SA-MP Forums Archive
[HELP] Money commands. - 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: [HELP] Money commands. (/showthread.php?tid=287977)



[HELP] Money commands. - Swizzzy - 05.10.2011

I need help with making a money command basically i'm making a ShopSystem around LS, But i was struggling with Making the money commands,

And if anyone could provide a code, It'll be very appreciated.

*EDIT: I use ZCMD also.*

How Would i add a money command/code to a case?

pawn Код:
CMD:buy(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 2.0, 2.0134,-29.0133,1003.5494);
    {
        ShowPlayerDialog(playerid, DIALOG_JEFFSHOPMENU, DIALOG_STYLE_LIST, "{21D150}Store Counter", "{orange}Baseball Bat \t\t{white}$15 \n{orange}Sprunk \t\t{white}$5 \n{orange}Kevlar \t\t{white}$100", "Select", "Exit");
    }
}



Re: [HELP] Money commands. - ServerScripter - 05.10.2011

ondialogresponse:

PHP код:
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid0xFFFFFF"You don't have the Money!");
                        
GivePlayerMoney(playerid, -3000);//removing 3000$ , u can edite it
                        
GivePlayerWeapon(playerid31,100);// Spawning to him a M4
                        
PlayerPlaySound(playerid10570.00.010.0);//Playing the Sound
                        
SendClientMessage(playerid0x9EC73DAA"You bought a M4 and lose 3000$");
                    }