/orderweapon Help
#1

Код:
  	if(strcmp(cmdtext, "/orderweapon", true) == 0)
	{
	  new tmp2[256];
	  GetPlayerTeam(playerid);
		if(gTeam[playerid] == TEAM_Gundealer)
		tmp = strtok(cmdtext, idx);
 		tmp2 = strtok(cmdtext, idx);
    	new gun = strval(tmp);
    	new ammo = strval(tmp2);
		if(!strlen(tmp2)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /orderweapon [ID] [Ammo]");
		if(!strlen(tmp3)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /orderweapon [ID] [Ammo]");
		GivePlayerWeapon(playerid, gun, ammo);
		return 1;
	}
It gives me these errors:

: error 003: declaration of a local variable must appear in a compound block
: error 017: undefined symbol "tmp2"
: warning 215: expression has no effect
: error 001: expected token: ";", but found "]"
: fatal error 107: too many error messages on one line

where i have tmp = strtok(cmdtext, idx);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)