SA-MP Forums Archive
Commands only for specifice team - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Commands only for specifice team (/showthread.php?tid=72923)



Commands only for specifice team - krisis32 - 11.04.2009

How to make a command that can only use a cop?

Example - /opd .. how to make only cop can do the command.. others get messege: You are not a cop!



Re: Commands only for specifice team - MenaceX^ - 11.04.2009

pawn Код:
if(!TEAM_COP[playerid])
  return SendClientMessage(playerid,color,"You aren't a cpo.");



Re: Commands only for specifice team - krisis32 - 11.04.2009

error:

Код:
E:\sa-mp servers\gamemodes\wwrrp.pwn(605) : error 029: invalid expression, assumed zero
E:\sa-mp servers\gamemodes\wwrrp.pwn(605) : error 029: invalid expression, assumed zero
E:\sa-mp servers\gamemodes\wwrrp.pwn(605) : warning 215: expression has no effect
E:\sa-mp servers\gamemodes\wwrrp.pwn(605) : error 001: expected token: ";", but found "]"
E:\sa-mp servers\gamemodes\wwrrp.pwn(605) : fatal error 107: too many error messages on one line
the line:

pawn Код:
if(!TEAM_COP[playerid])
full command:

pawn Код:
if( !strcmp(cmdtext, "/mp", true, 3) ) // 3 is the length of /me
{
 
    new str[256], pname[256];
    GetPlayerName(playerid, pname, 256);
    format(str, 256, "(Officer %s: %s )", pname, cmdtext[4]);
    SendClientMessageToAll(COLOR_BLUE, str);
  if(!TEAM_COP[playerid])
  return SendClientMessage(playerid,color,"You aren't a cpo.");
    return 1;
}



Re: Commands only for specifice team - krisis32 - 11.04.2009

plz help me


Re: Commands only for specifice team - NeRoSiS - 11.04.2009

Read the PWN basics tutorial, everything you need is on the wiki, learn file functions, for instance revise on DINI and basic PWN.