Pomoc

Započeo Luxx, Jul 31, 2022, 22:17:11 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning): Ne sacuvava kad postavim admina, da li neko zna u cemu je problem? Npr postavim admina i lik ode relog skine mu se admin
Deo skripte: [pawn]CMD:postaviadmina(playerid, params[]) {
   if(PlayerInfo[playerid][xAIG] >= 7 && IsPlayerAdmin(playerid)) {

      if(!AIGDuty[playerid]) return SendClientMessageEx(playerid,-1,"{FF0000}xWarningMSG » {FFFFFF}Da bi koristili ovu komandu morate biti na duznosti.");

      new id,lvl,slot;
      if(sscanf(params,"uii",id,lvl,slot)) {
         SendClientMessageEx(playerid,0xFFAF00FF,"(KORISCENJE) {FFFFFF}/postaviadmina (playerid)[level][slot]");
         return (1);
      }
      if(id == IPI) return SendClientMessageEx(playerid,-1,"{FF0000}xWarningMSG » {FFFFFF}Taj igrac nije na serveru.");
      if(slot < 0 || slot > 30) return SendClientMessageEx(playerid,-1,"{FF0000}xWarningMSG » {FFFFFF}Slot ne moze biti manji od 1 ili veci od 30.");
      if(slot < 1 && lvl > 0) return SendClientMessageEx(playerid,-1,"{FF0000}xWarningMSG » {FFFFFF}Slot ne moze biti manji od 1 ili veci od 30.");
      if(lvl < 0 || lvl > 7) return SendClientMessageEx(playerid,-1,"{FF0000}xWarningMSG » {FFFFFF}Ne moze vise od 7 ili manje od 0.");
      if(lvl == 0) {
         if(PlayerInfo[id][xAIG] > 0) {
            new File:log,ldst[128],text[80];
            format(ldst,128,"AIGs/%d.txt",PlayerInfo[id][xASlot]);
            format(text,64,"Niko");
            log = fopen(ldst,io_write);
            fwrite(log,text);
            fclose(log);
         }
         new string[128];
         PlayerInfo[id][xAIG] = lvl;
         ac_SetPlayerSkin(id,26);
         PlayerInfo[id][xSkin] = 26;
         PlayerInfo[id][xASlot] = 0;
         SendClientMessageEx(id,-1,"{0080C0}xInfoMSG  » {FFFFFF} Skinuta vam je pozicija ADMINISTRATOR-a od strane %s.",ImeIgraca(playerid));
         format(string,sizeof(string),"{0080C0}[ADMINISTRATOR PROMOTE] -{FFFFFF} %s je skinuo ADMINISTRATOR-a igracu {0080C0}%s{FFFFFF}.",ImeIgraca(playerid),ImeIgraca(id));
         AIGPORUKA(0xFF00C3FF,string);
         PlayerInfo[id][xSkriptaRank] = 0;
         SavePlayer(id);
         SetPlayerSpecialAction(id,SPECIAL_ACTION_NONE);
         for(new i = 0; i < MAX_LINES; i ++) {
            PlayerTextDrawHide(playerid,AltChatTD_Player);
         }
      }
      else if(lvl == 1 || lvl == 2 || lvl == 3 || lvl == 4 || lvl == 5 || lvl == 6 || lvl == 7) {

         if(lvl == 5 || lvl == 6 || lvl == 7) {
            if(PlayerInfo[playerid][xAIG] < 7) return SendClientMessageEx(playerid,-1,"{FF0000}xWarningMSG » {FFFFFF}Nisi ovlasten.");
            if(!IsPlayerAdmin(playerid)) return SendClientMessageEx(playerid,-1,"{FF0000}xWarningMSG » {FFFFFF}Moras biti rcon Admin.");
         }

         new File:log,ldst[128],text[80],string[128];
         format(ldst,128,"AIGs/%d.txt",slot);
         format(text,64,"%s",ImeIgraca(id));
         log = fopen(ldst,io_write);
         fwrite(log,text);
         fclose(log);

         ac_SetPlayerSkin(id,294);
         PlayerInfo[id][xSkin] = 294;
         PlayerInfo[id][xAIG] = lvl;
         PlayerInfo[id][xASlot] = slot;
         new randkod = 100 + random(899);
         PlayerInfo[id][xAKod] = randkod;

         SendClientMessageEx(playerid,-1,"{0080C0}xInfoMSG  » {FFFFFF} Promovisali ste igraca %s na Administrator Level %d,slot: %d.",ImeIgraca(id),lvl,slot);
         format(string,sizeof(string),"{0080C0}[ADMINISTRATOR PROMOTE] -{FFFFFF} %s je postavio igracu {0080C0}%s Administrator Level %d,slot: %d.",ImeIgraca(playerid),ImeIgraca(id),lvl,slot);
         AIGPORUKA(0xFF00C3FF,string);

         new ssstring[128];
         format(ssstring,sizeof(ssstring),"Vlasnik %s | Igrac: %s | Level Administratora %d | Slot Administratora %d",ImeIgraca(playerid),ImeIgraca(id),lvl,slot);
         LogSave("Ostalo/Logmakeadmin.log",ssstring);

         new stris[500];
         format(stris,sizeof(stris),"{FFFFFF}Cestitamo vam,postali ste Administrator na Balkan Life Community serveru!\nAdministrator Level %d vam je dao owner %s.\n\nVAZNO:\nOvaj kod sto ce vam dole biti napisan,morate napisati na neki papiric,\njer ce se on traziti svaki put kada se logujete!\nTakodje taj kod ce vam biti poslan na e-mail.\nKOD: %d\nSLOT: %d",lvl,ImeIgraca(playerid),randkod,slot);
         ShowPlayerDialog(id,dialog_OSTALO,DSMSG,D_NASLOV,stris,D_OK,"");
         AigSave(id);
         SavePlayer(id);
      }
   }
   return (1);
}[/pawn]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): [pawn]/[/pawn]
Slika/video ingame problema(obavezno ako je ingame problem): /

jesi li stavio u on player dissconet / on gamemode exit? da mu se sacuva admin