TahirUcar

SA-MP AFK Sistemi

Feb 9th, 2017
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.53 KB | None | 0 0
  1. #include <a_samp>
  2. #include <sscanf2>
  3. #include <zcmd>
  4.  
  5. #if defined FILTERSCRIPT
  6.  
  7. public OnFilterScriptInit()
  8. {
  9.     print("SA-MP AFK Sistemi");
  10.     return 1;
  11. }
  12.  
  13. public OnFilterScriptExit()
  14. {
  15.     return 1;
  16. }
  17.  
  18. #else
  19. #endif
  20.  
  21. new bool:afk[MAX_PLAYERS];
  22.  
  23. public OnPlayerConnect(playerid)
  24. {
  25.     afk[playerid] = false;
  26.     return 1;
  27. }
  28.  
  29. CMD:afk(playerid, params[])
  30. {
  31.     if(afk[playerid] == false)
  32.     {
  33.         new Float:health;
  34.         GetPlayerHealth(playerid, health);
  35.         if(health < 100) return SendClientMessage(playerid, -1, "{00FFDD}Hata: {999999}Afk moda geçebilmek için canınızın {00FFDD}100 {999999}olması lazım.");
  36.         afk[playerid] = true;
  37.         SetPlayerVirtualWorld(playerid, playerid);
  38.         SetPlayerHealth(playerid, cellmax);
  39.         SetPlayerInterior(playerid,1);
  40.         SetPlayerPos(playerid,1403.6039,-20.7303,1000.9115);
  41.         ResetPlayerWeapons(playerid);
  42.         TogglePlayerControllable(playerid, 0);
  43.     }
  44.     else
  45.     {
  46.         SendClientMessage(playerid, -1, "{00FFDD}Hata: {999999}Zaten afk moddasın. Geri dönmek için {00FFDD}/back {999999}komutunu kullan!");
  47.     }
  48.     return 1;
  49. }
  50.  
  51. CMD:back(playerid, params[])
  52. {
  53.     if(afk[playerid] == true)
  54.     {
  55.         afk[playerid] = false;
  56.         SetPlayerVirtualWorld(playerid, 1);
  57.         SetPlayerInterior(playerid, 0);
  58.         TogglePlayerControllable(playerid, 1);
  59.         SetPlayerHealth(playerid, 100);
  60.         SetPlayerArmour(playerid, 100);
  61.         SetPlayerPos(playerid, -320.2194,1802.8173,42.7235);
  62.     }
  63.     else
  64.     {
  65.         SendClientMessage(playerid, -1, "{00FFDD}Hata: {999999}Komutu kullanabilmek için afk modda olmalısın.");
  66.     }
  67.     return 1;
  68. }
Advertisement
Add Comment
Please, Sign In to add comment