Unknown Server Command

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
  • hey.
    Wenn ich z.B /makeadmin (meine version settm) machen will.
    Steht da: Unknown Server Command.
    Hier Code:
    (ps, ich bin admin)


    dcmd_settm(playerid,params[])
    {
    new pID, rang, pnameb[MAX_PLAYER_NAME];
    if(sscanf(params,"ui",pID,rang))return SendClientMessage(playerid,COLOR_ROT,"Befehl: /settm [playerid][Rang]");
    if(SInfo[playerid][pAdmin] >= 5)
    {
    GetPlayerName(playerid,pname,sizeof(pname));
    GetPlayerName(pID,pnameb,sizeof(pnameb));
    SInfo[pID][pAdmin] = rang;
    format(str,sizeof(str),"Administrator %s hat %s zu Adminrang %d befördert.",pname,pnameb,rang);
    SendClientMessageToAll(COLOR_GELB,str);
    return 1;
    }
    return Adminbefehl;
    }


    dcmd_setchef(playerid,params[])
    {
    new pID, rang, pnameb[MAX_PLAYER_NAME];
    if(sscanf(params,"ui",pID,rang))return SendClientMessage(playerid,COLOR_ROT,"Befehl: /setchef [playerid][Fraktion]");
    if(SInfo[playerid][pAdmin] >= 4)
    {
    GetPlayerName(playerid,pname,sizeof(pname));
    GetPlayerName(pID,pnameb,sizeof(pnameb));
    SInfo[pID][pLeader] = rang;
    SendClientMessage(playerid,0xFFFFFFFF,"Du hast %s zum Chef der %d gemacht.",pnameb,rang);
    format(str,sizeof(str),"Teammitglied %s hat %s zur Fraktion %d hinzugefügt.",pname,pnameb,rang);
    SendClientMessageToAll(COLOR_GELB,str);
    return 1;
    }
    return Adminbefehl;
    }




    /e


    Warnings (falls es unterstützt)
    C:\Users\Home\Desktop\It's Roleplay v0.1\Neuer Ordner\pawno\include\md5.inc(92) : warning 219: local variable "str" shadows a variable at a preceding level
    C:\Users\Home\Desktop\It's Roleplay v0.1\Neuer Ordner\gamemodes\Selfmade.pwn(3257) : warning 203: symbol is never used: "params"
    C:\Users\Home\Desktop\It's Roleplay v0.1\Neuer Ordner\gamemodes\Selfmade.pwn(3350) : warning 204: symbol is assigned a value that is never used: "vehicleid"
    C:\Users\Home\Desktop\It's Roleplay v0.1\Neuer Ordner\gamemodes\Selfmade.pwn(3720) : warning 202: number of arguments does not match definition
    C:\Users\Home\Desktop\It's Roleplay v0.1\Neuer Ordner\gamemodes\Selfmade.pwn(3720) : warning 202: number of arguments does not match definition
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    5 Warnings.

  • Dann bitte nochmal den Public OnPlayerCommandText und ändere das einfach mal mit diesem#define Adminbefehl, dass ist sinnlos.


    Schreib deine Commands so:


    dcmd_settm(playerid,params[])
    {
    new pID, rang, pnameb[MAX_PLAYER_NAME];
    if(sscanf(params,"ui",pID,rang))return SendClientMessage(playerid,COLOR_ROT,"Befehl: /settm [playerid][Rang]");
    if(SInfo[playerid][pAdmin] <= 5)return SendClientMessage(playerid,COLOR_ROT,"Du bist dazu nicht berechtigt.");
    {
    GetPlayerName(playerid,pname,sizeof(pname));
    GetPlayerName(pID,pnameb,sizeof(pnameb));
    SInfo[pID][pAdmin] = rang;
    format(str,sizeof(str),"Administrator %s hat %s zu Adminrang %d befördert.",pname,pnameb,rang);
    SendClientMessageToAll(COLOR_GELB,str);
    return 1;
    }
    return 1;
    }

  • public OnPlayerCommandText(playerid, cmdtext[])
    {


    dcmd(stadthalle,10,cmdtext);
    dcmd(veh,3,cmdtext);
    dcmd(killhotel,9,cmdtext);
    dcmd(enter,5,cmdtext);
    dcmd(exit,4,cmdtext);
    dcmd(rentout,7,cmdtext);
    dcmd(chotel,6,cmdtext);
    dcmd(renthotel,9,cmdtext);
    dcmd(waschen,7,cmdtext);
    dcmd(settm,9,cmdtext);
    dcmd(dienst,6,cmdtext);
    dcmd(tazer,5,cmdtext);
    dcmd(setchef,10,cmdtext);
    dcmd(ban,3,cmdtext);
    dcmd(an,2,cmdtext);
    dcmd(ca,2,cmdtext);
    dcmd(kick,4,cmdtext);
    dcmd(goto,4,cmdtext);
    dcmd(report,6,cmdtext);
    dcmd(gethere,7,cmdtext);
    dcmd(spawn,5,cmdtext);
    dcmd(geldgeben,9,cmdtext);
    dcmd(gebewaffe,9,cmdtext);
    dcmd(ahilfe,6,cmdtext);
    dcmd(bank,4,cmdtext);
    dcmd(einsperren,10,cmdtext);
    dcmd(reinziehen,10,cmdtext);
    dcmd(pinkeln,7,cmdtext);
    return SendClientMessage(playerid,COLOR_ROT,"{FF0005}[Fehler] {FFFFFF}Dieser Befehel existiert nicht.");
    }


  • Makier die Warnings mal im Befehl und zeig uns alle Befehle, wo warnings vorhanden sind.

  • Zeile 92:
    #define DIALOG_SH4 18


    Zeile 3257:
    dcmd_stadthalle(playerid,params[])


    Zeile 3350:
    new vehicleid = GetPlayerVehicleID(playerid);


    Zeile 3720:
    SendClientMessage(playerid,0xFFFFFFFF,"Du hast %s zum Chef der %d gemacht.",pnameb,rang);


    Zeile 3740:
    return 1;


    Der Befehl von Zeile 3740:
    dcmd_settm(playerid,params[])
    {
    new pID, rang, pnameb[MAX_PLAYER_NAME];
    if(sscanf(params,"ui",pID,rang))return SendClientMessage(playerid,COLOR_ROT,"Befehl: /settm [playerid][Rang]");
    if(SInfo[playerid][pAdmin] <= 5)return SendClientMessage(playerid,COLOR_ROT,"Du bist dazu nicht berechtigt.");
    {
    GetPlayerName(playerid,pname,sizeof(pname));
    GetPlayerName(pID,pnameb,sizeof(pnameb));
    SInfo[pID][pAdmin] = rang;
    format(str,sizeof(str),"Administrator %s hat %s zu Adminrang %d befördert.",pname,pnameb,rang);
    SendClientMessageToAll(COLOR_GELB,str);
    return 1;
    }
    return 1;
    }



    Aktuelle Warnings/Errors:
    C:\Users\Home\Desktop\It's Roleplay v0.1\Neuer Ordner\pawno\include\md5.inc(92) : warning 219: local variable "str" shadows a variable at a preceding level
    C:\Users\Home\Desktop\It's Roleplay v0.1\Neuer Ordner\gamemodes\Selfmade.pwn(3257) : warning 203: symbol is never used: "params"
    C:\Users\Home\Desktop\It's Roleplay v0.1\Neuer Ordner\gamemodes\Selfmade.pwn(3350) : warning 204: symbol is assigned a value that is never used: "vehicleid"
    C:\Users\Home\Desktop\It's Roleplay v0.1\Neuer Ordner\gamemodes\Selfmade.pwn(3720) : warning 202: number of arguments does not match definition
    C:\Users\Home\Desktop\It's Roleplay v0.1\Neuer Ordner\gamemodes\Selfmade.pwn(3720) : warning 202: number of arguments does not match definition
    C:\Users\Home\Desktop\It's Roleplay v0.1\Neuer Ordner\gamemodes\Selfmade.pwn(3740) : warning 225: unreachable code
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    6 Warnings.

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • Zeile 3740:
    dcmd_settm(playerid,params[])
    {
    new pID, rang, pnameb[MAX_PLAYER_NAME];
    if(sscanf(params,"ui",pID,rang))return SendClientMessage(playerid,COLOR_ROT,"Befehl: /settm [playerid][Rang]");
    if(SInfo[playerid][pAdmin] <= 5)return SendClientMessage(playerid,COLOR_ROT,"Du bist dazu nicht berechtigt.");
    {
    GetPlayerName(playerid,pname,sizeof(pname));
    GetPlayerName(pID,pnameb,sizeof(pnameb));
    SInfo[pID][pAdmin] = rang;
    format(str,sizeof(str),"Administrator %s hat %s zu Adminrang %d befördert.",pname,pnameb,rang);
    SendClientMessageToAll(COLOR_GELB,str);
    return 1;
    }
    return 1;
    }



    Zeile 3720:
    dcmd_setchef(playerid,params[])
    {
    new pID, rang, pnameb[MAX_PLAYER_NAME];
    if(sscanf(params,"ui",pID,rang))return SendClientMessage(playerid,COLOR_ROT,"Befehl: /setchef [playerid][Fraktion]");
    if(SInfo[playerid][pAdmin] >= 4)
    {
    GetPlayerName(playerid,pname,sizeof(pname));
    GetPlayerName(pID,pnameb,sizeof(pnameb));
    SInfo[pID][pLeader] = rang;
    SendClientMessage(playerid,0xFFFFFFFF,"Du hast %s zum Chef der %d gemacht.",pnameb,rang);
    format(str,sizeof(str),"Teammitglied %s hat %s zur Fraktion %d hinzugefügt.",pname,pnameb,rang);
    SendClientMessageToAll(COLOR_GELB,str);
    return 1;
    }
    return Adminbefehl;
    }


    Zeile 3350:
    dcmd_veh(playerid,params[])
    {
    new Float:vehx,Float:vehy,Float:vehz;
    new vehid,cc1,cc2,string[128];
    new vehicleid = GetPlayerVehicleID(playerid);
    if(sscanf(params,"iii",vehid,cc1,cc2))return SendClientMessage(playerid,COLOR_ROT,"[Benutze]: /veh [VehicleID][Farbe1][Farbe2]");
    if(SInfo[playerid][pAdmin] >= 3)
    {
    GetPlayerPos(playerid,vehx,vehy,vehz);
    new carid = CreateVehicle(vehid,vehx,vehy,vehz,3,cc1,cc2,-1);
    SetVehicleNumberPlate(carid,"~>Support<~");
    PutPlayerInVehicle(playerid, carid, 0);
    format(string,sizeof(string),"Du hast ein Admincar gespawnt! (FahrzeugID :%d)",GetVehicleModel(GetPlayerVehicleID(playerid)));
    SendClientMessage(playerid,COLOR_ROT,string);
    PutPlayerInVehicle(playerid, carid, 0);
    SetVehicleHealth(carid ,10000.0);
    }


    return 1;
    }


    Zeile 3257:
    dcmd_stadthalle(playerid,params[])
    {
    if(IsPlayerInRangeOfPoint(playerid,5.0,1427.4633,-991.8095,1639.7843))
    {
    ShowPlayerDialog(playerid,DIALOG_SH,DIALOG_STYLE_LIST,"Stadthalle","Personalausweis beantragen\nArbeitslosengeld beantragen","Absenden","Abbrechen");
    }
    else{SendClientMessage(playerid,COLOR_ROT,"Du kannst den Befehl hier nicht benutzen!");}
    return 1;
    }

  • Probier den so:


    dcmd_stadthalle(playerid,params[])
    {
    if(IsPlayerInRangeOfPoint(playerid,5.0,1427.4633,-991.8095,1639.7843))
    {
    ShowPlayerDialog(playerid,DIALOG_SH4,DIALOG_STYLE_LIST,"Stadthalle","Personalausweis beantragen\nArbeitslosengeld beantragen","Absenden","Abbrechen");
    }
    else{SendClientMessage(playerid,COLOR_ROT,"Du kannst den Befehl hier nicht benutzen!");}
    return 1;
    }

    den so:
    dcmd_setchef(playerid,params[])
    {
    new pID, rang, pnameb[MAX_PLAYER_NAME], str[128];
    if(sscanf(params,"ui",pID,rang))return SendClientMessage(playerid,COLOR_ROT,"Befehl: /setchef [playerid][Fraktion]");
    if(SInfo[playerid][pAdmin] >= 4)
    {
    GetPlayerName(playerid,pname,sizeof(pname));
    GetPlayerName(pID,pnameb,sizeof(pnameb));
    SInfo[pID][pLeader] = rang;
    format(str,sizeof(str),"Teammitglied %s hat %s zur Fraktion %d hinzugefügt.",pname,pnameb,rang);
    SendClientMessageToAll(COLOR_GELB,str);
    return 1;
    }
    return Adminbefehl;
    }


    den so:


    dcmd_veh(playerid,params[])
    {
    new Float:vehx,Float:vehy,Float:vehz;
    new vehid,cc1,cc2,string[128];
    if(sscanf(params,"iii",vehid,cc1,cc2))return SendClientMessage(playerid,COLOR_ROT,"[Benutze]: /veh [VehicleID][Farbe1][Farbe2]");
    if(SInfo[playerid][pAdmin] >= 3)
    {
    GetPlayerPos(playerid,vehx,vehy,vehz);
    new carid = CreateVehicle(vehid,vehx,vehy,vehz,3,cc1,cc2,-1);
    SetVehicleNumberPlate(carid,"~>Support<~");
    PutPlayerInVehicle(playerid, carid, 0);
    format(string,sizeof(string),"Du hast ein Admincar gespawnt! (FahrzeugID :%d)",GetVehicleModel(GetPlayerVehicleID(playerid)));
    SendClientMessage(playerid,COLOR_ROT,string);
    PutPlayerInVehicle(playerid, carid, 0);
    SetVehicleHealth(carid ,10000.0);
    }


    return 1;
    }


    und dann brauche ich nochmal den genauen Code von diesen Warnings.

    Code
    C:\Users\Home\Desktop\It's Roleplay v0.1\Neuer Ordner\gamemodes\Selfmade.pwn(3720) : warning 202: number of arguments does not match definition
    C:\Users\Home\Desktop\It's Roleplay v0.1\Neuer Ordner\gamemodes\Selfmade.pwn(3720) : warning 202: number of arguments does not match definition
    C:\Users\Home\Desktop\It's Roleplay v0.1\Neuer Ordner\gamemodes\Selfmade.pwn(3740) : warning 225: unreachable code
  • Ich habe aktuell die Warnings:
    C:\Users\Home\Desktop\It's Roleplay v0.1\Neuer Ordner\pawno\include\md5.inc(92) : warning 219: local variable "str" shadows a variable at a preceding level
    C:\Users\Home\Desktop\It's Roleplay v0.1\Neuer Ordner\gamemodes\Selfmade.pwn(3257) : warning 203: symbol is never used: "params"
    C:\Users\Home\Desktop\It's Roleplay v0.1\Neuer Ordner\gamemodes\Selfmade.pwn(3712) : warning 219: local variable "str" shadows a variable at a preceding level
    C:\Users\Home\Desktop\It's Roleplay v0.1\Neuer Ordner\gamemodes\Selfmade.pwn(3738) : warning 225: unreachable code
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    4 Warnings.


    Zeile 92:
    Include Warning.
    #define DIALOG_SH4 18


    Zeile: 3257:
    (das ist die zeile 3257--->)dcmd_stadthalle(playerid,params[])
    {
    if(IsPlayerInRangeOfPoint(playerid,5.0,1427.4633,-991.8095,1639.7843))
    {
    ShowPlayerDialog(playerid,DIALOG_SH4,DIALOG_STYLE_LIST,"Stadthalle","Personalausweis beantragen\nArbeitslosengeld beantragen","Absenden","Abbrechen");
    }
    else{SendClientMessage(playerid,COLOR_ROT,"Du kannst den Befehl hier nicht benutzen!");}
    return 1;
    }


    Zeile 3712:
    dcmd_setchef(playerid,params[])
    {
    (dass ist die Zeile 3712!!! ---->>>) new pID, rang, pnameb[MAX_PLAYER_NAME], str[128];
    if(sscanf(params,"ui",pID,rang))return SendClientMessage(playerid,COLOR_ROT,"Befehl: /setchef [playerid][Fraktion]");
    if(SInfo[playerid][pAdmin] >= 4)
    {
    GetPlayerName(playerid,pname,sizeof(pname));
    GetPlayerName(pID,pnameb,sizeof(pnameb));
    SInfo[pID][pLeader] = rang;
    format(str,sizeof(str),"Teammitglied %s hat %s zur Fraktion %d hinzugefügt.",pname,pnameb,rang);
    SendClientMessageToAll(COLOR_GELB,str);
    return 1;
    }
    return Adminbefehl;
    }


    Zeile 3738:
    dcmd_settm(playerid,params[])
    {
    new pID, rang, pnameb[MAX_PLAYER_NAME];
    if(sscanf(params,"ui",pID,rang))return SendClientMessage(playerid,COLOR_ROT,"Befehl: /settm [playerid][Rang]");
    if(SInfo[playerid][pAdmin] <= 5)return SendClientMessage(playerid,COLOR_ROT,"Du bist dazu nicht berechtigt.");
    {
    GetPlayerName(playerid,pname,sizeof(pname));
    GetPlayerName(pID,pnameb,sizeof(pnameb));
    SInfo[pID][pAdmin] = rang;
    format(str,sizeof(str),"Administrator %s hat %s zu Adminrang %d befördert.",pname,pnameb,rang);
    SendClientMessageToAll(COLOR_GELB,str);
    return 1;
    }
    (dass ist die Zeile 3738 !!!! ---->>>>) return 1;
    }

  • dann den Befehl so:
    dcmd_stadthalle(playerid,params[])
    {
    #pragma unused params
    if(IsPlayerInRangeOfPoint(playerid,5.0,1427.4633,-991.8095,1639.7843))
    {
    ShowPlayerDialog(playerid,DIALOG_SH4,DIALOG_STYLE_LIST,"Stadthalle","Personalausweis beantragen\nArbeitslosengeld beantragen","Absenden","Abbrechen");
    }
    else{SendClientMessage(playerid,COLOR_ROT,"Du kannst den Befehl hier nicht benutzen!");}
    return 1;
    }


    dcmd_setchef(playerid,params[])
    {
    new pID, rang, pnameb[MAX_PLAYER_NAME], str1254[128];
    if(sscanf(params,"ui",pID,rang))return SendClientMessage(playerid,COLOR_ROT,"Befehl: /setchef [playerid][Fraktion]");
    if(SInfo[playerid][pAdmin] >= 4)
    {
    GetPlayerName(playerid,pname,sizeof(pname));
    GetPlayerName(pID,pnameb,sizeof(pnameb));
    SInfo[pID][pLeader] = rang;
    format(str1254,sizeof(str1254),"Teammitglied %s hat %s zur Fraktion %d hinzugefügt.",pname,pnameb,rang);
    SendClientMessageToAll(COLOR_GELB,str1254);
    return 1;
    }
    return Adminbefehl;
    }


    dcmd_settm(playerid,params[])
    {
    new pID, rang, pnameb[MAX_PLAYER_NAME];
    if(sscanf(params,"ui",pID,rang))return SendClientMessage(playerid,COLOR_ROT,"Befehl: /settm [playerid][Rang]");
    if(SInfo[playerid][pAdmin] <= 5)return SendClientMessage(playerid,COLOR_ROT,"Du bist dazu nicht berechtigt.");
    GetPlayerName(playerid,pname,sizeof(pname));
    GetPlayerName(pID,pnameb,sizeof(pnameb));
    SInfo[pID][pAdmin] = rang;
    format(str,sizeof(str),"Administrator %s hat %s zu Adminrang %d befördert.",pname,pnameb,rang);
    SendClientMessageToAll(COLOR_GELB,str);
    return 1;
    }