Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Score Saving by Joker
- #define FILTERSCRIPT
- #include <a_samp>
- #include <dini>
- #if defined FILTERSCRIPT
- #define SERVER_USER_FILE "Users/%s.ini"
- #include "../include/gl_common.inc"
- enum pInfo
- {
- pScore
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- new seconds[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Score Saving by Joker loaded");
- print("--------------------------------------\n");
- SetTimer("scoretimer", 1000, true);
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------");
- print(" Score Saving by Joker unloaded");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new name[MAX_PLAYER_NAME], file[256];
- GetPlayerName(playerid, name, sizeof(name));
- format(file, sizeof(file), SERVER_USER_FILE, name);
- SetPlayerScore(playerid,PlayerInfo[playerid][pScore]);
- if (!dini_Exists(file))
- {
- dini_Create(file);
- dini_IntSet(file, "Score",SetPlayerScore(playerid,0));
- }
- if(fexist(file))
- {
- SetPlayerScore(playerid,dini_Int(file, "Score"));
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new name[MAX_PLAYER_NAME], file[256];
- GetPlayerName(playerid, name, sizeof(name));
- format(file, sizeof(file), SERVER_USER_FILE, name);
- dini_IntSet(file, "Score", GetPlayerScore(playerid));
- return 1;
- }
- forward scoretimer();
- public scoretimer()
- {
- for(new i; i<MAX_PLAYERS; i++)
- {
- if(!IsPlayerConnected(i)) continue;
- seconds[i] ++;
- if(seconds[i] == 60)
- {
- SetPlayerScore(i, GetPlayerScore(i) + 1);
- seconds[i] = 0;
- }
- }
- return 1;
- }
- #endif
- ------------------------------------------------------------------------------------------------------------
- // Simple afk system by Joker
- #define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- #if defined FILTERSCRIPT
- #define DRED 0xFF00000
- #define WHITE 0xFFFFFFFF
- new AFK[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" AFK system by Joker loaded");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------");
- print(" AFK system by Joker unloaded");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- AFK[playerid] = 0;
- return 1;
- }
- CMD:afk(playerid)
- {
- if (AFK[playerid] == 1)
- {
- SendClientMessage(playerid,DRED,"You are already AFK!");
- }
- else
- {
- new string[128];
- format(string,sizeof(string)," %s is now Away From Keyboard (AFK)",GetPlayerNameEx(playerid));
- SendClientMessageToAll(WHITE,string);
- TogglePlayerControllable(playerid,0);
- SendClientMessage(playerid,WHITE,"You are now AFK!");
- AFK[playerid] = 1;
- }
- return 1;
- }
- CMD:back(playerid)
- {
- if (AFK[playerid] == 0)
- {
- SendClientMessage(playerid,DRED,"You are already back!");
- }
- else
- {
- new string[128];
- format(string,sizeof(string)," %s is now back!",GetPlayerNameEx(playerid));
- SendClientMessageToAll(WHITE,string);
- TogglePlayerControllable(playerid,1);
- SendClientMessage(playerid,WHITE,"Welcome back!");
- AFK[playerid] = 0;
- }
- return 1;
- }
- stock GetPlayerNameEx(playerid)
- {
- new Name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
- return Name;
- }
- #endif
- ------------------------------------------------------------------------------------------------------
- // This is Anti flood+Ip limit edit by Audi_Quattrix&Joker
- // Original Creator Roperr All credits goes to him
- #define FILTERSCRIPT
- #include <a_samp>
- #define GREEN 0x33AA33AA
- #define IP_LIMIT 3 // = Max connections from one single IP
- #define SAME_IP_CONNECT 3 // = The number of connects from the same IP before banning the flooder
- new Same_IP=0,Join_Stamp,ban_s[25],exceed=0;
- #define Time_Limit 3500 // = The time span between connects, adjust it to your own specifications
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Anti flood+ ip limit loaded");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new ConnIP[16];
- GetPlayerIp(playerid,ConnIP,16);
- new compare_IP[16];
- new number_IP = 0;
- for(new i=0; i<MAX_PLAYERS; i++) {
- if(IsPlayerConnected(i)) {
- GetPlayerIp(i,compare_IP,16);
- if(!strcmp(compare_IP,ConnIP)) number_IP++;
- }
- }
- if((GetTickCount() - Join_Stamp) < Time_Limit)
- exceed=1;
- else
- exceed=0;
- if(strcmp(ban_s, ConnIP, false) == 0 && exceed == 1 )
- {
- Same_IP++;
- if(Same_IP > SAME_IP_CONNECT)
- {
- new string[128];
- format(string,sizeof(string),"Player %s Has been Banned [Reason: IP limit exceed/Bot attack]",GetPlayerNameEx(playerid));
- SendClientMessageToAll(GREEN,string);
- Ban(playerid);
- Same_IP=0;
- }
- }
- else
- {
- Same_IP=0;
- }
- if(number_IP > IP_LIMIT)
- Kick(playerid);
- GetStampIP(playerid);
- return 1;
- }
- stock GetPlayerIPEx(playerid)
- {
- new IP[15];
- GetPlayerIp(playerid, IP, 15);
- return IP;
- }
- stock GetStampIP(playerid){
- new S_IP[16];
- Join_Stamp=GetTickCount();
- GetPlayerIp(playerid,S_IP,16);
- format(ban_s, 16, "%s", S_IP);
- }
- stock GetPlayerNameEx(playerid)
- {
- new Name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
- return Name;
- }
- #endif
- ---------------------------------------------------------------------------------------------------------
- // Super brake script by Audi_Quattrix
- #define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- #if defined FILTERSCRIPT
- #define PRESSED(%0) \
- (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
- new Handbrake[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Super brake script by Audi_Quattrix loaded");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------");
- print(" Super brake script by Audi_Quattrix unloaded");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- Handbrake[playerid] = 0;
- return 1;
- }
- CMD:handbrake(playerid)
- {
- if(Handbrake[playerid]== 0)
- {
- Handbrake[playerid]= 1;
- SendClientMessage(playerid,0x00FFFFAA,"Handbrake ON!");
- }
- else if(Handbrake[playerid] == 1)
- {
- Handbrake[playerid] = 0;
- SendClientMessage(playerid,0x00FFFFAA,"Handbrake OFF!");
- }
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if (GetPlayerVehicleSeat(playerid) == 0 ||PRESSED(KEY_HANDBRAKE))
- {
- if (Handbrake[playerid] == 0)
- {
- }
- else if (Handbrake[playerid] == 1)
- {
- SetVehicleVelocity(GetPlayerVehicleID(playerid),0,0,0);
- }
- }
- return 1;
- }
- #endif
- ---------------------------------------------------------------------------------------------------------
- // This Filterscript is made by Joker
- #define FILTERSCRIPT
- #include <a_samp>
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print("Jokers Join and Leave Messages Loaded!");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------");
- print("Jokers Join and Leave Messages Unloaded!");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new pName[30], string[128];
- GetPlayerName(playerid, pName, 30);
- format(string, 256, "{FFFFFF}%s has {00FF22}joined {FFFFFF} the server! ", pName);
- SendClientMessageToAll(0x33AA33AA,string);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new string[128];
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,MAX_PLAYER_NAME);
- switch(reason)
- {
- case 0: format(string,sizeof string,"%s left the server. (Timed out)",name);
- case 1: format(string,sizeof string,"%s left the server. (Leaving)",name);
- case 2: format(string,sizeof string,"%s left the server. (Kicked/Banned)",name);
- }
- SendClientMessageToAll(0xFFFFFFAA,string);
- return 1;
- }
- #endif
- ---------------------------------------------------------------------------------------------------------
- // Randommessages by Audi_Quattrix...
- #define FILTERSCRIPT
- #include <a_samp>
- #define YELLOW 0xFFFF00AA
- #if defined FILTERSCRIPT
- forward RandomMessages();
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Randommessages by Audi_Quattrix loaded");
- print("--------------------------------------\n");
- SetTimer("RandomMessages", 60000, true);
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------");
- print(" Randommessages by Audi_Quattrix unloaded");
- print("--------------------------------------\n");
- return 1;
- }
- //=================================[Random messages]============================
- new randomMessages[][] =
- {
- "MESSAGE 1",
- "MESSAGE 2",
- "MESSAGE 3",
- "MESSAGE 4" //Feel free to add more :P
- };
- public RandomMessages()
- {
- new randomMsg = random(sizeof(randomMessages));
- SendClientMessageToAll(YELLOW, randomMessages[randomMsg]);
- }
- #endif
- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment