Non-working command
#1

Код:
if (strcmp("/spyspec", cmdtext, true, 10) == 0)

{
	if (pInfo[playerid][pSpy] == 1)
	{
	  if (pInfo[playerid][pSpec] == 1)
	    {
	      TogglePlayerSpectating(playerid, 0);
	      pInfo[playerid][pSpec] = 0;
			}
			else
			{
			  pInfo[playerid][pSpec] = 1;
				new idx;
				new tmp[30];
				tmp = strtok(cmdtext, idx);
		    new otherplayer = strval(tmp);
		    if(IsPlayerConnected(otherplayer))
		    {
		      TogglePlayerSpectating(playerid, 1);
			  	PlayerSpectatePlayer(playerid, otherplayer); //if you want you can copy this command and change Ban to Kick to kick a player
		    }
		return 1;}
  }
  else
  {
		SendClientMessage(playerid, COLOR_RED, "** You need to be a spy to use that command");
	}
	return 1;
	}
if I do /spyspec 0, it gives me unknown command. However if I do /spyspec when I'm a spy, it specs ID 0.

I can't work out why
Reply


Messages In This Thread
Non-working command - by Packer5 - 01.04.2010, 11:13
Re: Non-working command - by [MWR]Blood - 01.04.2010, 11:17
Re: Non-working command - by Last_Stand_Guardian - 01.04.2010, 11:18
Re: Non-working command - by Packer5 - 01.04.2010, 11:41

Forum Jump:


Users browsing this thread: 2 Guest(s)