19.03.2011, 12:16
(
Последний раз редактировалось bijoyekuza; 19.03.2011 в 13:28.
)
hey guys i tried to make a /find command for cops ....
so it goes like this :
up at the gm
the public
the command
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
so it goes like this :
up at the gm
Код:
forward AllowFind(playerid);
Код:
public AllowFind(playerid) { canFind[playerid] = 0; }
Код:
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; }
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