/ahelp Problem

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
  • Ich scripte einen /ahelp befehl aber wenn ich compilen will stürzt der Compiler ab also es steht "Der Compiler funktioniert nicht mehr".


    ocmd:ahelp(playerid,params[])
    {
    if(isAdmin(playerid,1))return
    SendClientMessage(playerid,0xFFFF00FF,"~Probe-Supporter Befehle~");
    SendClientMessage(playerid,0xFFFF00FF,"gotoxyz,check,ac,getip,slap,mapport,freeze,unfreeze,kick,gethere,gotoplayer,tv,tvaus,adminduty");
    else if(isAdmin(playerid,2))return
    {
    SendClientMessage(playerid,0xFFFF00FF,"~Supporter~");
    SendClientMessage(playerid,0xFFFF00FF,"gotoxyz,check,ac,getip,slap,mapport,freeze,unfreeze,kick,gethere,gotoplayer,tv,tvaus,adminduty");
    SendClientMessage(playerid,0xFFFF00FF,"godcheck,ban,grosseohren,setworld,setint,awiederbeleben,mute,unmute,spawn");
    }
    else if(isAdmin(playerid,3))return
    {
    SendClientMessage(playerid,0xFFFF00FF,"~Ingame Moderator Befehle~");
    SendClientMessage(playerid,0xFFFF00FF,"gotoxyz,check,ac,getip,slap,mapport,freeze,unfreeze,kick,gethere,gotoplayer,tv,tvaus,adminduty");
    SendClientMessage(playerid,0xFFFF00FF,"godcheck,ban,grosseohren,setworld,setint,awiederbeleben,mute,unmute,spawn");
    SendClientMessage(playerid,0xFFFF00FF,"veh,delveh,takegun,entercar,fixveh,timeban,say");
    }
    else if(isAdmin(playerid,4))return
    {
    SendClientMessage(playerid,0xFFFF00FF,"~Support-Admin Befehle~");
    SendClientMessage(playerid,0xFFFF00FF,"gotoxyz,check,ac,getip,slap,mapport,freeze,unfreeze,kick,gethere,gotoplayer,tv,tvaus,adminduty");
    SendClientMessage(playerid,0xFFFF00FF,"godcheck,ban,grosseohren,setworld,setint,awiederbeleben,mute,unmute,spawn");
    SendClientMessage(playerid,0xFFFF00FF,"veh,delveh,takegun,entercar,fixveh,timeban,say");
    SendClientMessage(playerid,0xFFFF00FF,"sethp,setarmour,warn,jetpack,givegun,waffen,setskin,cc");
    }
    else if(isAdmin(playerid,5))return
    {
    SendClientMessage(playerid,0xFFFF00FF,"~1337 Admin Befehle~");
    SendClientMessage(playerid,0xFFFF00FF,"gotoxyz,check,ac,getip,slap,mapport,freeze,unfreeze,kick,gethere,gotoplayer,tv,tvaus,adminduty");
    SendClientMessage(playerid,0xFFFF00FF,"godcheck,ban,grosseohren,setworld,setint,awiederbeleben,mute,unmute,spawn");
    SendClientMessage(playerid,0xFFFF00FF,"veh,delveh,takegun,entercar,fixveh,timeban,say");
    SendClientMessage(playerid,0xFFFF00FF,"sethp,setarmour,warn,jetpack,givegun,waffen,setskin,cc");
    SendClientMessage(playerid,0xFFFF00FF,"up,down,right,left,fly,healall,kill,restart,givemoney");
    }
    return 1;
    }

  • Versuche es so:


    Ich habe die Reihenfolge umgedreht, da ein Level 5 Admin ja auch Level 1 ist.
    Hinter den if's war jeweils ein return ohne Angaben, das habe ich entfernt.

  • if (PlayerInfo[playerid][pAdmin] >= 2)



    => : ist gleich der Rank oder höher

  • Kriege diese errors...


    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(706) : error 029: invalid expression, assumed zero
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(718) : error 029: invalid expression, assumed zero
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(718) : warning 215: expression has no effect
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(718) : error 001: expected token: ";", but found "if"
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(718) : error 029: invalid expression, assumed zero
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(718) : fatal error 107: too many error messages on one line


    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    5 Errors.



    ocmd:ahelp(playerid,params[])
    {
    if(!isAdmin(playerid,1))return SendClientMessage(playerid,0xFF0000FF,"Du bist kein Admin");
    if(sInfo[playerid][alevel] >= 1))
    {
    SendClientMessage(playerid,0xFFFF00FF,"~1339 Projektleiter Befehle~");
    SendClientMessage(playerid,0xFFFF00FF,"teleport,gotoxyz,check,ac,getip,slap,mapport,freeze,unfreeze,kick,gethere,gotoplayer,tv,tvaus,adminduty");
    SendClientMessage(playerid,0xFFFF00FF,"godcheck,ban,grosseohren,setworld,setint,awiederbeleben,mute,unmute,spawn,skick");
    SendClientMessage(playerid,0xFFFF00FF,"veh,delveh,takegun,entercar,fixveh,timeban,say,sban");
    SendClientMessage(playerid,0xFFFF00FF,"sethp,setarmour,warn,jetpack,givegun,waffen,setskin,cc");
    SendClientMessage(playerid,0xFFFF00FF,"up,down,right,left,fly,healall,kill,restart,givemoney");
    SendClientMessage(playerid,0xFFFF00FF,"money,unban,makeleader,pinvite,puninvite,------~rconinfo~------");
    SendClientMessage(playerid,0xFFFF00FF,"god,cargod,setscore");
    SendClientMessage(playerid,0xFFFF00FF,"setadmin,adminsystem,rconadminsystem");
    }
    else if(sInfo[playerid][alevel] >= 7))
    {
    SendClientMessage(playerid,0xFFFF00FF,"~1338 Stellvertretender Serverleiter Befehle~");
    SendClientMessage(playerid,0xFFFF00FF,"teleport,gotoxyz,check,ac,getip,slap,mapport,freeze,unfreeze,kick,gethere,gotoplayer,tv,tvaus,adminduty");
    SendClientMessage(playerid,0xFFFF00FF,"godcheck,ban,grosseohren,setworld,setint,awiederbeleben,mute,unmute,spawn,skick");
    SendClientMessage(playerid,0xFFFF00FF,"veh,delveh,takegun,entercar,fixveh,timeban,say,sban");
    SendClientMessage(playerid,0xFFFF00FF,"sethp,setarmour,warn,jetpack,givegun,waffen,setskin,cc");
    SendClientMessage(playerid,0xFFFF00FF,"up,down,right,left,fly,healall,kill,restart,givemoney");
    SendClientMessage(playerid,0xFFFF00FF,"money,unban,makeleader,pinvite,puninvite,------~rconinfo~------");
    SendClientMessage(playerid,0xFFFF00FF,"god,cargod,setscore");
    }
    else if(sInfo[playerid][alevel] >= 6))
    {
    SendClientMessage(playerid,0xFFFF00FF,"~Server-Verwalter Befehle~");
    SendClientMessage(playerid,0xFFFF00FF,"teleport,gotoxyz,check,ac,getip,slap,mapport,freeze,unfreeze,kick,gethere,gotoplayer,tv,tvaus,adminduty");
    SendClientMessage(playerid,0xFFFF00FF,"godcheck,ban,grosseohren,setworld,setint,awiederbeleben,mute,unmute,spawn,skick");
    SendClientMessage(playerid,0xFFFF00FF,"veh,delveh,takegun,entercar,fixveh,timeban,say,sban");
    SendClientMessage(playerid,0xFFFF00FF,"sethp,setarmour,warn,jetpack,givegun,waffen,setskin,cc");
    SendClientMessage(playerid,0xFFFF00FF,"up,down,right,left,fly,healall,kill,restart,givemoney");
    SendClientMessage(playerid,0xFFFF00FF,"money,unban,makeleader,pinvite,puninvite,------~rconinfo~------");
    }
    else if(sInfo[playerid][alevel] >= 5))
    {
    SendClientMessage(playerid,0xFFFF00FF,"~1337 Admin Befehle~");
    SendClientMessage(playerid,0xFFFF00FF,"teleport,gotoxyz,check,ac,getip,slap,mapport,freeze,unfreeze,kick,gethere,gotoplayer,tv,tvaus,adminduty");
    SendClientMessage(playerid,0xFFFF00FF,"godcheck,ban,grosseohren,setworld,setint,awiederbeleben,mute,unmute,spawn,skick");
    SendClientMessage(playerid,0xFFFF00FF,"veh,delveh,takegun,entercar,fixveh,timeban,say,sban");
    SendClientMessage(playerid,0xFFFF00FF,"sethp,setarmour,warn,jetpack,givegun,waffen,setskin,cc");
    SendClientMessage(playerid,0xFFFF00FF,"up,down,right,left,fly,healall,kill,restart,givemoney,settime,setweather");
    }
    else if(sInfo[playerid][alevel] >= 4))
    {
    SendClientMessage(playerid,0xFFFF00FF,"~Support-Admin Befehle~");
    SendClientMessage(playerid,0xFFFF00FF,"teleport,gotoxyz,check,ac,getip,slap,mapport,freeze,unfreeze,kick,gethere,gotoplayer,tv,tvaus,adminduty");
    SendClientMessage(playerid,0xFFFF00FF,"godcheck,ban,grosseohren,setworld,setint,awiederbeleben,mute,unmute,spawn,skick");
    SendClientMessage(playerid,0xFFFF00FF,"veh,delveh,takegun,entercar,fixveh,timeban,say,sban");
    SendClientMessage(playerid,0xFFFF00FF,"sethp,setarmour,warn,jetpack,givegun,waffen,setskin,cc");
    }
    else if(sInfo[playerid][alevel] >= 3))
    {
    SendClientMessage(playerid,0xFFFF00FF,"~Ingame Moderator Befehle~");
    SendClientMessage(playerid,0xFFFF00FF,"teleport,gotoxyz,check,ac,getip,slap,mapport,freeze,unfreeze,kick,gethere,gotoplayer,tv,tvaus,adminduty");
    SendClientMessage(playerid,0xFFFF00FF,"godcheck,ban,grosseohren,setworld,setint,awiederbeleben,mute,unmute,spawn");
    SendClientMessage(playerid,0xFFFF00FF,"veh,delveh,takegun,entercar,fixveh,timeban,say,sban");
    }
    else if(sInfo[playerid][alevel] >= 2))
    {
    SendClientMessage(playerid,0xFFFF00FF,"~Supporter~");
    SendClientMessage(playerid,0xFFFF00FF,"teleport,gotoxyz,check,ac,getip,slap,mapport,freeze,unfreeze,kick,gethere,gotoplayer,tv,tvaus,adminduty");
    SendClientMessage(playerid,0xFFFF00FF,"godcheck,ban,grosseohren,setworld,setint,awiederbeleben,mute,unmute,spawn,skick");
    }
    else if(sInfo[playerid][alevel] = 1))
    {
    SendClientMessage(playerid,0xFFFF00FF,"~Probe-Supporter Befehle~");
    SendClientMessage(playerid,0xFFFF00FF,"teleport,gotoxyz,check,ac,getip,slap,mapport,freeze,unfreeze,kick,gethere,gotoplayer,tv,tvaus,adminduty");
    }
    return 1;
    }

  • Du fragst als erstes auf Level 1 ab, schließt eine Klammer jeweils zu viel und hast unten eine Zuweisung im if.
    Versuche es so:

  • Ist das richtig mit dem ahelp befehle, sehe ich jz als lvl 8 admin auch die lvl 1 befehle?

    Ja und Nein. Du siehst sie zwar, aber nur weil du sie auch unter den Befehlen des Adminranges 8 hinzugefügt hast ; NICHT aber weil du die Befehle vom Adminrang 1 siehst. Zu Deutsch: Derzeit müsstest du ab dem Rang und aufwärts den Befehl zur Nachricht hinzufügen, damit er sie sieht - ein einmaliges schreiben ist über die derzeitige Variante nicht möglich.