[Pomoc] Osle sve admin komande

Započeo System32, April 28, 2011, 13:27:07 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Skripta koju koristim:Freeroam by Fafu
Detaljan opis problema:stavljao sam na sve admin komande ono Niste autorizirani... i sve to radi kad nisam admin ali kad sam admin onda nista ne radi, sve sam probao vec gubim zivce...Probao sve s onim zagradama.... nista  :'( :'( :'(
Dio skripte: sve komande (nema puno) CMD:ahelp(playerid,params[])
{
if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]>= 1) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
{
ShowPlayerDialog(playerid,4,DIALOG_STYLE_MSGBOX,"Admin Komande!","/ban /kick /vehid /specon /specoff /explode\n/setloc /gotoloc /gotop /gethere /busi","Ok", "Ok");
    if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]>= 2) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
{
ShowPlayerDialog(playerid,5,DIALOG_STYLE_MSGBOX,"Admin Komande!","/ban /kick /vehid /specon /specoff /explode\n/setloc /gotoloc /gotop /gethere /uping /downing\n/busi /godmode /visible /remove /destroyveh /cc","Ok", "Ok");
{
if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]>= 3) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
ShowPlayerDialog(playerid,6,DIALOG_STYLE_MSGBOX,"Admin Komande!","/ban /kick /vehid /specon /specoff /explode\n/setloc /gotoloc /gotop /gethere /uping /downing\n/busi /godmode /visible /remove /destroyveh /cc\n/respawn /gmx /makeadmin /settime /setname","Ok", "Ok");
}
}
}
return 1;
}

CMD:cc(playerid, params[])
{
if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]>= 2) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
{
ClearChat(15);
}
    return 1;
}

CMD:ban(playerid, params[])
{
new user,
reason[128],
string[128],
ime1[24],
ime2[25];
if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]> 0) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
{
if(sscanf(params, "us", user, reason)) return SendClientMessage(playerid, COLOR_WHITE, "Koristenje: /ban [ID] [razlog]");
{
GetPlayerName(user, ime1, sizeof(ime1));
GetPlayerName(playerid, ime2, sizeof(ime2));
format(string, sizeof(string), "%s je protjeran sa servera od administatora %s!Razlog: %s", ime1, ime2, reason);
SendClientMessageToAll(COLOR_KRED, string);
BanPlayer(user, "");
}
}
return 1;
}

CMD:kick(playerid, params[])
{
new user,
reason[128],
string[128],
ime1[24],
ime2[25];
if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]> 0) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
{
if(sscanf(params, "us", user, reason)) return SendClientMessage(playerid, COLOR_WHITE, "Koristenje: /kick [ID] [razlog]");
{
GetPlayerName(user, ime1, sizeof(ime1));
GetPlayerName(playerid, ime2, sizeof(ime2));
format(string, sizeof(string), "%s je izbačen sa servera od administatora %s!Razlog: %s", ime1, ime2, reason);
SendClientMessageToAll(COLOR_KRED, string);
KickPlayer(user, "");
}
}
    return 1;
}

CMD:respawn(playerid,params[])
{
    if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]>= 3) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
{
RespawnVehicle();
SendClientMessage(playerid, COLOR_WHITE, "Vozila su respawnana!");
}
return 1;
}

CMD:makeadmin(playerid,params[])
{
   {
new user, lvl;
if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]>= 3) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
{
if(sscanf(params, "ui", user, lvl)) return SendClientMessage(playerid, COLOR_WHITE, "/makeadmin [ID] [level]");
if(lvl > 3) return SendClientMessage(playerid, COLOR_KRED, "Admin level moze biti samo 1 | 2 | 3");
AdminLevel[user] = lvl;
new string[128];
format(string, sizeof(string), "Admin %s vam je namjestio admin level na %d.", PlayerName(playerid), lvl);
SendClientMessage(user, COLOR_KRED, string);
format(string, sizeof(string), "Postavili ste igracu %s admin level %d.", PlayerName(user), lvl);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
   return 1;
}

CMD:settime(playerid,params[])
{
    if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]>= 3) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
    {
        new hour;
        if(sscanf(params, "d", hour)) return SendClientMessage(playerid, COLOR_WHITE, "Koristenje: /settime [HOUR]");
        if (hour < 0 || hour > 23) return SendClientMessage(playerid, COLOR_KRED, "Vrijeme mora bti izmedu 0 - 23!");
        for (new i = 0; i < MAX_PLAYERS; i++)
        {
            SetPlayerTime(i, hour, 0);
            return true;
        }
    }
    return 1;
}

CMD:uping(playerid,params[])
{
if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]>= 2) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
{
    new newz;
    new Float:X, Float:Y, Float:Z;
if(sscanf(params, "i", newz)) return SendClientMessage(playerid, COLOR_WHITE, "Koristenje: /uping [Visina]");
if(newz >20000 || newz <1) return SendClientMessage(playerid, COLOR_KRED, "Visina mora biti izmedu 1 i 20000 metara");
GetPlayerPos(playerid,X, Y,Z);
SetPlayerPos(playerid,X,Y,Z+newz);
SendClientMessage(playerid,COLOR_WHITE,"Pomakli ste se gore");
}
return 1;
}

CMD:downing(playerid,params[])
{
if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]>= 2) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
{
    new newz;
    new Float:X, Float:Y, Float:Z;
if(sscanf(params, "i", newz)) return SendClientMessage(playerid, COLOR_WHITE, "Koristenje: /downing [Visina]");
if(newz >20000 || newz <1) return SendClientMessage(playerid, COLOR_KRED, "Visina mora biti izmedu 1 i 20000 metara");
GetPlayerPos(playerid,X, Y,Z);
SetPlayerPos(playerid,X,Y,Z-newz);
SendClientMessage(playerid,COLOR_WHITE,"Pomakli ste se dolje");
}
return 1;
}

CMD:vehid(playerid,params[])
{
    if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]> 0) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
{
if(IsPlayerInAnyVehicle(playerid))
{
new s[48];
format(s, sizeof(s), "ID ovog vozila je: %d ",GetPlayerVehicleID(playerid));
    SendClientMessage(playerid, COLOR_KRED, s);
}
}
return 1;
}

CMD:specon(playerid,params[])
{
new specid;
    if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]> 0) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
{
if(sscanf(params, "u", specid)) return SendClientMessage(playerid, COLOR_WHITE, "Koristenje: /specon [ID]");
    if(IsPlayerInAnyVehicle(specid))
{
    SetPlayerInterior(playerid,GetPlayerInterior(specid));
        TogglePlayerSpectating(playerid, 1);
        PlayerSpectateVehicle(playerid, GetPlayerVehicleID(specid));
        gSpectateID[playerid] = specid;
        gSpectateType[playerid] = ADMIN_SPEC_TYPE_VEHICLE;
        }
     else
{
        SetPlayerInterior(playerid,GetPlayerInterior(specid));
        TogglePlayerSpectating(playerid, 1);
        PlayerSpectatePlayer(playerid, specid);
        gSpectateID[playerid] = specid;
        gSpectateType[playerid] = ADMIN_SPEC_TYPE_PLAYER;
      }
      }
return 1;
}

CMD:specoff(playerid,params[])
{
if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]> 0) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
{
TogglePlayerSpectating(playerid, 0);
gSpectateID[playerid] = INVALID_PLAYER_ID;
gSpectateType[playerid] = ADMIN_SPEC_TYPE_NONE;
}
return 1;
}

CMD:godmode(playerid,params[])
{
    if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]>= 2) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
{
SetPlayerHealth(playerid, 99999.0);
SendClientMessage(playerid, COLOR_WHITE, "Koristite godmode!");
}
return 1;
}

CMD:visible(playerid,params[])
{
new id;
if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]>= 2) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
{
if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_WHITE, "Koristenje: /visible [0/1]");
if(id == 1)
{
SetPlayerColor(playerid, playerColors[playerid]);
SendClientMessage(playerid, COLOR_WHITE, "Vidljivi ste svima!");
}
if(id == 0)
{
        SetPlayerColor(playerid, 0xFFFFFF00);
        SendClientMessage(playerid, COLOR_WHITE, "Nevidljivi ste svima!");
    }
    }
    return 1;
}

CMD:explode(playerid, params[])
{
new user,
string[128],
ime1[24],
ime2[25];
new id;
new Float:X,Float:Y,Float:Z;
if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]> 0) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
{
if(sscanf(params, "u", user)) return SendClientMessage(playerid, COLOR_WHITE, "Koristenje: /explode [ID]");
{
GetPlayerPos(id,X,Y,Z);
CreateExplosion(X,Y,Z,7,1);
CreateExplosion(X,Y,Z,7,1);
CreateExplosion(X,Y,Z,7,1);
GetPlayerName(user, ime1, sizeof(ime1));
GetPlayerName(playerid, ime2, sizeof(ime2));
format(string, sizeof(string), "%s je eksplodirao od administatora %s", ime1, ime2);
SendClientMessageToAll(COLOR_KRED, string);
}
}
return 1;
}

CMD:setname(playerid,params[])
{
new dir[256],idx,giveplayerid;
new tmp[256];
    new string[48];
if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]>= 3) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
{
dir = strtok(params, idx);

strmid(tmp, params, 11, strlen(params));
if(!strlen(dir))
{
SendClientMessage(playerid, COLOR_WHITE, "Koristenje: /setname [ID] [Ime]");
return 1;
}
giveplayerid = strval(dir);
dir = strtok(params, idx);
if (IsPlayerConnected(giveplayerid))
{
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Koristenje: /setname [ID] [Ime]");
return 1;
}
format(string, sizeof(string), "Promijenili ste ime %s u: %s", Player(giveplayerid),giveplayerid, tmp);
SetPlayerName(giveplayerid, tmp);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
return 1;
}

CMD:setloc(playerid,params[])
{
    if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]> 0) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
{
GetPlayerPos(playerid,LocX, LocY, LocZ);
    GetPlayerFacingAngle(playerid,LocAng);
SendClientMessage(playerid, COLOR_WHITE, "Vasa pozicija je spremljena.");
}
return 1;
}

CMD:gotoloc(playerid,params[])
{
    if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]> 0) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
{
if(LocX == 0.0 && LocY == 0.0 && LocZ == 0.0) return SendClientMessage(playerid, COLOR_WHITE, "Upisite /setloc prije teleportiranja.");
else
{
if(IsPlayerInAnyVehicle(playerid))
{
    new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, LocX, LocY, LocZ);
SetPlayerFacingAngle(playerid,LocAng);
}
else
{
SetPlayerPos(playerid,LocX, LocY, LocZ);
SetPlayerFacingAngle(playerid,LocAng);
}
SendClientMessage(playerid, COLOR_WHITE, "Teleportirani ste do vase zadnje spremljene pozicije.");
}
}
return 1;
}

CMD:remove(playerid,params[])
{
new tmp[256],idx;
tmp = strtok(params, idx);
if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]>= 2) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
{
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE,"Koristenje: /remove [ID]");
}
else
{
    RemovePlayerFromVehicle(strval(tmp));
SendClientMessage(playerid, COLOR_WHITE, "Makli ste igraca %s iz vozila.");
    SendClientMessage(strval(tmp), COLOR_WHITE, "Admin %s vas je izbacio iz auta!");
}
}
return 1;
}

CMD:destroyveh(playerid,params[])
{
new string[256],idx;
new obj2id = strval(strtok(params, idx));
if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]>= 2) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
{
if(!obj2id)
{
SendClientMessage(playerid, COLOR_WHITE,  "Koristenje: /destroyveh [ID]");
SendClientMessage(playerid, COLOR_WHITE,  "Upisite /idveh da vidite trenutni ID vozila .");
return 1;
}
format(string, sizeof(string), "Obrisali ste vozilo: %d", obj2id);
SendClientMessage(playerid,COLOR_WHITE,  string);
RemovePlayerFromVehicle(obj2id);
DestroyVehicle(obj2id);
}
return 1;
}

CMD:busi(playerid,params[])
{
    new id;
    new panels, doors, lights, tires;
    new carid = GetPlayerVehicleID(id);
    if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]> 0) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
    {
        if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_WHITE, "Koristenje: /busi [ID]");
        if(IsPlayerInAnyVehicle(id))
        {
            GetVehicleDamageStatus(carid, panels, doors, lights, tires);
            UpdateVehicleDamageStatus(carid, panels, doors, lights, 15);
        }
    }
    return 1;
}

CMD:onduty(playerid, params[])
{
    if (!IsPlayerAdmin(playerid) || AdminLevel[playerid]>= 1)return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
{
new sMsg[ 128 ];
        GetPlayerName( playerid, sMsg, MAX_PLAYER_NAME );
        SetPlayerColor(playerid, COLOR_GREEN);
        SetPlayerHealth(playerid, 250);
        SetPlayerArmour(playerid, 250);
        format( sMsg, sizeof( sMsg ), "%s je sada na duznosti.", sMsg );
        SendClientMessageToAll(COLOR_RED, sMsg);
        OnDuty[playerid] = 1;
        }
return 1;
}

CMD:offduty(playerid,params[])
{
       if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]> 0) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
       {
   new sMsg[ 128 ];
       GetPlayerName( playerid, sMsg, MAX_PLAYER_NAME );
       SetPlayerColor(playerid, COLOR_WHITE);
       SetPlayerHealth(playerid, 250);
       SetPlayerArmour(playerid, 250);
       format( sMsg, sizeof( sMsg ), "%s vise nije na duznosti.", sMsg );
       SendClientMessageToAll(COLOR_RED, sMsg);
       OnDuty[playerid] = 1;
       }
       return 1;
}

CMD:gmx(playerid,params[])
{
new name[24];
new string[128];
    if(!IsPlayerAdmin(playerid) || AdminLevel[playerid]>= 3) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
{
SetTimerEx("gmxtimer", 10000, false, "i", playerid);
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Server će se restartati za 10 sekundi!", name);
SendClientMessageToAll(COLOR_GREEN, string);
}
    return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno):
Uskoro novi stunt server iStunt. DoÄ'ite i zabavite se!




   
   




Dizajniram za $$$
Popis stvari koje radim:

Wallpaper √  Signature ×  Logo √  Dizajn stranice (Ne kodiranje) √  Baner √  Avatar √  Animacija √  Intro √

U svakoj komandi si stavio da ako igrač nije RCON admin ili ako je igrač admin onda da mu ispiše da ne može koristiti komandu.

Ovo ti je primjer kako bi trebalo izgledat:


CMD:ahelp(playerid,params[]) 

   if(!IsPlayerAdmin(playerid) || AdminLevel[playerid] < 1) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande"); 
   { 
    ShowPlayerDialog(playerid,4,DIALOG_STYLE_MSGBOX,"Admin Komande!","/ban /kick /vehid /specon /specoff /explode\n/setloc /gotoloc /gotop /gethere /busi","Ok", "Ok"); 
    if(!IsPlayerAdmin(playerid) || AdminLevel[playerid] < 2) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande"); 
   { 
   ShowPlayerDialog(playerid,5,DIALOG_STYLE_MSGBOX,"Admin Komande!","/ban /kick /vehid /specon /specoff /explode\n/setloc /gotoloc /gotop /gethere /uping /downing\n/busi /godmode /visible /remove /destroyveh /cc","Ok", "Ok"); 
   { 
   if(!IsPlayerAdmin(playerid) || AdminLevel[playerid] < 3) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande"); 
    ShowPlayerDialog(playerid,6,DIALOG_STYLE_MSGBOX,"Admin Komande!","/ban /kick /vehid /specon /specoff /explode\n/setloc /gotoloc /gotop /gethere /uping /downing\n/busi /godmode /visible /remove /destroyveh /cc\n/respawn /gmx /makeadmin /settime /setname","Ok", "Ok"); 
   } 
   } 
   } 
   return 1; 
}

Last nick: Paradox

opet meni ne radi nego kao rcon, mislim da mi admin sistem nevalja :( ajd onda pod loc ovo
Uskoro novi stunt server iStunt. DoÄ'ite i zabavite se!




   
   




Dizajniram za $$$
Popis stvari koje radim:

Wallpaper √  Signature ×  Logo √  Dizajn stranice (Ne kodiranje) √  Baner √  Avatar √  Animacija √  Intro √

if(AdminLevel[playerid] = 0) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
U tom stilu bi trebalo

EDIT:
Jer stavio si ako je igrac admin rcon da mu izbaci da nije autoriziran
Poslednja Izmena: April 28, 2011, 13:46:26 POSLE PODNE od .:RTV:.

Citat: .:RTV:. poslato April 28, 2011, 13:45:28 POSLE PODNE
if(AdminLevel[playerid] = 0) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
U tom stilu bi trebalo

EDIT:
Jer stavio si ako je igrac admin rcon da mu izbaci da nije autoriziran
nisam te bas skuzio, jel treba ic tako ili je tako krivo?
Uskoro novi stunt server iStunt. DoÄ'ite i zabavite se!




   
   




Dizajniram za $$$
Popis stvari koje radim:

Wallpaper √  Signature ×  Logo √  Dizajn stranice (Ne kodiranje) √  Baner √  Avatar √  Animacija √  Intro √

primjer
CMD:ahelp(playerid,params[])    
{    
  if(AdminLevel[playerid] < 1) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");    
  {    
   ShowPlayerDialog(playerid,4,DIALOG_STYLE_MSGBOX,"Admin Komande!","/ban /kick /vehid /specon /specoff /explode\n/setloc /gotoloc /gotop /gethere /busi","Ok", "Ok");    
   if(!IsPlayerAdmin(playerid) || AdminLevel[playerid] < 2) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");    
  {    
  ShowPlayerDialog(playerid,5,DIALOG_STYLE_MSGBOX,"Admin Komande!","/ban /kick /vehid /specon /specoff /explode\n/setloc /gotoloc /gotop /gethere /uping /downing\n/busi /godmode /visible /remove /destroyveh /cc","Ok", "Ok");    
  {    
  if(!IsPlayerAdmin(playerid) || AdminLevel[playerid] < 3) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");    
   ShowPlayerDialog(playerid,6,DIALOG_STYLE_MSGBOX,"Admin Komande!","/ban /kick /vehid /specon /specoff /explode\n/setloc /gotoloc /gotop /gethere /uping /downing\n/busi /godmode /visible /remove /destroyveh /cc\n/respawn /gmx /makeadmin /settime /setname","Ok", "Ok");    
  }    
  }    
  }    
  return 1;    
}  


Kao sto sam reko,u pocetku si stavio ako je igrac rcon admin da mu izbaci da nije admin xD

Edit:na ovo mislim
if--->!IsPlayerAdmin(playerid)<--- || AdminLevel[playerid] < 1) return SendClientMessage(playerid, COLOR_KRED, "Niste autorizirani za koristenje ove komande");
to se brise
Poslednja Izmena: April 28, 2011, 13:52:11 POSLE PODNE od .:RTV:.

sve jedno, ovo moze lock imam covjeka koji ce mi fixat admin sistem, hvala vama i njemu!
Uskoro novi stunt server iStunt. DoÄ'ite i zabavite se!




   
   




Dizajniram za $$$
Popis stvari koje radim:

Wallpaper √  Signature ×  Logo √  Dizajn stranice (Ne kodiranje) √  Baner √  Avatar √  Animacija √  Intro √