Klammerfehler?

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
  • Wo ist hier der Fehler?


    omcd:votekick(playerid,params[])
    {
    if(votekick == 0)
    {
    new pID,pIDname[MAX_PLAYER_NAME],name[MAX_PLAYER_NAME],progress,message[128],message2[128];
    if(sscanf(params,"i",pID))return SendClientMessage(playerid,red,"Usage: /votekick [ID]");
    if(!IsPlayerConnected(pID))return SendClientMessage(playerid,red,"This player isn't online!");
    votekick = 1;
    progress = (OnlinePlayers*0.75)-1;
    format(message,sizeof(message),"%s (%i) wants to kick %s (%i) from the server!",name,playerid,pIDname,pID);
    format(message2,sizeof(message2),"Type /accept to support him. He needs only %i more supporters!",progress);
    SendClientMessageToAll(orange,message);
    SendClientMessageToAll(orange,message2);
    SetTimer{"votekickTimer",30000,false};
    return 1;
    }
    else return SendClientMessage(playerid,red,"Please wait until the lastet votekick ends!");
    }


    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\pawno\include\YSI\y_hooks/impl.inc(225) : warning 219: local variable "name" shadows a variable at a preceding level
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\pawno\include\sscanf2.inc(199) : warning 219: local variable "name" shadows a variable at a preceding level
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(5264) : warning 219: local variable "name" shadows a variable at a preceding level
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8171) : warning 219: local variable "pID" shadows a variable at a preceding level
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8172) : warning 219: local variable "name" shadows a variable at a preceding level
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8183) : warning 219: local variable "pID" shadows a variable at a preceding level
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8183) : warning 219: local variable "name" shadows a variable at a preceding level
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8183) : warning 219: local variable "pIDname" shadows a variable at a preceding level
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8183) : warning 219: local variable "message" shadows a variable at a preceding level
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8196) : error 021: symbol already defined: "votekick"
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8198) : error 010: invalid function or declaration
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8201) : error 010: invalid function or declaration
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8202) : error 010: invalid function or declaration
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8210) : error 010: invalid function or declaration
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8212) : error 010: invalid function or declaration
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8239) : warning 219: local variable "name" shadows a variable at a preceding level
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8267) : warning 219: local variable "name" shadows a variable at a preceding level
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(10047) : warning 203: symbol is never used: "message"

  • Versuch es mal so:

    omcd:votekick(playerid,params[])
    {
    if(votekick == 0)
    {
    new pID,pIDname[MAX_PLAYER_NAME],name[MAX_PLAYER_NAME],progress,message[128],message2[128];
    if(sscanf(params,"i",pID))return SendClientMessage(playerid,red,"Usage: /votekick [ID]");
    if(!IsPlayerConnected(pID))return SendClientMessage(playerid,red,"This player isn't online!");
    votekick = 1;
    progress = (OnlinePlayers*0.75)-1;
    format(message,sizeof(message),"%s (%i) wants to kick %s (%i) from the server!",name,playerid,pIDname,pID);
    format(message2,sizeof(message2),"Type /accept to support him. He needs only %i more supporters!",progress);
    SendClientMessageToAll(orange,message);
    SendClientMessageToAll(orange,message2);
    SetTimer{"votekickTimer",30000,false};
    return 1;
    }
    else
    {
    SendClientMessage(playerid,red,"Please wait until the lastet votekick ends!");
    }
    return 1;
    }

    :) SWAGETTI & YOLONAISE!


  • Geht nicht :/

  • Beim SetTimer hast du {} anstatt () ;)


    Danke, dass hat schon mal einiges gebracht :)


    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\pawno\include\YSI\y_hooks/impl.inc(225) : warning 219: local variable "name" shadows a variable at a preceding level
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\pawno\include\sscanf2.inc(199) : warning 219: local variable "name" shadows a variable at a preceding level
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(5264) : warning 219: local variable "name" shadows a variable at a preceding level
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8171) : warning 219: local variable "pID" shadows a variable at a preceding level
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8172) : warning 219: local variable "name" shadows a variable at a preceding level
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8183) : warning 219: local variable "pID" shadows a variable at a preceding level
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8183) : warning 219: local variable "name" shadows a variable at a preceding level
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8183) : warning 219: local variable "pIDname" shadows a variable at a preceding level
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8183) : warning 219: local variable "message" shadows a variable at a preceding level
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8196) : error 021: symbol already defined: "votekick"
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8198) : error 010: invalid function or declaration
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8201) : error 010: invalid function or declaration
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8202) : error 010: invalid function or declaration
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8210) : error 010: invalid function or declaration
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8212) : error 010: invalid function or declaration
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8239) : warning 219: local variable "name" shadows a variable at a preceding level
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(8267) : warning 219: local variable "name" shadows a variable at a preceding level
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(10047) : warning 203: symbol is never used: "message"
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(10047) : warning 203: symbol is never used: "message2"
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(10047) : warning 203: symbol is never used: "name"
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(10047) : warning 203: symbol is never used: "pID"
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(10047) : warning 203: symbol is never used: "pIDname"
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(10047) : warning 203: symbol is never used: "progress"
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(10047) : warning 203: symbol is never used: "pvotekick"
    D:\Dokumente\GTA\Server\Meine Server\B.A.S.E. Jump Server\Server\gamemodes\BASE.pwn(10047) : warning 203: symbol is never used: "votekick"


    "warning 203" ist mir klar, der cmd ist noch nicht fertig, aber "warning 219" versteh ich nicht, wo kann ich gegen diesen warning fehler suchen ?