
|
/ Torrans Roadblock System // Made by Torran // DO NOT REMOVE THESE CREDITS #include <a_samp> #include <zcmd> #define FILTERSCRIPT #if defined FILTERSCRIPT #define VERSION "v1" #define COLOR_RED 0xFF0000FF #define COLOR_GREEN 0x00FF00FF new RoadBlockDeployed[MAX_PLAYERS]; new PlayerRB[MAX_PLAYERS]; public OnFilterScriptInit() { print("\n |----------------------------------|"); printf(" | * Torran's Roadblock System %s * |", VERSION); print(" |----------------------------------|\n"); return 1; } public OnFilterScriptExit() { return 1; } public OnPlayerDisconnect(playerid, reason) { RoadBlockDeployed[playerid] = 0; DestroyObject(PlayerRB[playerid]); return 1; } #endif CMD:roadblock(playerid, params[]) { if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You need to be admin to use this command"); 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"); } return 1; } CMD:destroyrb(playerid, params[]) { if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You need to be admin to use this command"); if(RoadBlockDeployed[playerid] == 1) { RoadBlockDeployed[playerid] = 0; SendClientMessage(playerid, COLOR_GREEN, "Roadblock destroyed"); DestroyObject(PlayerRB[playerid]); } else { SendClientMessage(playerid, COLOR_RED, "There isn't a valid roadblock to destroy"); } return 1; } |
|
static team[MAX_PLAYERS]; |
if( blabla )team[playerid] = 1; if( blabla)team[playerid] = 2; if( blabla)team[playerid] = 3;
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");
}
CMD:roadblock(playerid, params[])
{
new Skin;
Skin = GetPlayerSkin(playerid);
if(Skin == 274||Skin == 275||Skin == 276||Skin == 27||Skin == 278||Skin == 279) ){
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");
return 1;