SA-MP Forums Archive
[HELP] Withdraw command gone wrong? - 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] Withdraw command gone wrong? (/showthread.php?tid=303876)



[HELP] Withdraw command gone wrong? - MadalinX5 - 15.12.2011

Hello guys, I was,today, trying to make a /withdraw command but it doesn't seem to work as I wanted . Everytime I type /withdraw ingame it keeps telling me the Syntax (/withdraw [ammount])

pawn Код:
if(strcmp(cmd, "/withdraw", true) == 0)
    {
        new tmp[128], Cash;
        Cash = strval(tmp);

        if(strlen(tmp) == 0) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /withdraw [ammount]");
        {
            if(Cash > PlayerInfo[playerid][pBank]) return SendClientMessage(playerid,COLOR_RED,"[ERROR]: Your bank account doesn't have enough funds.");
            if(ItemLaptop[playerid] == 0) return SendClientMessage(playerid,COLOR_RED,"[ERROR]: You don't have a laptop");
            new string[218];
            GetPlayerName(playerid,Nam,sizeof(Nam));
            format(string, sizeof(string), "[E-BANK]: You have withdrawed %d$ from your Cyb3r B4nk account.", Cash);
            SendClientMessage(playerid, COLOR_YELLOW, string);
            PlayerInfo[playerid][pBank] = Cash;
            GivePlayerMoney(playerid, Cash);
            PlayerInfo[playerid][pBank] = -Cash;
        }
        return 1;
    }



Re: [HELP] Withdraw command gone wrong? - MadalinX5 - 16.12.2011

Bump?


Re: [HELP] Withdraw command gone wrong? - Jack_Leslie - 16.12.2011

change strval(tmp) to strvalEx(tmp);


Re: [HELP] Withdraw command gone wrong? - §с†¶e®РµРe - 16.12.2011

OMG Still hung up with strcmp and strval change to zcmd and sscanf2 man get a life


Re: [HELP] Withdraw command gone wrong? - Jack_Leslie - 16.12.2011

Quote:
Originally Posted by §с†¶e®РµРe
Посмотреть сообщение
OMG Still hung up with strcmp and strval change to zcmd and sscanf2 man get a life
Man, calm down, if your not gonna help then don't bother replying to someones thread, and most of all don't flame for no reason.


Re: [HELP] Withdraw command gone wrong? - adios1 - 16.12.2011

Quote:
Originally Posted by Jack_Leslie
Посмотреть сообщение
Man, calm down, if your not gonna help then don't bother replying to someones thread, and most of all don't flame for no reason.
He's right man, He came here for help. He didn't come here for shit


Re: [HELP] Withdraw command gone wrong? - BlackSA - 16.12.2011

You didn't defined tmp with strtok...

PHP код:
tmp strtok(cmdtext,parameter); 
Change the parameter to yours parameter, usually pepole use "idx".


Re: [HELP] Withdraw command gone wrong? - shitbird - 16.12.2011

Hi Madalin.
Please excuse §с†¶e®РµРe, that comment was uncalled for.

Sadly, I'm not any good at strtok, so I cannot help you, but if you at some point decide to convert your commands to DCMD / ZCMD / YCMD, let me know, and I will gladly help you out.


Re: [HELP] Withdraw command gone wrong? - MadalinX5 - 17.12.2011

Hello repliers I finally figured it out thanks to BlackSA. +1

@shitbird: I would like to convert to DCMD / ZCMD / YCMD / SSCANF 2.0 but I made a lot of my commands that are in the GM using strtok and strval and converting them all would take an awful lot of time. Thanks for the tip anyway I use ZCMD and SSCANF 2.0 for Filterscript thought