[HELP] Withdraw command gone wrong?
#1

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

Bump?
Reply
#3

change strval(tmp) to strvalEx(tmp);
Reply
#4

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

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

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

You didn't defined tmp with strtok...

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

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

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)