Guest User

God engedélyezés letiltás | update

a guest
Sep 23rd, 2012
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.67 KB | None | 0 0
  1. #include <a_samp>
  2. #include <dini>
  3. #include <sscanf2>
  4. #include <zcmd>
  5.  
  6. new File[40];
  7.  
  8. public OnPlayerConnect(playerid) {
  9.     format(File, sizeof(File), "god/%s.ini", pName(playerid));
  10.     if(dini_Exists(File)) {
  11.         SetPVarInt(playerid, "God", dini_Int(File, "god"));
  12.     }else{
  13.         SetPVarInt(playerid, "God", 0);
  14.         dini_Create(File);
  15.         dini_IntSet(File, "god", 0);
  16.     }
  17.     return 1;
  18. }
  19.  
  20. public OnPlayerDisconnect(playerid, reason) {
  21.     format(File, sizeof(File), "god/%s.ini", pName(playerid));
  22.     dini_IntSet(File, "god", GetPVarInt(playerid, "God"));
  23.     return 1;
  24. }
  25.  
  26. public OnPlayerSpawn(playerid) {
  27.     if(GetPVarInt(playerid, "God")) {
  28.         SetPlayerHealth(playerid, 99999);
  29.         SendClientMessage(playerid, -1, "Mivel aktiválva van neked a God mód, ezért minden spawnoláskor megkapod automatikusan!");
  30.     }
  31.     return 1;
  32. }
  33.  
  34. CMD:god(playerid,params[]) {
  35.     if(GetPVarInt(playerid, "God")) SetPlayerHealth(playerid, 99999);
  36.     else return SendClientMessage(playerid, -1, "Itt nincs engedélyezve jelengleg a god");
  37.     return 1;
  38. }
  39.  
  40. CMD:setgod(playerid, params[]) {
  41.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Nem vagy rcon admin");
  42.     new giveplayerid, bool:value;
  43.     if(sscanf(params, "ub", giveplayerid, value)) return SendClientMessage(playerid, 0xFF0000AA, "Használat: /setgod <Játékos ID/Név> <1/0>");
  44.     if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "HIBA: Érvénytelen ID/Név.");
  45.     SetPVarInt(giveplayerid, "God", value);
  46.     return 1;
  47. }
  48.  
  49. CMD:godoff(playerid) return SetPlayerHealth(playerid, 100);
  50.  
  51. stock pName(playerid) {
  52.     static getName[MAX_PLAYER_NAME];
  53.     GetPlayerName(playerid, getName, MAX_PLAYER_NAME);
  54.     return getName;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment