Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- =============================================
- | CCTV SYSTEM |
- | (commands) |
- =============================================
- */
- //cerca: ADMIN LEVEL HERE - da sostituire RCON con AdmLevel;
- //cerca: FACTION HERE - da sostuire con fazione del giocatore;
- //cerca: FACTION VEH HERE - da sostuire con veicolo di X fazione.
- CMD:helpcctv(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendError(playerid, "You are not authorized to use this command."); //ADMIN LEVEL HERE
- SendError(playerid, "Available commands:");
- SendClientMessage(playerid, -1, "/createcctv - /deletecctv - /editcctv - /rangecctv");
- SendClientMessage(playerid, -1, "/movecctv - /renamecctv - /factioncctv - /gotocctv");
- return 1;
- }
- CMD:createcctv(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendError(playerid, "You are not authorized to use this command."); //ADMIN LEVEL HERE
- new
- name[MAX_CCTV_NAME], factionid;
- if(sscanf(params, "ds[MAX_CCTV_NAME]", factionid, name)) return SendError(playerid, "/createcctv [factionid] [cctv_name]");
- new id = CreateCCTV(playerid, name, factionid);
- if(id == -1) return SendError(playerid, "You can not create more CCTV.");
- SendError(playerid, "AdmCmd: CCTV created successfully.");
- SendError(playerid, "[!] Remember to place the CCTV through the command /editcctv");
- return 1;
- }
- CMD:deletecctv(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendError(playerid, "You are not authorized to use this command."); //ADMIN LEVEL HERE
- new id;
- if(sscanf(params, "d", id)) return SendError(playerid, "/deletecctv [cctv_id]");
- DeleteCCTV(playerid, id);
- return 1;
- }
- CMD:editcctv(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendError(playerid, "You are not authorized to use this command."); //ADMIN LEVEL HERE
- new id;
- if(sscanf(params, "d", id)) return SendError(playerid, "/editcctv [cctv_id]");
- EditCCTV(playerid, id);
- return 1;
- }
- CMD:movecctv(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendError(playerid, "You are not authorized to use this command."); //ADMIN LEVEL HERE
- new id;
- if(sscanf(params, "d", id)) return SendError(playerid, "/movecctv [cctv_id]");
- MoveCCTV(playerid, id);
- return 1;
- }
- CMD:renamecctv(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendError(playerid, "You are not authorized to use this command."); //ADMIN LEVEL HERE
- new
- name[MAX_CCTV_NAME], id;
- if(sscanf(params, "ds[MAX_CCTV_NAME]", id, name)) return SendError(playerid, "/renamecctv [cctv_id] [name]");
- ChangeCCTVName(playerid, id, name);
- return 1;
- }
- CMD:factioncctv(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendError(playerid, "You are not authorized to use this command."); //ADMIN LEVEL HERE
- new
- id, factionid;
- if(sscanf(params, "dd", id, factionid)) return SendError(playerid, "/factioncctv [cctv_id] [factionid]");
- ChangeCCTVFaction(playerid, id, factionid);
- return 1;
- }
- CMD:gotocctv(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendError(playerid, "You are not authorized to use this command."); //ADMIN LEVEL HERE
- new id;
- if(sscanf(params, "d", id)) return SendError(playerid, "/gotocctv [cctv_id]");
- if(!Iter_Contains(CCTVIter, id)) return SendError(playerid, "The ID of the typed CCTV is nonexistent. (Use Server ID)");
- SetPlayerPos(playerid, CCTVInfo[id][cctv_X], CCTVInfo[id][cctv_Y], CCTVInfo[id][cctv_Z]);
- SetPlayerVirtualWorld(playerid, CCTVInfo[id][cctv_VW]);
- return 1;
- }
- CMD:rangecctv(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendError(playerid, "You are not authorized to use this command."); //ADMIN LEVEL HERE
- new
- exist, str[256];
- foreach(new i : CCTVIter)
- if(IsPlayerInRangeOfPoint(playerid, 10.0, CCTVInfo[i][cctv_X], CCTVInfo[i][cctv_Y], CCTVInfo[i][cctv_Z]))
- {
- exist = 1;
- format(str, sizeof str, "CCTV (#%d) - Name: %s - Faction ID: #%d");
- SendError(playerid, str);
- }
- if(!exist) return SendError(playerid, "There are CCTV near you. (RANGE: 10.0)");
- return 1;
- }
- CMD:cctv(playerid, params[])
- {
- //FACTION HERE & ADMIN LEVEL HERE & FACTION VEH HERE
- if(!IsPlayerAdmin(playerid)) return SendError(playerid, "You are not authorized to use this command.");
- if(inCCTV[playerid]) return SendError(playerid, "You are already viewing a CCTV. (/cctvoff).");
- ShowPlayerCCTVMenu(playerid);
- return 1;
- }
- CMD:cctvoff(playerid, params[])
- {
- //FACTION HERE & ADMIN LEVEL HERE
- if(!IsPlayerAdmin(playerid)) return SendError(playerid, "You are not authorized to use this command.");
- if(!inCCTV[playerid]) return SendError(playerid, "You're viewing a CCTV.");
- PlayerCancelCCTV(playerid);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement