Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- **** AFK System - Sanel **** on fb sanel samper :D
- PROCITAJ DOLE POD CMD /NATRAD
- */
- #define FILTERSCRIPT
- #include <a_samp>
- new AFK[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print(" /////////////////////////////");
- print(" AFK System by Sanel loaded");
- print(" /////////////////////////////");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- AFK[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid)
- {
- AFK[playerid] = 0;
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new pname[24], str[128];
- GetPlayerName(playerid, pname, 24);
- if(!strcmp(cmdtext, "/afkzona", true))
- {
- if(AFK[playerid] == 1)
- {
- SendClientMessage(playerid, -1, "{FF0000}SERVER:{FFFFFF} Vec si AFK! Upišite /natrag da biste se vratili iz AFK");
- return 1;
- }
- SendClientMessage(playerid, -1, "Vi ste sada AFK! Upišite /natrag da biste se vratili iz AFK");
- format(str, sizeof(str), "%s [%d] Je sad afk!", pname, playerid);
- SendClientMessageToAll(-1, str);
- TogglePlayerControllable(playerid, 0);
- SetPlayerPos(playerid, 2148.4990,1125.0457,23.3283);
- AFK[playerid] = 1;
- return 1;
- }
- if(!strcmp(cmdtext, "/natrag", true))
- {
- if(AFK[playerid] == 0)
- {
- SendClientMessage(playerid, -1, "{FF0000}SERVER:{FFFFFF} Niste AFK! Upišite /AFK da udjes u zonu");
- return 1;
- }
- SendClientMessage(playerid, -1, "Dobrodosao nazad:)");
- TogglePlayerControllable(playerid, 1);
- format(str, sizeof(str), "%s [%d] sada se vraca iz AFK!", pname, playerid);
- SendClientMessageToAll(-1, str);
- SpawnPlayer(playerid);// SVOJ KORDINAT OVE STAVITI SetPlayerPos(playerid, KORDINAT); DA BI SE IGRAC VRATIO NA SPAWNU
- AFK[playerid] = 0;
- return 1;
- }
- return 0;
- }
- public OnPlayerText(playerid, text[])
- {
- if(AFK[playerid] == 1)
- {
- SendClientMessage(playerid, -1, "{FF0000}SERVER:{FFFFFF} Ti si AFK. upišite /natrag izadjes.");
- return 0;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment