Hilfe ich versteh mein Script nicht mehr

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 habe ein Menu und Teleporations Script geschrieben und versteh nicht mehr warum es nicht geht hab schon einige fehler behoben. :cursing:


    Es ist mein erstes Script




    #include <a_samp>



    public OnPlayerConnect(playerid)
    {
    SendPlayerMessage(playerid,"/commmands für die Befehle");


    return 1;
    }


    public OnPlayerCommandText(playerid, cmdtext[])


    if(strcmp(cmdtext, "/stunt", true) == 0)
    {
    SetPlayerPos(playerid, -2475.3152,-976.7531,998.5547);
    GameTextForPlayer(playerid, "Wilkomen auf dem Airport in San Fierro");
    return 1;
    }
    if(strcmp(cmdtext, "/tdm", true) == 0)
    {
    SetPlayerPos(playerid, -1549.9721,-433.7722,6.0325);
    GameTextForPlayer(playerid, "Du bist jetzt Auserhalb des Airports");
    return 1;
    }


    if(strcmp(cmdtext, "/worker", true) == 0)
    {
    SetPlayerPos(playerid, -2062.0009,237.6350,35.6760);
    return 1;
    }


    if(strcmp(cmdtext, "/pimp", true) == 0)
    {
    SetPlayerPos(playerid, -2653.9995,1388.2767,7.1315);
    return 1;
    }


    if(strcmp(cmdtext, "/golfer", true) == 0)
    {
    SetPlayerPos(playerid, -2642.6137,-274.9985,7.5364);
    return 1;
    }


    if(strcmp(cmdtext, "/triade", true) == 0)
    {
    SetPlayerPos(playerid, -2157.5673,649.5484,52.3671);
    return 1;
    }


    if(strcmp(cmdtext, "/mechanik", true) == 0)
    {
    SetPlayerPos(playerid, -1377.7827,466.0896,7.1875);
    return 1;
    }


    if(strcmp(cmdtext, "/valet", true) == 0)
    {
    SetPlayerPos(playerid, -1755.4720,958.2040,24.8828);
    return 1;
    }


    if(strcmp(cmdtext, "/medic", true) == 0)
    {
    SetPlayerPos(playerid, -2665.7836,635.6348,14.4531);
    return 1;
    }


    if(strcmp(cmdtext, "/fbi", true) == 0)
    {
    SetPlayerPos(playerid, -1635.7287,664.8098,7.1875);
    return 1;
    }




    {
    new cmd[256],idx;
    cmd = strtok(cmdtext,idx);
    if(!strcmp(cmdtext,"/befehle",true))
    {
    SendClientMessage(playerid,"/teleports für Teleportationen");
    SendClientMessage(playerid,"/rules für die Regeln");
    SendClientMessage(playerid,"/cars für getunte autos");


    return 1;
    }


    {
    new cmd[256],idx;
    cmd = strtok(cmdtext,idx);
    if(!strcmp(cmdtext,"/teleports",true))
    {
    SendClientMessage(playerid,"/stunt für die Stuntzone");
    SendClientMessage(playerid,"/tdm um wieder in die Tdm zu kommen");
    SendClientMessage(playerid,"/worker für den spawnpoint der Worker");
    SendClientMessage(playerid,"/pimp für den spawnpoint der Pimper");
    SendClientMessage(playerid,"/golfer für den spawnpoint der Golfer");
    SendClientMessage(playerid,"/triade für den spawnpoint der Triade");
    SendClientMessage(playerid,"/mechanik für den spawnpoint der Mechaniker");
    SendClientMessage(playerid,"/valet für den spawnpoint der Valet");
    SendClientMessage(playerid,"/medic für den spawnpoint der Medic");
    SendClientMessage(playerid,"/fbi für den spawnpoint der Fbi");


    return 1;
    }
    public OnFilterScriptExit()
    {
    return 1;
    }
    {
    #endif



  • Oh sorry für den Fehler 1. es startet garnicht und als ich es verändert hab so wie es jetzt ist kommt beim compiler


    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(6) : error 017: undefined symbol "SendPlayerMessage"
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(16) : warning 202: number of arguments does not match definition
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(16) : warning 202: number of arguments does not match definition
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(19) : warning 209: function "OnPlayerCommandText" should return a value
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(19) : error 010: invalid function or declaration
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(23) : error 010: invalid function or declaration
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(26) : error 010: invalid function or declaration
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(29) : error 010: invalid function or declaration
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(32) : error 010: invalid function or declaration
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(35) : error 010: invalid function or declaration
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(38) : error 010: invalid function or declaration
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(41) : error 010: invalid function or declaration
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(44) : error 010: invalid function or declaration
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(47) : error 010: invalid function or declaration
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(50) : error 010: invalid function or declaration
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(53) : error 010: invalid function or declaration
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(56) : error 010: invalid function or declaration
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(59) : error 010: invalid function or declaration
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(62) : error 010: invalid function or declaration
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(65) : error 010: invalid function or declaration
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(68) : error 010: invalid function or declaration
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(71) : error 010: invalid function or declaration
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(76) : error 055: start of function body without function header
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(78) : error 010: invalid function or declaration
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(79) : error 010: invalid function or declaration
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(85) : error 010: invalid function or declaration
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(88) : error 055: start of function body without function header
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(89) : error 021: symbol already defined: "cmd"
    C:\DOKUME~1\CHRIST~1\Desktop\GTASAM~1\SAMPSE~1\FILTER~1\MEN_TE~1.PWN(89) : error 021: symbol already defined: "idx"


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



    26 Errors.

  • wieso if(!strcmp(cmdtext,"/teleports",true))


    mach if(strcmp(cmdtext,"/teleports",true))


    also ohne "!"

  • Ich trau mich gar nicht zu fragen wo du das gelernt hast.

    #include <a_samp>


    public OnPlayerConnect(playerid)
    {
    SendClientMessage(playerid, /*Color*/, "/commmands für die Befehle");
    return 1;
    }


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    new cmd[256],idx;
    cmd = strtok(cmdtext,idx);

    if(strcmp(cmdtext, "/stunt", true) == 0)
    {
    SetPlayerPos(playerid, -2475.3152,-976.7531,998.5547);
    GameTextForPlayer(playerid, "Wilkomen auf dem Airport in San Fierro", 3000, 3);
    return 1;
    }

    if(strcmp(cmdtext, "/tdm", true) == 0)
    {
    SetPlayerPos(playerid, -1549.9721,-433.7722,6.0325);
    GameTextForPlayer(playerid, "Du bist jetzt Auserhalb des Airports", 3000, 3);
    return 1;
    }


    if(strcmp(cmdtext, "/worker", true) == 0) return SetPlayerPos(playerid, -2062.0009,237.6350,35.6760);
    if(strcmp(cmdtext, "/pimp", true) == 0) return SetPlayerPos(playerid, -2653.9995,1388.2767,7.1315);
    if(strcmp(cmdtext, "/golfer", true) == 0) return SetPlayerPos(playerid, -2642.6137,-274.9985,7.5364);
    if(strcmp(cmdtext, "/triade", true) == 0) return SetPlayerPos(playerid, -2157.5673,649.5484,52.3671);
    if(strcmp(cmdtext, "/mechanik", true) == 0) return SetPlayerPos(playerid, -1377.7827,466.0896,7.1875);
    if(strcmp(cmdtext, "/valet", true) == 0) return SetPlayerPos(playerid, -1755.4720,958.2040,24.8828);
    if(strcmp(cmdtext, "/medic", true) == 0) return SetPlayerPos(playerid, -2665.7836,635.6348,14.4531);
    if(strcmp(cmdtext, "/fbi", true) == 0) return SetPlayerPos(playerid, -1635.7287,664.8098,7.1875);


    if(!strcmp(cmdtext,"/befehle",true))
    {
    SendClientMessage(playerid, /*Color*/, "/teleports für Teleportationen");
    SendClientMessage(playerid, /*Color*/, "/rules für die Regeln");
    SendClientMessage(playerid, /*Color*/, "/cars für getunte autos");
    return 1;
    }

    if(!strcmp(cmdtext,"/teleports",true))
    {
    SendClientMessage(playerid, /*Color*/, "/stunt für die Stuntzone");
    SendClientMessage(playerid, /*Color*/, "/tdm um wieder in die Tdm zu kommen");
    SendClientMessage(playerid, /*Color*/, "/worker für den spawnpoint der Worker");
    SendClientMessage(playerid, /*Color*/, "/pimp für den spawnpoint der Pimper");
    SendClientMessage(playerid, /*Color*/, "/golfer für den spawnpoint der Golfer");
    SendClientMessage(playerid, /*Color*/, "/triade für den spawnpoint der Triade");
    SendClientMessage(playerid, /*Color*/, "/mechanik für den spawnpoint der Mechaniker");
    SendClientMessage(playerid, /*Color*/, "/valet für den spawnpoint der Valet");
    SendClientMessage(playerid, /*Color*/, "/medic für den spawnpoint der Medic");
    SendClientMessage(playerid, /*Color*/, "/fbi für den spawnpoint der Fbi");
    return 1;
    }
    return 0;
    }