Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- #include <sscanf>
- #include <foreach>
- #define D_BLINDED 80001
- #define C_RED 0xFF0000FF
- #define C_CYAN 0x00FFFFFF
- new pBlind[MAX_PLAYERS] = 1;
- new Text:Blind;
- public OnGameModeInit()
- {
- Blind = TextDrawCreate(641.199951, 1.500000, "usebox");
- TextDrawLetterSize(Blind, 0.000000, 49.378147);
- TextDrawTextSize(Blind, -2.000000, 0.000000);
- TextDrawAlignment(Blind, 3);
- TextDrawColor(Blind, -1);
- TextDrawUseBox(Blind, true);
- TextDrawBoxColor(Blind, 255);
- TextDrawSetShadow(Blind, 0);
- TextDrawSetOutline(Blind, 0);
- TextDrawBackgroundColor(Blind, 255);
- TextDrawFont(Blind, 1);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- pBlind[playerid] = 0;
- return 1;
- }
- CMD:blinded(playerid,params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,C_RED,"You are not authorised to use this command.");
- new count = 0, dialogstring[576], namestring[96];
- foreach(new i: Player)
- {
- if(pBlind[playerid] == 1)
- {
- format(namestring, sizeof(namestring), "Blinded : {FF0000}%s [ID: %d] {CCFFAA}|{FF0000}\n", Name(i), i);
- strcat(dialogstring, namestring);
- count ++;
- }
- if(count != 0)
- {
- ShowPlayerDialog(playerid, D_BLINDED, DIALOG_STYLE_MSGBOX, "----==== Blinded Players ====----", dialogstring, "Close", "");
- }
- else ShowPlayerDialog(playerid, D_BLINDED, DIALOG_STYLE_MSGBOX, "----==== Blinded Players ====----", "No blinded players.", "Close", "");
- }
- return 1;
- }
- CMD:blind(playerid,params[])
- {
- new str[128], targetid;
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,C_RED,"You are not authorised to use this command.");
- if(sscanf(params,"u", targetid)) return SendClientMessage(playerid, C_RED, "[USAGE] /blind <Playerid>");
- {
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, C_RED, "[SERVER] Player not connected");
- if(IsPlayerAdmin(targetid) && playerid != targetid) return SendClientMessage(playerid,C_RED,"[ERROR] You cannot use this command on higher level admins");
- format(str, sizeof(str), "%s has blinded by %s", Name(targetid), Name(playerid));
- SendAdminMessage(C_CYAN, str);
- TextDrawShowForPlayer(targetid, Blind);
- pBlind[playerid] = 1;
- }
- return 1;
- }
- CMD:unblind(playerid,params[])
- {
- new str[128], targetid;
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,C_RED,"You are not authorised to use this command.");
- if(sscanf(params,"u", targetid)) return SendClientMessage(playerid, C_RED, "[USAGE] /unblind <Playerid>");
- {
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, C_RED, "[SERVER] Player not connected");
- if(IsPlayerAdmin(targetid) && playerid != targetid) return SendClientMessage(playerid,C_RED,"[ERROR] You cannot use this command on higher level admins");
- format(str, sizeof(str), "%s has unblinded by %s", Name(targetid), Name(playerid));
- SendAdminMessage(C_CYAN, str);
- TextDrawHideForPlayer(targetid, Blind);
- pBlind[playerid] = 0;
- }
- return 1;
- }
- stock Name(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- return name;
- }
- stock SendAdminMessage(color,string[])
- {
- foreach(Player,i)
- {
- if(IsPlayerAdmin(i))
- {
- SendClientMessage(i, color, string);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment