SHOW:
|
|
- or go back to the newest paste.
| 1 | /* | |
| 2 | ||
| 3 | Filterscript created by: Phantom | |
| 4 | Credits: | |
| 5 | lelemaster for helping me while doing the script. | |
| 6 | V1ceC1ty for helping me while doing the script aswell. | |
| 7 | Akira297 for insipiring me to script. | |
| 8 | Note: If you release / use it on any webpage or gamemode give me credits. | |
| 9 | Feel free to Edit/remove/add lines of code to the FS. | |
| 10 | SA:MP Forums | |
| 11 | ||
| 12 | ||
| 13 | */ | |
| 14 | #include <a_samp> | |
| 15 | new pAFK[MAX_PLAYERS] = 0; | |
| 16 | #if defined FILTERSCRIPT | |
| 17 | ||
| 18 | public OnFilterScriptInit() | |
| 19 | {
| |
| 20 | print("\n--------------------------------------");
| |
| 21 | print(" Away from keyboard FS Loaded");
| |
| 22 | print("--------------------------------------\n");
| |
| 23 | return 1; | |
| 24 | } | |
| 25 | ||
| 26 | public OnFilterScriptExit() | |
| 27 | {
| |
| 28 | return 1; | |
| 29 | } | |
| 30 | ||
| 31 | #else | |
| 32 | ||
| 33 | main() | |
| 34 | {
| |
| 35 | print("\n----------------------------------");
| |
| 36 | print(" Away from keyboard FS Unloaded");
| |
| 37 | print("----------------------------------\n");
| |
| 38 | } | |
| 39 | - | new Pafk[MAX_PLAYERS] = 0; |
| 39 | + | |
| 40 | {
| |
| 41 | if (strcmp("/afk", cmdtext, true, 10) == 0)
| |
| 42 | {
| |
| 43 | if(pAFK[playerid] == 1) | |
| 44 | {
| |
| 45 | - | if(Pafk[playerid] == 1) |
| 45 | + | |
| 46 | SetPlayerHealth(playerid, 100); | |
| 47 | pAFK[playerid] == 0; | |
| 48 | } | |
| 49 | else if(pAFK[playerid] == 0) | |
| 50 | - | else if(Pafk[playerid] == 0) |
| 50 | + | |
| 51 | SendClientMessage(playerid, 0xFFFFFFFF, "You are now AFK!"); | |
| 52 | SetPlayerVirtualWorld(playerid, 69696969); | |
| 53 | - | SetPlayerVirtualWorld(playerid, 69696969); |
| 53 | + | pAFK[playerid] == 1; |
| 54 | - | pAFK[playerid] == 1; |
| 54 | + | SetPlayerHealth(playerid, 9999999); |
| 55 | } | |
| 56 | return 1; | |
| 57 | } | |
| 58 | if (strcmp("/back", cmdtext, true, 10) == 0)
| |
| 59 | {
| |
| 60 | if(pAFK[playerid] == 0) | |
| 61 | {
| |
| 62 | SendClientMessage(playerid, 0xEFEFF7AA, "You are not even AFK!!"); | |
| 63 | } | |
| 64 | else if(pAFK[playerid] == 1) | |
| 65 | {
| |
| 66 | pAFK[playerid] == 0; | |
| 67 | SetPlayerVirtualWorld(playerid, 0); | |
| 68 | SetPlayerHealth(playerid, 100); | |
| 69 | SendClientMessage(playerid, 0xFFFFFFFF, "You are now back"); | |
| 70 | } | |
| 71 | return 1; | |
| 72 | } | |
| 73 | return 0; | |
| 74 | } | |
| 75 | ||
| 76 | public OnPlayerDisconnect(playerid) | |
| 77 | {
| |
| 78 | pAFK[playerid] = 0; | |
| 79 | return 1; | |
| 80 | } | |
| 81 | public OnPlayerConnect(playerid) | |
| 82 | {
| |
| 83 | pAFK[playerid] == 0; | |
| 84 | } | |
| 85 | #endif |