Whats wrong with this command?
#1

Код:
{ // Your bracket was missing here and it was poorly indented
	if (strcmp("/cuff", cmdtext, true, 15) == 0) // This should work now
 	{
 		new tmp[128];
 		new idx;
		new giveplayerid;
		new giveplayer[MAX_PLAYER_NAME];
		new sendername[MAX_PLAYER_NAME];
		tmp = strtok(cmdtext, idx);
 		if(!strlen(tmp)) return SendClientMessage(playerid,0xAA3333AA,"USAGE: /cuff [playerid]");
// 		giveplayerid = strval(tmp); // The problem here was that is should be ReturnUser(tmp) instead of strval(tmp)
 		giveplayerid = ReturnUser(tmp);
 		if(gTeam[playerid] == TEAM_COP)
		{
			if(gTeam[giveplayerid] == TEAM_COP) return SendClientMessage(playerid,0xAA3333AA,"You cannot cuff cops !");
			TogglePlayerControllable(giveplayerid,0);
			GetPlayerName(giveplayerid,giveplayer,sizeof(giveplayer));
			GetPlayerName(playerid,sendername,sizeof(sendername));
			format(tmp,sizeof(tmp),"You have cuffed %s",giveplayer);
			SendClientMessage(playerid,0x33AA33AA,tmp);
			format(tmp,sizeof(tmp),"You have been cuffed by %s",sendername);
			SendClientMessage(giveplayerid,0xAA3333AA,tmp);
			return 1;
		}
		else return SendClientMessage(playerid,COLOR_GREY, "You are not a cop!"); // Added this to return a value if someone isn't a cop
	}
When i type /cuff it says "Server unknown command" When my skin is a cop
Reply


Messages In This Thread
Whats wrong with this command? - by killdahobo99 - 28.07.2009, 15:04
Re: Whats wrong with this command? - by killdahobo99 - 28.07.2009, 16:49
Re: Whats wrong with this command? - by clean180ollie - 28.07.2009, 16:51
Re: Whats wrong with this command? - by killdahobo99 - 28.07.2009, 17:07
Re: Whats wrong with this command? - by killdahobo99 - 28.07.2009, 17:42
Re: Whats wrong with this command? - by Nee - 28.07.2009, 18:19
Re: Whats wrong with this command? - by killdahobo99 - 28.07.2009, 18:28
Re: Whats wrong with this command? - by Jefff - 28.07.2009, 18:30
Re: Whats wrong with this command? - by killdahobo99 - 28.07.2009, 18:50
Re: Whats wrong with this command? - by Jefff - 28.07.2009, 18:51

Forum Jump:


Users browsing this thread: 2 Guest(s)