Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* --------- AFk System By _DownLoaD_ For www.Sa-mp.com -------- */
- #include <a_samp>
- #pragma tabsize 0
- new AFKS[MAX_PLAYERS];
- #define COLOR_BLUE 0x0000ffff
- #define COLOR_RED 0xFF0000FF
- #define COLOR_YELLOW 0xffff33ff
- #define COLOR_WHITE 0xffffffff
- #define COLOR_GREEN 0x33ff33ff
- #define COLOR_LIME 0xccff00ff
- #define COLOR_AQUA 0x00ccccff
- #define COLOR_BLACK 0x000000ff
- #define COLOR_ROSE 0xffccccff
- #define COLOR_GREY 0xccccccff
- #define COLOR_PINK 0xff33ffff
- #define COLOR_BROWN 0x993300ff
- #define COLOR_DARKRED 0x990000AA
- #define COLOR_ORANGE 0xFF9900AA
- #define COLOR_IBlue 0x00FFFFAA
- #define COLOR_BRIGHTRED 0xFF0000AA
- #define COLOR_TAN 0xBDB76BAA
- #define COLOR_PURPLE 0x800080AA
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define COLOR_INDIGO 0x4B00B0AA
- #define COLOR_DARKGREY 0x696969FF
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" AFk System By _DownLoaD_ Loaded!");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" AFk Syste By _DownLoaD_ UnLoaded!");
- print("----------------------------------\n");
- }
- #endif
- public OnGameModeInit()
- {
- SetGameModeText("Blank Script");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new string[256];
- /* ========================= [AFk System] ====================================*/
- if (strcmp("/AFK", cmdtext, true) == 0)
- {
- printf("[INFO]: %s Typed /AFk",GetName(playerid));
- if(AFKS[playerid] == 0)
- {
- AFKS[playerid] = 1;
- SetPlayerPos(playerid, 1117.6093,-2036.9828,78.7500);
- SetPlayerFacingAngle(playerid, 270.1927);
- SetPlayerVirtualWorld(playerid,259+1);
- TogglePlayerControllable(playerid, 0);
- SetCameraBehindPlayer(playerid);
- SendClientMessage(playerid, COLOR_GREEN, "You Are AFK!");
- }
- else if (AFKS[playerid] == 1)
- {
- AFKS[playerid] = 0;
- SpawnPlayer(playerid);
- SetCameraBehindPlayer(playerid);
- SetPlayerVirtualWorld(playerid,0);
- TogglePlayerControllable(playerid, 1);
- SendClientMessage(playerid, COLOR_ORANGE, "You Are No UnAFK!");
- }
- return 1;
- }
- // -----------------------------------------------------------------------------
- if(strcmp(cmdtext, "/AFKList", true) == 0)
- {
- printf("[INFO]: %s Typed /AFKList",GetName(playerid));
- if(IsPlayerConnected(playerid))
- {
- new count = 0;
- for(new i=0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(AFKS[i] == 1)
- {
- SendClientMessage(playerid, COLOR_WHITE, "--- AFK LIST ---");
- new giveplayer[MAX_PLAYER_NAME];
- GetPlayerName(i, giveplayer, sizeof(giveplayer));
- format(string, sizeof(string), "{1E90FF}%d).%s", i,giveplayer);
- SendClientMessage(playerid,COLOR_WHITE,string);
- count++;
- }}}
- if(count == 0)
- {
- SendClientMessage(playerid,COLOR_RED,"NO AFKS");
- }}
- return 1;
- }
- return 0;
- }
- // ----------------------------[Stocks]-----------------------------------------
- stock GetName(playerid)
- {
- new Name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
- return Name;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement