Adminhelp Befehl geht nicht

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Kann mir wer helfen? Ich hab da ein Befehl gebastelt aber der zeigt mir den falschen Rang an.
    Also ich speicher mit MySQL und das soll so funktionieren, dass jeder Rang seine eigenen Helpliste bekommt aber es wird immer nur die für den Probe Supporter angezeigt.




    ocmd:ah(playerid,params[])
    {
    if(isAdmin(playerid,1))
    {
    SendClientMessage(playerid,COLOR_GREY,":::::::::::{FFF000}Admin Help{BEBEBE}:::::::::::");
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Probe Supporter:{BEBEBE} /ah, /delcar, /freeze, /unfreeze");
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Probe Supporter:{BEBEBE} /aduty, /goto, /gethere, /heal, /tele");
    SendClientMessage(playerid,COLOR_GREY,"");
    }
    else if(isAdmin(playerid,2))
    {
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Supporter:{BEBEBE} /ah, /spawncar, /delcar, /freeze, /unfreeze");
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Supporter:{BEBEBE} /aduty, /goto, /gethere, /clearchat, /heal, /tele");
    SendClientMessage(playerid,COLOR_GREY,"");
    }
    else if(isAdmin(playerid,3))
    {
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Community Manager:{BEBEBE} /ah, /spawncar, /delcar, /freeze, /unfreeze");
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Community Manager:{BEBEBE} /aduty, /goto, /gethere, /slap, /clearchat, /heal, /tele");
    SendClientMessage(playerid,COLOR_GREY,"");
    }
    else if(isAdmin(playerid,4))
    {
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Scripter:{BEBEBE} /ah, /spawncar, /delcar, /freeze, /unfreeze, /gmx, /jetpack, /stopjetpack");
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Scripter:{BEBEBE} /aduty, /goto, /gethere, /slap, /clearchat, /heal, /tele, /givegun");
    SendClientMessage(playerid,COLOR_GREY,"");
    }
    else if(isAdmin(playerid,5))
    {
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Server Leiter:{BEBEBE} /ah, /spawncar, /delcar, /freeze, /unfreeze, /gmx, /jetpack, /stopjetpack");
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Server Leiter:{BEBEBE} /aduty, /goto, /gethere, /slap, /clearchat, /gotocoords, /heal, /tele, /givegun");
    SendClientMessage(playerid,COLOR_GREY,"");
    }
    else return SendClientMessage(playerid,COLOR_DRED,"Dein Adminrang ist zu niedrig!");
    return 1;
    }

    Mit freundlichen Grüßen,
    Derakar

  • ocmd:ah(playerid,params[])
    {
    switch(isAdmin(playerid))
    {
    case 0:return SendClientMessage(playerid,COLOR_DRED,"Dein Adminrang ist zu niedrig!");
    case 1:
    {
    SendClientMessage(playerid,COLOR_GREY,":::::::::::{FFF000}Admin Help{BEBEBE}:::::::::::");
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Probe Supporter:{BEBEBE} /ah, /delcar, /freeze, /unfreeze");
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Probe Supporter:{BEBEBE} /aduty, /goto, /gethere, /heal, /tele");
    SendClientMessage(playerid,COLOR_GREY,"");
    }
    case 2:
    {
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Supporter:{BEBEBE} /ah, /spawncar, /delcar, /freeze, /unfreeze");
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Supporter:{BEBEBE} /aduty, /goto, /gethere, /clearchat, /heal, /tele");
    SendClientMessage(playerid,COLOR_GREY,"");
    }
    case 3:
    {
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Community Manager:{BEBEBE} /ah, /spawncar, /delcar, /freeze, /unfreeze");
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Community Manager:{BEBEBE} /aduty, /goto, /gethere, /slap, /clearchat, /heal, /tele");
    SendClientMessage(playerid,COLOR_GREY,"");
    }
    case 4:
    {
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Scripter:{BEBEBE} /ah, /spawncar, /delcar, /freeze, /unfreeze, /gmx, /jetpack, /stopjetpack");
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Scripter:{BEBEBE} /aduty, /goto, /gethere, /slap, /clearchat, /heal, /tele, /givegun");
    SendClientMessage(playerid,COLOR_GREY,"");
    }
    case 5:
    {
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Server Leiter:{BEBEBE} /ah, /spawncar, /delcar, /freeze, /unfreeze, /gmx, /jetpack, /stopjetpack");
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Server Leiter:{BEBEBE} /aduty, /goto, /gethere, /slap, /clearchat, /gotocoords, /heal, /tele, /givegun");
    SendClientMessage(playerid,COLOR_GREY,"");
    }
    }
    return 1;
    }


    Versuch das mal ;)

  • isAdmin(playerid,a_level)
    {
    if(sInfo[playerid][alevel]>=a_level)return 1;
    return 0;
    }


    Hier die Abfrage und bei dem switch ist auch noch die Warnung:


    script.pwn(372) : warning 202: number of arguments does not match definition

    Mit freundlichen Grüßen,
    Derakar

  • ocmd:ah(playerid,params[])
    {
    switch(sInfo[playerid][alevel])
    {
    case 0:return SendClientMessage(playerid,COLOR_DRED,"Dein Adminrang ist zu niedrig!");
    case 1:
    {
    SendClientMessage(playerid,COLOR_GREY,":::::::::::{FFF000}Admin Help{BEBEBE}:::::::::::");
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Probe Supporter:{BEBEBE} /ah, /delcar, /freeze, /unfreeze");
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Probe Supporter:{BEBEBE} /aduty, /goto, /gethere, /heal, /tele");
    SendClientMessage(playerid,COLOR_GREY,"");
    }
    case 2:
    {
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Supporter:{BEBEBE} /ah, /spawncar, /delcar, /freeze, /unfreeze");
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Supporter:{BEBEBE} /aduty, /goto, /gethere, /clearchat, /heal, /tele");
    SendClientMessage(playerid,COLOR_GREY,"");
    }
    case 3:
    {
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Community Manager:{BEBEBE} /ah, /spawncar, /delcar, /freeze, /unfreeze");
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Community Manager:{BEBEBE} /aduty, /goto, /gethere, /slap, /clearchat, /heal, /tele");
    SendClientMessage(playerid,COLOR_GREY,"");
    }
    case 4:
    {
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Scripter:{BEBEBE} /ah, /spawncar, /delcar, /freeze, /unfreeze, /gmx, /jetpack, /stopjetpack");
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Scripter:{BEBEBE} /aduty, /goto, /gethere, /slap, /clearchat, /heal, /tele, /givegun");
    SendClientMessage(playerid,COLOR_GREY,"");
    }
    case 5:
    {
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Server Leiter:{BEBEBE} /ah, /spawncar, /delcar, /freeze, /unfreeze, /gmx, /jetpack, /stopjetpack");
    SendClientMessage(playerid,COLOR_GREY,"{FFFF00}Server Leiter:{BEBEBE} /aduty, /goto, /gethere, /slap, /clearchat, /gotocoords, /heal, /tele, /givegun");
    SendClientMessage(playerid,COLOR_GREY,"");
    }
    }
    return 1;
    }


    Das sollte klappen.

    Einmal editiert, zuletzt von Man]ne. ()