Stupid /find problem
#1

hey guys i tried to make a /find command for cops ....
so it goes like this :
up at the gm
Код:
forward AllowFind(playerid);
the public

Код:
public AllowFind(playerid)
{
	canFind[playerid] = 0;
}
the command

Код:
    if(strcmp(cmdtext,"/find",true) == 0)
	{
		if(PlayerInfo[playerid][pCop] == 0)
		{
		    SendClientMessage(playerid,COLOR_RED,"You are not a cop!");//if the player isnt cop
		}
		if(PlayerInfo[playerid][pCop] > 1 && PlayerInfo[playerid][CopDuty] == 0 ) return SendClientMessage(playerid,COLOR_AFOR,"Ur not on cop duty!"); // if the player has the right rank of cop but he aint on duty
		if(PlayerInfo[playerid][pCop] == 1) return rank(playerid);// its a function that returns SendClientMessage(playerid,COLOR_RED,"Your rank doesnt allow you to use this tool!");
			if(PlayerInfo[playerid][pCop] > 1 && PlayerInfo[playerid][CopDuty] == 1)//if the player's cop rank is bigger then 1 + the player is on duty
			{
			new tmp[256];
			tmp = strtok(cmdtext, idx);
			new victim = strval(tmp);//the victim,the playerid
			if(!IsPlayerConnected(victim)) return notc(playerid);//if the players isnt connected it returns the function notc(playerid) - SendClientMessage(playerid,COLOR_RED,"That player is not connected!");
			if(strlen(tmp) == 0) return SendClientMessage(playerid,COLOR_RED,"Usage : /find [PLAYERID]");// if he doesnt writes the playerid
			switch(canFind[playerid])//the switch for variable canFind to this player
			{
				case 0://in case canFind for this player is 0,means he has not used this command yet.(for the 60 lats seconds) then it will find the player.
				{
				SetPlayerMarkerForPlayer(playerid,strval(tmp),COLOR_RED);//mark the victim as red
				SendClientMessage(playerid,COLOR_AFOR,"Hurry,the red marker will be gone in 60 seconds!");
				SetTimerEx("AllowFind", 60000, false, "i", playerid);//runs the timer AllowFind for this player
				}
				case 1:
				{//if the player's canFind variable is still 1 then it will do ....
				SendClientMessage(playerid,COLOR_AFOR,"You have to wait 60 seconds after usind this tool!");
				}
			}
			}
		
		return 1;
	}
when im not at duty.it says "ur not on duty" like it should
but when i am on duty and i am level 2 cop,i use /find and it returns me "usage : /find [playerid]"
and here is the big problem
when i do /find 0(my id) it returns me 0(SERVER:Unknow command.and doesnt do anything i put in the command
Reply


Messages In This Thread
Stupid /find problem - by bijoyekuza - 19.03.2011, 12:16
Re: Stupid /find problem - by Klutty - 19.03.2011, 12:31
Re: Stupid /find problem - by bijoyekuza - 19.03.2011, 12:57
Re: Stupid /find problem - by JaTochNietDan - 19.03.2011, 13:00
Re: Stupid /find problem - by bijoyekuza - 19.03.2011, 13:28
Re: Stupid /find problem - by JaTochNietDan - 19.03.2011, 13:34
Re: Stupid /find problem - by bijoyekuza - 19.03.2011, 14:29

Forum Jump:


Users browsing this thread: 1 Guest(s)