29.09.2012, 21:41
Quote:
/ 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; } |