Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- new afk[MAX_PLAYERS];
- new Text3D:label[MAX_PLAYERS];
- // Frames
- new fpsON[MAX_PLAYERS];
- new TimerFPS;
- new pDrunkLevelLast[MAX_PLAYERS];
- new pFPS[MAX_PLAYERS];
- new Text:FPS[MAX_PLAYERS];
- forward AggiornaFPS(playerid);
- // Colori | Colors
- #define MioBlu 0x007DFFFF
- #define MyBlue 0x007DFFFF
- #define Rosso 0xFF0A00FF
- #define Red 0xFF0A00FF
- #define Verde 0x00FF00FF
- #define Green 0x00FF00FF
- public OnFilterScriptInit()
- {
- print("\n------------------------------------------------");
- print(" Semplice Sistema Afk creato da Alex Palermitano");
- print(" Afk Simple System created by Alex Palermitano");
- print("-------------------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------");
- print("");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- afk[playerid] = 0;
- FPS[playerid] = TextDrawCreate(596.000000, 0.000000, "_");
- TextDrawBackgroundColor(FPS[playerid], 255);
- TextDrawFont(FPS[playerid], 3);
- TextDrawLetterSize(FPS[playerid], 0.669999, 1.900000);
- TextDrawColor(FPS[playerid], -65281);
- TextDrawSetOutline(FPS[playerid], 0);
- TextDrawSetProportional(FPS[playerid], 1);
- TextDrawSetShadow(FPS[playerid], 1);
- fpsON[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- afk[playerid] = 0;
- fpsON[playerid] = 0;
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- afk[playerid] = 0;
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/mycommand", cmdtext, true, 10) == 0)
- {
- // Do something here
- return 1;
- }
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- new drunknew;
- drunknew = GetPlayerDrunkLevel(playerid);
- if (drunknew < 100) {
- SetPlayerDrunkLevel(playerid, 2000);
- } else {
- if (pDrunkLevelLast[playerid] != drunknew) {
- new wfps = pDrunkLevelLast[playerid] - drunknew;
- if ((wfps > 0) && (wfps < 200))
- pFPS[playerid] = wfps;
- pDrunkLevelLast[playerid] = drunknew;
- }
- }
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- CMD:afk(playerid, params[])
- {
- if(afk[playerid] == 0)
- {
- afk[playerid] = 1;
- label[playerid] = Create3DTextLabel("AFK",Verde,30.0,40.0,50.0,40.0,0);
- SetPlayerVirtualWorld(playerid, 2);
- TogglePlayerControllable(playerid,0);
- Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
- SendClientMessage(playerid, Verde, "Info: {FFFFFF} Sei appena andato Afk, se non ritorni entro 15 minuti verrai kickato da questo server!!");
- SendClientMessage(playerid, Green, "Info: {FFFFFF} You just went AFK, if you do not return within 15 minutes you will be kicked from this server!!");
- SetTimer("AfkKick", 5000, playerid);
- }
- else
- {
- SendClientMessage(playerid, Verde, "Info: {FFFFFF} Sei già in modalità /afk!!");
- SendClientMessage(playerid, Green, "Info: {FFFFFF} You are already in /afk mode!!");
- }
- }
- CMD:noafk(playerid, params[])
- {
- if(afk[playerid] == 1) {
- afk[playerid] = 0;
- SetPlayerVirtualWorld(playerid, 0);
- Delete3DTextLabel(Text3D:label[playerid]);
- TogglePlayerControllable(playerid,1);
- SendClientMessage(playerid, Verde, "Info: {FFFFFF} Non sei più in modalità /Afk!");
- SendClientMessage(playerid, Green, "Info: {FFFFFF} You are no longer AFK mode!");
- }
- else {
- SendClientMessage(playerid, Rosso, "Attenzione: {FFFFFF} Non sei in modalità /Afk!");
- SendClientMessage(playerid, Red, "Warning: {FFFFFF} You are not in /Afk mode!");
- }
- }
- CMD:fps(playerid, params[])
- {
- if(fpsON[playerid] == 0)
- {
- PlayerPlaySound(playerid,1054,0.0,0.0,0.0),
- TimerFPS = SetTimerEx("AggiornaFPS", 500, true, "i",playerid);
- fpsON[playerid] = 1;
- }
- else if(fpsON[playerid] == 1)
- {
- PlayerPlaySound(playerid,1054,0.0,0.0,0.0),
- KillTimer(TimerFPS);
- fpsON[playerid] = 0;
- TextDrawHideForPlayer(playerid, FPS[playerid]);
- }
- }
- forward AfkKick(playerid);
- public AfkKick(playerid)
- {
- if(afk[playerid] == 1)
- {
- SendClientMessage(playerid, MioBlu, "Kick: Sei stato kickato dal server. Motivo: Sei stato troppo in Afk");
- SendClientMessage(playerid, MyBlue, "Kick: You have been kicked from the server. Reason: You've been too Afk");
- Kick(playerid);
- }
- }
- public AggiornaFPS(playerid)
- {
- new string[128];
- format(string, sizeof(string), "%i",pFPS[playerid]);
- TextDrawSetString(FPS[playerid], string);
- TextDrawShowForPlayer(playerid, FPS[playerid]);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment