29.09.2012, 21:57
First u must creat the teams . for that use somehting like
Top of the FS (Botom fo your "new" and "includ"
then try to give a id to each team for example let's say Medic will be 1 and firefighters 2 and citizians will be team 3
so when the player spawn u will give the information "in wich team are they"
let's say this will be in onplayerspawn
ok now that evry players has a id team
let see how the cmd will work
So what we gonna do ? check the team of the player that is using the CMD ! and if he is a med or FireF then the roadblocks will be placed
"i take the cmd u are using in the FS"
Hop i was helpfull
Top of the FS (Botom fo your "new" and "includ"
Quote:
static team[MAX_PLAYERS]; |
so when the player spawn u will give the information "in wich team are they"
let's say this will be in onplayerspawn
Код:
if( blabla )team[playerid] = 1; if( blabla)team[playerid] = 2; if( blabla)team[playerid] = 3;
let see how the cmd will work
So what we gonna do ? check the team of the player that is using the CMD ! and if he is a med or FireF then the roadblocks will be placed
"i take the cmd u are using in the FS"
Код:
CMD:roadblock(playerid, params[]) { if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You need to be admin to use this command");// ok so this means that only admins can use it, remove this line if you wanna set Medic and FireF use this cmd too without beeing admin if(team[playerid] == 1||team[playerid] == 2){ if(RoadBlockDeployed[playerid] == 0) { new Float, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); new Float:angle; GetPlayerFacingAngle(playerid, angle); RoadBlockDeployed[playerid] = 1; SendClientMessage(playerid, COLOR_GREEN, "Roadblock deployed, Destroy it using - /destroyrb"); PlayerRB[playerid] = CreateObject(981, x, y, z, 0, 0, angle); SetPlayerPos(playerid, x, y, z+1); } else { SendClientMessage(playerid, COLOR_RED, "You already have a deployed roadblock, Please destroy it - /destroyrb");}else return SendClientMessage(playerid, COLOR_RED, "You can't use this cmd or blablabla put your text there"); }