Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #define WHITE 0xFFFFFFFF
- #define BLUE 0x0505F5FF
- #define YELLOW 0xF5F507FF
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- enum PlayerStatistics
- {
- PendingInvite,
- IsMember,
- IsLeader,
- Duty,
- };
- new Player[MAX_PLAYERS][PlayerStatistics];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print("Police Department Script by GGRoleplay/Brandon");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- CMD:pdhelp(playerid)
- {
- if(Player[playerid][IsMember] == 1)
- {
- ShowPlayerDialog(playerid, 2376, DIALOG_STYLE_MSGBOX, "PD Commands", "/makeleader\n/invite [id]\n/makeleader\n/invite\n", "Ok", "");
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You're not a Police Department member!");
- }
- }
- CMD:makeleader(playerid, params[])
- {
- new id;
- if(IsPlayerAdmin(playerid) || Player[playerid][IsLeader] == 1)
- {
- if(sscanf(params, "n", id)) return SendClientMessage(playerid, WHITE, "USAGE: /makeleader [id]");
- {
- new string[255];
- Player[playerid][IsMember] = 1;
- Player[playerid][IsLeader] = 0;
- Player[id][IsLeader] = 1;
- Player[id][IsMember] = 1;
- SetPlayerSkin(id, 283);
- SendClientMessage(id, YELLOW, "Congratulations! You're the new leader of the Police Department!");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(Player[i][IsMember] == 1)
- {
- format(string, sizeof(string), "%s is the new Police Department leader!", GetName(id));
- SendClientMessage(i, YELLOW, string);
- }
- }
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You need to be a RCON admin or leader of the PD to make someone else leader..");
- }
- return 1;
- }
- CMD:invite(playerid, params[])
- {
- new id;
- if(IsPlayerAdmin(playerid) || Player[playerid][IsLeader] == 1)
- {
- if(sscanf(params, "n", id)) return SendClientMessage(playerid, WHITE, "USAGE: /invite [id]");
- {
- new string[255], string2[255];
- format(string, sizeof(string), "You have been invited to the Police Department by %s (/acceptinvite)", GetName(playerid));
- format(string2, sizeof(string2), "You have invited %s to the Police Department", GetName(id));
- SendClientMessage(id, YELLOW, string);
- SendClientMessage(playerid, YELLOW, string2);
- Player[id][PendingInvite] = 1;
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You need to be a RCON admin or leader of the PD to invite someone.");
- }
- return 1;
- }
- CMD:acceptinvite(playerid, params[])
- {
- if(Player[playerid][PendingInvite] == 1)
- {
- new string[255];
- Player[playerid][PendingInvite] = 0;
- Player[playerid][IsMember] = 1;
- SetPlayerSkin(playerid, 281);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(Player[i][IsMember] == 1)
- {
- format(string, sizeof(string), "%s has joined the Police Department.", GetName(playerid));
- SendClientMessage(i, YELLOW, string);
- }
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You're not pending an invite!");
- }
- }
- CMD:leavepd(playerid, params[])
- {
- new string[255];
- if(Player[playerid][IsMember] == 1)
- {
- Player[playerid][IsMember] = 0;
- Player[playerid][IsLeader] = 0;
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(Player[i][IsMember] == 1)
- {
- format(string, sizeof(string), "%s has left the Police Department.", GetName(playerid));
- SendClientMessage(i, YELLOW, string);
- }
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You're not in the Police Department.");
- }
- }
- stock GetName(playerid)
- {
- new Name[MAX_PLAYER_NAME];
- if(IsPlayerConnected(playerid))
- {
- GetPlayerName(playerid, Name, sizeof(Name));
- }
- else
- {
- Name = "Disconnected/Nothing";
- }
- return Name;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement