Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #include <a_samp>
- #define COLOR_GREEN 0x21DD00FF
- #define COLOR_RED 0xE60000FF
- #define COLOR_BLUE 0x1229FAFF
- #define COLOR_YELLOW 0xFFFF00FF
- new cpi[MAX_PLAYERS];
- new muted[MAX_PLAYERS];
- new website[] = "<change this to your website>";
- new warns[MAX_PLAYERS];
- forward Rules(playerid);
- public Rules(playerid)
- {
- SendClientMessage(playerid,COLOR_GREEN,"** Server Rules **");//Edit the rules to your wishes, add for each rule a new SendClientMessage
- SendClientMessage(playerid,COLOR_GREEN,"1. Don't hack");
- SendClientMessage(playerid,COLOR_GREEN,"2. Respect other players");
- SendClientMessage(playerid,COLOR_GREEN,"3. Don't abuse ANY bugs.");
- SendClientMessage(playerid,COLOR_GREEN,"4. Report cheaters/hackers.");
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- {
- if(muted[playerid])
- {
- SendClientMessage(playerid,0xFF8080FF,"You're muted and can't talk!");
- return 0;
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new string[128];
- new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME];
- GetPlayerName(cpi[playerid],pName,sizeof(pName));
- GetPlayerName(playerid,aName,sizeof(aName));
- if(dialogid == 0)
- {
- if(response == 1)
- {
- if(listitem == 0)
- {
- format(string,sizeof(string),"Enter your reason to kick %s",pName);
- ShowPlayerDialog(playerid,1,1,"Kick",string,"Kick","Cancel");
- }
- if(listitem == 1)
- {
- format(string,sizeof(string),"Enter your reason to ban %s",pName);
- ShowPlayerDialog(playerid,2,1,"Ban",string,"Ban","Cancel");
- }
- if(listitem == 2)
- {
- new Float:x,Float:y,Float:z;
- GetPlayerPos(cpi[playerid],x,y,z);
- SetPlayerPos(cpi[playerid],x,y,z+10);
- new listoptions[] = "1\tKick\n2\tBan\n3\tSlap\n4\tFreeze\n5\tUnfreeze\n6\tMute\n7\tUnmute\n8\tWarn\n9\tGoto\n10\tGethere";
- ShowPlayerDialog(playerid,0,2,"Admin options",listoptions,"Continue","Cancel");
- }
- if(listitem == 3)
- {
- TogglePlayerControllable(cpi[playerid],0);
- ShowPlayerDialog(playerid,7,0,"Succes","Action performed succesfully!","Ok","Back");
- format(string,sizeof(string),"Admin %s froze you!",aName);
- ShowPlayerDialog(cpi[playerid],8,0,"Frozen!",string,"Ok","Damnit");
- }
- if(listitem == 4)
- {
- TogglePlayerControllable(cpi[playerid],1);
- ShowPlayerDialog(playerid,7,0,"Succes","Action performed succesfully!","Ok","Back");
- format(string,sizeof(string),"Admin %s unfroze you!",aName);
- ShowPlayerDialog(cpi[playerid],8,0,"Frozen!",string,"YAAAY","Ok");
- }
- if(listitem == 5)
- {
- muted[cpi[playerid]] = 1;
- ShowPlayerDialog(playerid,7,0,"Succes","Action performed succesfully!","Ok","Back");
- format(string,sizeof(string),"Admin %s muted you!",aName);
- ShowPlayerDialog(cpi[playerid],8,0,"Muted!",string,"Ok","Damnit");
- }
- if(listitem == 6)
- {
- muted[cpi[playerid]] = 0;
- ShowPlayerDialog(playerid,7,0,"Succes","Action performed succesfully!","Ok","Back");
- format(string,sizeof(string),"Admin %s unmuted you!",aName);
- ShowPlayerDialog(cpi[playerid],8,0,"Muted!",string,"YAAAY","Ok");
- }
- if(listitem == 7)
- {
- format(string,sizeof(string),"Enter your reason to warn %s.",pName);
- ShowPlayerDialog(playerid,3,1,"Succes",string,"Ok","Back");
- }
- if(listitem == 8)
- {
- new Float:x,Float:y,Float:z;
- GetPlayerPos(cpi[playerid],x,y,z);
- SetPlayerPos(playerid,x,y-2,z);
- new interior = GetPlayerInterior(cpi[playerid]);
- new vw = GetPlayerVirtualWorld(cpi[playerid]);
- SetPlayerInterior(playerid,interior);
- SetPlayerVirtualWorld(playerid,vw);
- format(string,sizeof(string),"Succesfully teleported to %s!",pName);
- ShowPlayerDialog(playerid,7,0,"Succes",string,"Ok","Back");
- }
- if(listitem == 9)
- {
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid,x,y,z);
- SetPlayerPos(cpi[playerid],x,y-2,z);
- new interior = GetPlayerInterior(playerid);
- new vw = GetPlayerVirtualWorld(playerid);
- SetPlayerInterior(cpi[playerid],interior);
- SetPlayerVirtualWorld(cpi[playerid],vw);
- format(string,sizeof(string),"Succesfully teleported %s to you!",pName);
- ShowPlayerDialog(playerid,7,0,"Succes",string,"Ok","Back");
- }
- }
- }
- if(dialogid == 1)
- {
- if(response)
- {
- SendClientMessage(cpi[playerid],COLOR_RED,"|__________ Server Administration __________|");
- SendClientMessage(cpi[playerid],COLOR_BLUE,"| You have been kicked from this server |");
- format(string,sizeof(string),"| Your name: %s",pName);
- SendClientMessage(cpi[playerid],COLOR_BLUE,string);
- format(string,sizeof(string),"| Admin who kicked you: %s",aName);
- SendClientMessage(cpi[playerid],COLOR_BLUE,string);
- format(string,sizeof(string),"| Reason: %s",inputtext);
- SendClientMessage(cpi[playerid],COLOR_BLUE,string);
- SendClientMessage(cpi[playerid],COLOR_RED,"|___________________________________________|");
- Kick(cpi[playerid]);
- format(string,sizeof(string),"User %s kicked succesfully!",pName);
- ShowPlayerDialog(playerid,7,0,"Succes",string,"Ok","Back");
- format(string,sizeof(string),"** Player %s has been kicked by %s(Reason: %s)",pName,aName,inputtext);
- SendClientMessageToAll(COLOR_YELLOW,string);
- }
- }
- if(dialogid == 2)
- {
- if(response)
- {
- SendClientMessage(cpi[playerid],COLOR_RED,"___________ Server Administration ___________");
- SendClientMessage(cpi[playerid],COLOR_BLUE,"| You have been banned from this server |");
- format(string,sizeof(string),"| Your name: %s",pName);
- SendClientMessage(cpi[playerid],COLOR_BLUE,string);
- format(string,sizeof(string),"| Admin who banned you: %s",aName);
- SendClientMessage(cpi[playerid],COLOR_BLUE,string);
- format(string,sizeof(string),"| Reason: %s",inputtext);
- SendClientMessage(cpi[playerid],COLOR_BLUE,string);
- SendClientMessage(cpi[playerid],COLOR_BLUE,"| To appeal your ban, go to: |");
- format(string,sizeof(string),"%s",website);
- SendClientMessage(cpi[playerid],COLOR_BLUE,string);
- SendClientMessage(cpi[playerid],COLOR_RED,"|___________________________________________|");
- BanEx(cpi[playerid],inputtext);
- format(string,sizeof(string),"User %s banned succesfully!",pName);
- ShowPlayerDialog(playerid,7,0,"Succes",string,"Ok","Back");
- format(string,sizeof(string),"** Player %s has been banned by %s(Reason: %s)",pName,aName,inputtext);
- SendClientMessageToAll(COLOR_YELLOW,string);
- }
- }
- if(dialogid == 3)
- {
- if(response)
- {
- warns[cpi[playerid]] = warns[cpi[playerid]]+1;
- if(warns[cpi[playerid]] >= 3)
- {
- SendClientMessage(cpi[playerid],COLOR_RED,"___________ Server Administration ___________");
- SendClientMessage(cpi[playerid],COLOR_BLUE,"| You have been kicked from this server |");
- format(string,sizeof(string),"Your name: %s",pName);
- SendClientMessage(cpi[playerid],COLOR_BLUE,string);
- format(string,sizeof(string),"Admin who kicked you: %s",aName);
- SendClientMessage(cpi[playerid],COLOR_BLUE,string);
- format(string,sizeof(string),"Reason: %s (Reached 3 warnings)",inputtext);
- SendClientMessage(cpi[playerid],COLOR_BLUE,string);
- SendClientMessage(cpi[playerid],COLOR_RED,"|___________________________________________|");
- Kick(cpi[playerid]);
- format(string,sizeof(string),"User %s got auto-kicked for having 3 warnings!",pName);
- ShowPlayerDialog(playerid,7,0,"Succes",string,"Ok","Back");
- format(string,sizeof(string),"** Player %s has been auto-kicked for having 3 warnings (Reason: %s)",pName,inputtext);
- SendClientMessageToAll(COLOR_YELLOW,string);
- }
- else
- {
- format(string,sizeof(string),"User %s warned succesfully!",pName);
- ShowPlayerDialog(playerid,7,0,"Succes",string,"Ok","Back");
- format(string,sizeof(string),"You have been by admin %s warned for:\n %s",aName,inputtext);
- ShowPlayerDialog(cpi[playerid],9,0,"Warned.",string,"Ok","Read Rules");
- }
- }
- }
- if(dialogid == 7)
- {
- if(!response)
- {
- new listoptions[] = "1\tKick\n2\tBan\n3\tSlap\n4\tFreeze\n5\tUnfreeze\n6\tMute\n7\tUnmute\n8\tWarn\n9\tGoto\n10\tGethere";
- ShowPlayerDialog(playerid,0,2,"Admin options",listoptions,"Continue","Cancel");
- }
- }
- if(dialogid == 9)
- {
- if(!response) { Rules(playerid); }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- if(IsPlayerAdmin(playerid))
- {
- new listoptions[] = "1\tKick\n2\tBan\n3\tSlap\n4\tFreeze\n5\tUnfreeze\n6\tMute\n7\tUnmute\n8\tWarn\n9\tGoto\n10\tGethere";
- ShowPlayerDialog(playerid,0,2,"Admin options",listoptions,"Continue","Cancel");
- cpi[playerid] = clickedplayerid;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment