Commands only for specifice team
#1

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!
Reply
#2

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

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;
}
Reply
#4

plz help me
Reply
#5

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


Forum Jump:


Users browsing this thread: 1 Guest(s)