SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 23/08/2011, 01:50 PM   #1
Huge Clucker
Jafet_Macario's Avatar
Join Date: Jul 2011
Posts: 439
Reputation: 67
Default Help

Hey, so I'm trying to make a command with multiple parameters, I mean:
/put [option] [ammount]
And the option can be " Materials " or " Drugs ".With strcmp I got it, but can't get it with ZCMD, looked over tutorials but didn't find anything like this.So, for exemple:
 /put Materials 50
 /put Drugs 10
Until now I got this code, but it's not working in game...:
pawn Code:
CMD:put(playerid, params[])
    new le = PlayerInfo[playerid][pLeader], me = PlayerInfo[playerid][pMember], string[24], option, value;
    if(le==1||le==2||le==3||le==4||le==7||le==9||le==10||le==11||me==1||me==2||me==3||me==4||me==7||me==9||me==10||me==11) return SCM(playerid, COLOR_GREY,"You are not a gang member");
    else if(!PlayerToPoint(25.0,playerid,2027.5966,1008.9321,10.8203) || !PlayerToPoint(3.0,playerid,-2190.7061,641.7987,49.4375) || !PlayerToPoint(3.0,playerid,2782.7209,-1957.9377,13.5469) || !PlayerToPoint(3.0,playerid,679.4280,-1276.8392,13.5956) || !PlayerToPoint(3.0,playerid,2156.3076,-1455.8517,25.5391) || !PlayerToPoint(3.0,playerid,2494.8640,-1668.1879,13.3438)) return SCM(playerid, COLOR_GREY,"You are not at the right place");
    else if (sscanf(params, "s[24]i", option, value)) return SCM(playerid, COLOR_GREY,"USAGE: /put [Materials/Drugs] [ammount]");
        if(value > PlayerInfo[playerid][pMats]) return SCM(playerid, COLOR_GRAD2, "You don't have that much!");
            PlayerInfo[playerid][pMats] -= value;
            PlayerInfo[playerid][pDepositedMats] += value;
            format(string, sizeof(string), "you deposited %d materials!", value);
            SendClientMessage(playerid, COLOR_GRAD4, string);
        if(value > PlayerInfo[playerid][pDrugs]) return SCM(playerid, COLOR_GRAD2, "You don't have that much!");
            PlayerInfo[playerid][pDrugs] -= value;
            PlayerInfo[playerid][pDepositedDrugs] += value;
            format(string, sizeof(string), "you deposited %d grams of drugs!", value);
            SendClientMessage(playerid, COLOR_GRAD4, string);
    return 1;
Anyone can help me out please?
Jafet_Macario is offline  

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT. The time now is 09:05 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.