Quote:
Originally Posted by SymonClash
pawn Код:
CMD:m(playerid,params[]) { new text[128], carid = GetPlayerVehicleID(playerid); for(new tt = 0; tt < sizeof police_vehicles; tt++) if(gTeam[playerid] == TEAM_POLICE && carid == police_vehicles[tt]) { if(sscanf(params,"s[128]",text)) return SendClientMessage(playerid,white,"Usage: /m [text]"); foreach (new i : Player) { new Float:tx,Float:ty,Float:tz; GetPlayerPos(i,tx,ty,tz); new Float: pdistance = GetPlayerDistanceFromPoint(i,tx,ty,tz); if(pdistance < 8.0) SendClientMessage(i, white, text); } } else { return SendClientMessage(playerid,white,"You must be on Police Duty and sit in Police Vehicle"); } return 1;
}
I don't know how are you using gTeam but it should be "TEAM_POLICE" and not just "Police". Also use foreach for loops.
And, your code is a mess.
|
its not about Police or TEAM_POLICE
gTeam == Police work fine
about your code it replay like first think i say
You must be on Police Duty and sit in Police Vehicle