Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- CMD:invit(playerid, params[])
- {
- new target;
- if(!LawE(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You are not allowed to use this command");
- if(!duty(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You need be on duty");
- if(strcmp(GetName(playerid), Factions[U_Stats[playerid][pFaction]][fLeader])) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You need to be the leader of the faction");
- if(sscanf(params, "u", target)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /invit [player_id]");
- if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] This player is not connected");
- if(U_Stats[target][pFaction] == -1) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] This player is in a faction.");
- new INI:File = INI_Open(UserPath(target));
- INI_SetTag(File, "data");
- INI_WriteString(File, "Rank", rankFac[U_Stats[playerid][pFaction]][0][0]);
- INI_WriteInt(File, "Faction", U_Stats[playerid][pFaction]);
- INI_Close(File);
- INI_ParseFile(UserPath(target), "LoadUser_%s", .bExtra = true, .extra = target);
- new str[200];
- format(str, sizeof(str), "{82CAFF}ยป %s %s has invited %s in the faction!", U_Stats[playerid][pRank], GetName(playerid), GetName(target));
- FacRadio(playerid, str);
- return 1;
- }
- //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- CMD:fire(playerid, params[])
- {
- new target;
- if(!LawE(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You are not allowed to use this command");
- if(!duty(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You need be on duty");
- if(strcmp(GetName(playerid), Factions[U_Stats[playerid][pFaction]][fLeader]) && U_Stats[playerid][pLevel] < 12) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You need to be the leader of the faction");
- if(sscanf(params, "u", target)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /fire [player_id]");
- if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] This player is not connected");
- if(U_Stats[target][pFaction] == -1 || U_Stats[target][pFaction] != U_Stats[playerid][pFaction]) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] This player is not in your faction.");
- if(!strcmp(Factions[U_Stats[target][pFaction]][fLeader], GetName(playerid)))
- {
- new INI:file = INI_Open(FactionPath(U_Stats[target][pFaction]));
- INI_SetTag(file, "data");
- INI_WriteString(file,"Leader","None");
- INI_Close(file);
- INI_ParseFile(FactionPath(U_Stats[target][pFaction]), "LoadFaction_data", .bExtra = true, .extra = U_Stats[target][pFaction]);
- new INI:File = INI_Open(UserPath(target));
- INI_SetTag(File, "data");
- INI_WriteString(File, "Rank", "None");
- INI_WriteInt(File, "Faction", -1);
- INI_Close(File);
- INI_ParseFile(UserPath(target), "LoadUser_%s", .bExtra = true, .extra = target);
- SetPlayerArmour(playerid, 0.0);
- ResetPlayerWeapons(playerid);
- }
- else
- {
- new INI:File = INI_Open(UserPath(target));
- INI_SetTag(File, "data");
- INI_WriteString(File, "Rank", "None");
- INI_WriteInt(File, "Faction", -1);
- INI_Close(File);
- INI_ParseFile(UserPath(target), "LoadUser_%s", .bExtra = true, .extra = target);
- SetPlayerArmour(playerid, 0.0);
- ResetPlayerWeapons(playerid);
- }
- new str[200];
- format(str, sizeof(str), "{82CAFF}ยป %s %s has fired %s", U_Stats[playerid][pRank], GetName(playerid), GetName(target));
- FacRadio(playerid, str);
- return 1;
- }
- //------------------------------------------------------------------------------------------------
- // ==============================================================================================
- // Los Angeles Fire Department | Commands
- // ==============================================================================================
- //------------------------------------------------------------------------------------------------
- CMD:healthcare(playerid, params[])
- {
- if(IsPlayerInRangeOfPoint(playerid, 12.5, 1973.4854, 1167.9103, -5.2087))
- {
- new text[128];
- if(sscanf(params, "s", text))
- {
- if(U_Stats[playerid][pHealthCare] == 0)
- {
- ProxDetector(15, playerid, "{D1D1D1}Dash Female says: Hi, It seems like you do not have a health care yet! Do you want to purchase it?",-1);
- SendClientMessage(playerid, -1, "{FFFFFF}[{82CAFF}Info{FFFFFF}] Use /healthcare purchase for $2.500");
- }
- else
- {
- ProxDetector(15, playerid, "{D1D1D1}Dash Female says: Hi, You already have bought healthcare!",-1);
- }
- }
- else
- {
- new string[128];
- format(string, sizeof(string), "{D1D1D1}%s says: Yes.", GetName(playerid));
- ProxDetector(15, playerid, string, -1);
- if(GetPlayerMoney(playerid) > 2499)
- {
- U_Stats[playerid][pHealthCare] = 1;
- ProxDetector(15, playerid, "{D1D1D1}Dash Female says: Thank you for purchasing the health care!",-1);
- GivePlayerMoney(playerid, -2500);
- }
- else
- {
- ProxDetector(15, playerid, "{D1D1D1}Dash Female says: Please come back once you have 2500 dollars.",-1);
- }
- }
- }
- return 1;
- }
- //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------
- // ==============================================================================================
- // Los Angeles Police Department | Commands
- // ==============================================================================================
- //------------------------------------------------------------------------------------------------
- new IsSuspect[MAX_PLAYERS];
- new IsPrisonnier[MAX_PLAYERS];
- CMD:duty(playerid,params[])
- {
- if(!LawE(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You are not allowed to use this command");
- //if(!IsPlayerInRangeOfPoint(playerid, range, x, y, z)) return SendClientMessage(playerid, -1, "[{82CAFF}Infomation{FFFFFF}] You must be at the comico'");;
- if(IsOnDuty[playerid] == false)
- {
- new str[128];
- IsOnDuty[playerid] = true;
- SendClientMessage(playerid, -1, "[{82CAFF}Infomation{FFFFFF}] You are now on duty");
- format(str, sizeof(str), "* %s take his badge, weapon and radio.", GetName(playerid));
- ProxDetector(15, playerid, str, 0xCC56CCFF);
- SetPlayerArmour(playerid, 100.0);
- GivePlayerWeapon(playerid, WEAPON_DEAGLE, 100);
- GivePlayerWeapon(playerid, WEAPON_NITESTICK, 1);
- GivePlayerWeapon(playerid, WEAPON_SPRAYCAN, 1000);
- return 1;
- }
- else
- {
- new str[128];
- IsOnDuty[playerid] = false;
- SendClientMessage(playerid, -1, "[{82CAFF}Infomation{FFFFFF}] You are no longer on duty");
- format(str, sizeof(str), "* %s put his badge, weapon, radio into his locker.", GetName(playerid));
- ProxDetector(15, playerid, str, 0xCC56CCFF);
- SetPlayerArmour(playerid, 0.0);
- ResetPlayerWeapons(playerid);
- return 1;
- }
- }
- //------------------------------------------------------------------------------------------------
- CMD:m(playerid, params[])
- {
- if(!LawE(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You are not allowed to use this command");
- if(!duty(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You need be on duty");
- if(U_Stats[playerid][pFaction] != 1 && U_Stats[playerid][pFaction] != 2) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You aren't allowed to use this command");
- new text[150];
- if(sscanf(params, "s[149]", text)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /m [Message]");
- format(text, sizeof(text), "{ff0000}((%s | %s)) {FFFFFF}%s", GetName(playerid), Factions[U_Stats[playerid][pFaction]-1][fShortName], text);
- ProxDetector(30, playerid, text, -1);
- return 1;
- }
- //------------------------------------------------------------------------------------------------
- CMD:r(playerid, params[])
- {
- new text[150];
- if(sscanf(params, "s[149]", text)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /r [Message]");
- format(text, sizeof(text), "{1E90FF}(Radio) %s %s : %s", U_Stats[playerid][pRank], GetName(playerid), text);
- FacRadio(playerid, text);
- return 1;
- }
- //------------------------------------------------------------------------------------------------
- CMD:d(playerid, params[])
- {
- if(!LawE(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You are not allowed to use this command");
- if(!duty(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You need be on duty");
- new text[150];
- if(sscanf(params, "s[149]", text)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /d (regional) [Message]");
- format(text, sizeof(text), "{B4BA00}(%s) %s %s : %s", Factions[U_Stats[playerid][pFaction]-1][fShortName], U_Stats[playerid][pRank], GetName(playerid), text);
- DepRadio(playerid, text);
- return 1;
- }
- //------------------------------------------------------------------------------------------------
- CMD:su(playerid, params[])
- {
- if(!LawE(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You are not allowed to use this command");
- if(!duty(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You need be on duty");
- new target, reason[111];
- if(sscanf(params, "is[110]", target, reason)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /su(uspect) [target_id] [reason]");
- new str[120];
- format(str, sizeof(str), "[{82CAFF}SUSPECT{FFFFFF}] %s | %s %s make %s suspect | Reason : %s", Factions[U_Stats[playerid][pFaction]-1][fShortName], U_Stats[playerid][pRank], GetName(playerid), GetName(target), reason);
- IsSuspect[target] = 1;
- DepRadio(playerid, str);
- return 1;
- }
- //------------------------------------------------------------------------------------------------
- CMD:arrest(playerid, params[])
- {
- if(!LawE(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You are not allowed to use this command");
- if(!duty(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You need be on duty");
- new Float:x, Float:y, Float:z, target, time, fine;
- if(sscanf(params, "iii", target, time, fine)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /arrest [target_id] [time] [fine]");
- if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] Wrong player ID");
- if(IsSuspect[target] != 1) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] This player is not suspect!");
- GetPlayerPos(playerid, x, y, z);
- //if(!IsPlayerInRangeOfPoint(player, 5.0, x, y, z)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You need to be at the prison");
- if(!IsPlayerInRangeOfPoint(target, 5.0, x, y, z)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] The suspect need to be near you!");
- time = time * 60 * 1000;
- SetPlayerPos(target, x, y, z);
- SetTimerEx("FreePrisoniers", time, false, "ii", target, time);
- new str[150];
- format(str, sizeof(str), "[{82CAFF}%s{FFFFFF} Policier %s has arrested %s", Factions[U_Stats[playerid][pFaction]-1][fShortName], GetName(playerid), GetName(target));
- SendClientMessageToAll(-1, str);
- //SetPlayerPos(target, x, y, z);
- IsPrisonnier[target] = 1;
- return 1;
- }
- forward FreePrisoniers(suspect, playerid, time);
- public FreePrisoniers(suspect, playerid, time)
- {
- SetPlayerPos(suspect,1544.2457,-1675.5072,13.5580);
- IsSuspect[suspect] = 0;
- IsPrisonnier[suspect] = 0;
- SendClientMessage(suspect, -1, "[{82CAFF}Prison{FFFFFF}]You are now free.");
- new str[150];
- format(str, sizeof(str), "{82CAFF}ยป %s has been released from the prison after %i min(s)", GetName(suspect), time);
- DepRadio(playerid, str);
- return 1;
- }
- //------------------------------------------------------------------------------------------------------------------------------------------------------------
- stock DepRadio(playerid, string[])
- {
- if(!LawE(playerid)) return 1;
- if(IsPrisonnier[playerid] == 1) return 1;
- new text[150];
- foreach(new i : Player)
- {
- if(!LawE(playerid)) continue;
- format(text, sizeof(text), "%s", string);
- SendClientMessage(i, -1, text);
- }
- return 1;
- }
- stock FacRadio(playerid, string[])
- {
- if(IsPrisonnier[playerid] == 1) return 1;
- new text[150];
- foreach(new i : Player)
- {
- if(U_Stats[playerid][pFaction] != U_Stats[i][pFaction]) continue;
- format(text, sizeof(text), "%s", string);
- SendClientMessage(i, -1, text);
- }
- return 1;
- }
- new bool:IsOnDuty[MAX_PLAYERS] = false;
- stock duty(playerid)
- {
- return (IsOnDuty[playerid] ? true : false);
- }
- stock LawE(playerid)
- {
- return (U_Stats[playerid][pFaction] == 1 || U_Stats[playerid][pFaction] == 2 ? true : false);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement