Advertisement
Guest User

CaLderoN Anti God

a guest
Nov 21st, 2013
700
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.25 KB | None | 0 0
  1. #include <a_samp>
  2. #pragma tabsize 0
  3. new idx;
  4. public OnPlayerCommandText(playerid, cmdtext[])
  5. {
  6. new tmp[254];
  7. new cmd[256];
  8.     if(strcmp(cmd, "/godtest", true) == 0)
  9.     {
  10.                 tmp = strtok(cmdtext, idx);
  11.                 new oyuncuID;
  12.                 oyuncuID = strval(tmp);
  13.                 if(!strlen(tmp))
  14.                 {
  15.                     SendClientMessage(playerid,-1, "/godtest [playerid]");
  16.                     return 1;
  17.                 }
  18.         if (IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"You'r not rcon admin..");
  19.         else if(IsPlayerConnected(oyuncuID)) return SendClientMessage(playerid,-1,"Playerid is not connected.");
  20.         godProtect(oyuncuID);
  21.         return 1;
  22.     }
  23.     return 0;
  24. }
  25. stock godProtect(playerid)
  26. {
  27. new Float:oyuncuCan;
  28. GetPlayerHealth(playerid,oyuncuCan);
  29. SetPlayerHealth(playerid,50);
  30. if(oyuncuCan != 50.0)
  31. {
  32. SendClientMessage(playerid,-1,"You is god! KİCK!");
  33. Kick(playerid);
  34. return 0;
  35. }
  36. return 1;
  37. }
  38.  
  39. strtok(const string[], &index)
  40. {
  41.     new length = strlen(string);
  42.     while ((index < length) && (string[index] <= ' '))
  43.     {
  44.         index++;
  45.     }
  46.  
  47.     new offset = index;
  48.     new result[20];
  49.     while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  50.     {
  51.         result[index - offset] = string[index];
  52.         index++;
  53.     }
  54.     result[index - offset] = EOS;
  55.     return result;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement