pawn Код:
//you have to define the colors for yourself ofc.
//can't just copy that n' go usin' it :P
YCMD:pu(playerid, params[], help)
{
if(help) return SendClientMessage(playerid, gray, "You can ask a criminal suspectto pull over using /pu [ID]");
new id;
if(sscanf(params,"d",id)) return SendClientMessage(playerid,red,"USAGE: /pu [ID]");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,red,"Invalid ID!");
if(!GetPlayerWantedLevel(id)) return SendClientMessage(playerid,red,"That's not a criminal suspect!");
new s[81],pn[MAX_PLAYER_NAME];
GetPlayerName(playerid,pn,MAX_PLAYER_NAME);
format(s,sizeof s,"Police Officer %s[%d] has asked you to PULL OVER, NOW!",pn,playerid);
SendClientMessage(id,blue,s);
GetPlayerName(id,pn,MAX_PLAYER_NAME);
format(s,sizeof s,"You've asked %s[%d] to pull over.",pn,id);
SendClientMessage(playerid,white,s);
return 1;
}
since we're using YCMD here, we can use
pawn Код:
if(gTeam[playerid] == TEAM_COPS)
Command_SetPlayerNamed("pu", playerid, true);
to 'assign' that command to the police class.put that in class selection or onplayerspawn, idk! wherever you like
Like this, no other class will be able to use it or even see that
such a command exists :P