Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <ZCMD>
- #include <sscanf>
- #define MAX_WARNS 4
- new Noguns[MAX_PLAYERS];
- new Warning[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print("\n-------D A R [ K ] L O R D ------------");
- print("Noguns Script Loaded!");
- print("Author : -=Dar[K]Lord=-");
- print("-----------------------------------------");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- CMD:noguns(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- if(Noguns[i] == 0)
- {
- new string[120];
- format(string,sizeof(string),"[AMX_RCON]:{FF0000}Guns Disabled");
- SendClientMessage(i,0xFFFFFFFF,string);
- Noguns[i] = 1;
- }
- else if(Noguns[i] == 1)
- {
- new string[120];
- format(string,sizeof(string),"[AMX_RCON]:{FF0000}Guns Enabled");
- SendClientMessage(i,0xFFFFFFFF,string);
- Noguns[i] = 0;
- }
- }
- else
- {
- if(Warning[playerid] < MAX_WARNS)
- {
- Warning[playerid]++;
- new string[200];
- format(string,sizeof(string),"[AMX_RCON]:{FF0000}You Have No Authorization to this command! | Warning: %d/%d",Warning[playerid],MAX_WARNS);
- SendClientMessage(playerid,0xFFFFFFFF,string);
- PlayerPlaySound(playerid,1057,0,0,0);
- }
- if(Warning[playerid] == MAX_WARNS)
- {
- Warning[playerid] = 0;
- new string[200];
- format(string,sizeof(string),"[AMX_RCON]:{FF0000}You Have No Authorization to this command! | Warning: %d/%d | KICKED!",Warning[playerid],MAX_WARNS);
- SendClientMessageToAll(0xFFFFFFFF,string);
- format(string,sizeof(string),"[AMX_RCON]:{FF0000}Player %s(ID:%s) Has Been Kicked For Trying Rcon commands!",Playername(playerid),playerid);
- SendClientMessageToAll(0xFFFFFFFF,string);
- PlayerPlaySound(playerid,1190,0,0,0);
- Kick(playerid);
- }
- }
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- if(Noguns[i] == 1)
- {
- if(!IsPlayerAdmin(playerid))
- {
- if(GetPlayerWeapon(playerid) > 0 || GetPlayerWeapon(playerid) <= 47)
- {
- ResetPlayerWeapons(playerid);
- }
- }
- else
- {
- return 1;
- }
- }
- return 1;
- }
- stock Playername(playerid)
- {
- new PName[24];
- GetPlayerName(playerid,PName,24);
- return PName;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement