for some reason it it always doing the first cmd
#1

here is the beging but i dont wat the problem is it always does the cmd even if i do one that dosent exist like /hi i dont ge it help

thanks

Код:
		new cmd[256];
		new tmp[256];
		new sendername[MAX_PLAYER_NAME];
		new giveplayer[MAX_PLAYER_NAME];
		new giveplayerid, idx;
		new moneys;
		/////////////////////////////////////////////gangs////////////////////////////////////////
		//==============================================================================
		if(strcmp(cmd, "/gang",true)==0)
		{
	 	new gangcmd, gangnum;
		tmp = strtok(cmdtext, idx);
		new string[128];

		if(!strlen(tmp)) {
		SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gang [create/join/quit] [name/number]");
		return 1;
		}
		giveplayerid = strval(tmp);
Reply
#2

Ehh... use dcmd as it's faster, simpler, and more reliable. Here's the answer to ur probs

Give it a try.
Reply
#3

I'm pretty sure you have to use strtok on 'cmd' for before doing the commands.
pawn Код:
new cmd[256];
        new tmp[256];
        new sendername[MAX_PLAYER_NAME];
        new giveplayer[MAX_PLAYER_NAME];
        new giveplayerid, idx;
        new moneys;
        cmd = strtok(cmdtext,idx); //<--Here
        /////////////////////////////////////////////gangs////////////////////////////////////////
        //==============================================================================
        if(strcmp(cmd, "/gang",true)==0)
        {
Reply
#4

oooh yeh thanks man and i use dcmd for other cmds
Reply
#5

Quote:
Originally Posted by [KG
Nikere ]
Ehh... use dcmd as it's faster, simpler, and more reliable.
Or zcmd, which is even more faster and more simple than dcmd.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)