Was daran Falsch?

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
  • ES GEHT DANKE!


    //Edit neues Problem:


    Spoiler anzeigen

    //-------------------------unter den inc´s----------------------------------------------
    new taxi;
    new police;
    new grenze1;
    new grenze2;
    //-------------------------Gamemodeinit-----------------------------------------------
    taxi = CreatePickup(1239,1,1222.9181,-1813.6516,16.5938); //
    police = CreatePickup(1239,1,1546.4486,-1669.8274,13.4116); //
    grenze1 = CreatePickup(1239,1,-24.0678,-1333.3757,11.1286); //
    grenze2 = CreatePickup(1239,1,-87.5484,-1422.0962,12.5980); //

    //-------------------------commandtextblabla-----------------------------------------
    if (strcmp("/job1", cmdtext, true) == 0)//TAXI FAHRER
    {
    if(PlayerToPoint(3.0, playerid, 1222.9181,-1813.6516,16.5938))
    {
    }
    gTeam[playerid]=TEAM_TAXI;
    SetPlayerSkin(playerid, 60);
    SetPlayerHealth(playerid, 100);
    SendClientMessage(playerid,0x00FF00FF,"Du hast den Job :Taxi Fahrer angenommen.");
    }
    return 1;
    }

    if (strcmp("/job2", cmdtext, true) == 0)// POLIZEI
    {
    if(PlayerToPoint(3.0, playerid, 1546.4486,-1669.8274,13.4116))
    {
    }
    gTeam[playerid]=TEAM_POLICE;
    SetPlayerSkin(playerid, 280);
    SetPlayerHealth(playerid, 100);
    SendClientMessage(playerid,0x00FF00FF,"Du hast den Job Polizist angenommen.");
    }
    return 1;
    }

    Spoiler anzeigen
    if (strcmp("/job3", cmdtext, true) == 0)// GRÄNZENWACHTER
    {
    if(PlayerToPoint(3.0, playerid, -24.0678,-1333.3757,11.1286) || PlayerToPoint(3.0, playerid, -87.5484,-1422.0962,12.5980 ))
    {
    }
    gTeam[playerid]=TEAM_GRENZE;
    SetPlayerSkin(playerid, 61);
    SetPlayerHealth(playerid, 100);
    SendClientMessage(playerid,0x00FF00FF,"Du hast den Job :Grenzenwächter angenommen.");
    }
    return 1;
    }


    Diese Commands Funktionieren nicht -_-


    Wenn ich z.B in den Pickup geh und /job1 mach dann passiert nichts!

    2 Mal editiert, zuletzt von [psc]Tuner[pwn] ()

  • Probs mal so:


    if (strcmp("/job1", cmdtext, true) == 0)//TAXI FAHRER
    {
    if(PlayerToPoint(3.0, playerid, 1222.9181,-1813.6516,16.5938))
    {
    gTeam[playerid]=TEAM_TAXI;
    SetPlayerSkin(playerid, 60);
    SetPlayerHealth(playerid, 100);
    SendClientMessage(playerid,0x00FF00FF,"Du hast den Job :Taxi Fahrer angenommen.");
    }
    return 1;
    }


    if (strcmp("/job2", cmdtext, true) == 0)// POLIZEI
    {
    if(PlayerToPoint(3.0, playerid, 1546.4486,-1669.8274,13.4116))
    {
    gTeam[playerid]=TEAM_POLICE;
    SetPlayerSkin(playerid, 280);
    SetPlayerHealth(playerid, 100);
    SendClientMessage(playerid,0x00FF00FF,"Du hast den Job Polizist angenommen.");
    }
    return 1;
    }


    if (strcmp("/job3", cmdtext, true) == 0)// GRÄNZENWACHTER
    {
    if(PlayerToPoint(3.0, playerid, -24.0678,-1333.3757,11.1286) || PlayerToPoint(3.0, playerid, -87.5484,-1422.0962,12.5980 ))
    {
    gTeam[playerid]=TEAM_GRENZE;
    SetPlayerSkin(playerid, 61);
    SetPlayerHealth(playerid, 100);
    SendClientMessage(playerid,0x00FF00FF,"Du hast den Job :Grenzenwächter angenommen.");
    }
    return 1;
    }

    Sie brauchen Hilfe bei Linux oder Windows Servern? Wissen nicht, wie man am besten ein Forum o. a. installiert? Dann schreiben Sie mir eine PN und ich versuche Ihnen zu helfen!

  • //-------------------------unter den inc´s----------------------------------------------
    new taxi;
    new police;
    new grenze1;
    new grenze2;




    Statt dem oberen dies:


    //-------------------------unter den inc´s----------------------------------------------
    new TEAM_TAXI;
    new TEAM_POLICE;
    new TEAM_GRENZE1;
    new TEAM_GRENZE2;

  • geht nicht da kommen wieder 26 errors klammerfehler !


    HIer mal mein ganzes public OnPlayerCommandText(playerid, cmdtext[])

    Spoiler anzeigen
    public OnPlayerCommandText(playerid, cmdtext[])
    {
    //----------------------------------------------------------------------------------------------- REGISTER SYSTEM ANFANG------------------
    new cmd[256];
    new idx;
    cmd = strtok(cmdtext, idx);
    new tmp[256];
    new playername[MAX_PLAYER_NAME];
    if (strcmp(cmd, "/login", true) ==0 )
    {
    if(IsPlayerConnected(playerid))
    {
    new tmppass[64];
    if(gPlayerLogged[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_GREY, " Du bist bereits eingeloggt.");
    return 1;
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GREY, " Benutze: /login [password]");
    return 1;
    }
    strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
    Encrypt(tmppass);
    OnPlayerLogin(playerid,tmppass);
    }
    return 1;
    }

    if (strcmp(cmd, "/register", true)==0)
    {
    new string[265];
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GREY, "Benutze: /register [password]");
    return 1;
    }
    if (gPlayerAccount[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_GREY, "Der Name ist bereits registriert");
    return 1;
    }
    strmid(PlayerInfo[playerid][pPassword], tmp, 0, strlen(cmdtext), 255);
    Encrypt(PlayerInfo[playerid][pPassword]);
    GetPlayerName(playerid, playername, sizeof(playername));
    format(string, sizeof(string), "PRT-GAMEMODE-USERS/%s.ini", playername);
    new File: file = fopen(string, io_read);
    if (file)
    {
    SendClientMessage(playerid, COLOR_GREY, "Der Name ist bereits registriert");
    fclose(file);
    return 1;
    }
    new File:hFile;
    hFile = fopen(string, io_append);
    new var[32];//
    format(var, 32, "%s\n", PlayerInfo[playerid][pPassword]);fwrite(hFile, var);
    format(var, 32, "Kills=%d\n",PlayerInfo[playerid][pKills]);fwrite(hFile, var);
    format(var, 32, "Deaths=%d\n",PlayerInfo[playerid][pDeaths]);fwrite(hFile, var);
    PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
    format(var, 32, "Money=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);
    fclose(hFile);
    SendClientMessage(playerid, COLOR_WHITE, "Erfolgreich registriert!");
    SendClientMessage(playerid, COLOR_WHITE, "Gebe nächstes mal /login <password> zum einloggen ein.");
    OnPlayerLogin(playerid,PlayerInfo[playerid][pPassword]);
    return 1;
    }

    if (strcmp(cmd, "/stats", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if (gPlayerLogged[playerid] != 0)
    {
    ShowStats(playerid,playerid);
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, " Du bist nicht eingeloggt !");
    }
    }
    return 1;
    }
    //-------------commmands------------------------------------------------------------------------- REGISTER SYSTEM ENDE--------------------
    if(strcmp("/commands",cmdtext,true) == 0)
    {
    SendClientMessage(playerid,0x00FF00FF,"___________Alle Commands___________");
    SendClientMessage(playerid,0x00FF00FF,"Zum Registrieren /register , Zum Einloggen /login ,Für Afk /afk - /back .");
    SendClientMessage(playerid,0x00FF00FF,"Um einen Job anzunehmen /job[NR], Um DEN Job zu kündigen * /job kündigen *. ");
    if(gTeam[playerid] == TEAM_POLICE)
    {
    SendClientMessage(playerid,0x00FF00FF,"___________Cop Commands___________");
    SendClientMessage(playerid,0x00FF00FF,"LSPD GATE Öffnen /pdopen, Um einen Wanted zu geben /su [ID]");
    SendClientMessage(playerid,0x00FF00FF,"Um zum LSPD zu kommen /copbase ");
    }
    if(gTeam[playerid] == TEAM_MAFIA)
    {
    SendClientMessage(playerid,0x00FF00FF,"___________Mafia Commands___________");
    SendClientMessage(playerid,0x00FF00FF,"Um zum Mafia HQ zu kommen /Mafia");
    }
    if(gTeam[playerid] == TEAM_TAXI)
    {
    SendClientMessage(playerid,0x00FF00FF,"___________Taxi Fahrer Commands___________");
    SendClientMessage(playerid,0x00FF00FF,"Um zum Taxi HQ zu kommen /Taxi");
    }
    return 1;
    }
    //-----------------------------------------NORMALE COMMANDS DER JEDER SUFÜHREN KANN-----------------------------------
    new pname[MAX_PLAYER_NAME];
    new string[100];
    new ziel = strval(strget(cmdtext,1));
    if (strcmp("/afk", cmdtext, true) == 0)
    {
    TogglePlayerControllable(playerid, false);
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "%s ist AFK! (/afk)", pname);
    SendClientMessageToAll(0xff3333ff, string);
    return 1;
    }

    Spoiler anzeigen
    // Teil 2 folgt!



    MfG The_Gamer



    SCHREIBT MAL BITTE JEMAND WAS


  • public OnPlayerCommandText(playerid, cmdtext[])
    {
    //----------------------------------------------------------------------------------------------- REGISTER SYSTEM ANFANG------------------
    new cmd[256];
    new idx;
    cmd = strtok(cmdtext, idx);
    new tmp[256];
    new playername[MAX_PLAYER_NAME];
    if (strcmp(cmd, "/login", true) ==0 )
    {
    if(IsPlayerConnected(playerid))
    {
    new tmppass[64];
    if(gPlayerLogged[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_GREY, " Du bist bereits eingeloggt.");
    return 1;
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GREY, " Benutze: /login [password]");
    return 1;
    }
    strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
    Encrypt(tmppass);
    OnPlayerLogin(playerid,tmppass);
    }
    return 1;
    }

    if (strcmp(cmd, "/register", true)==0)
    {
    new string[265];
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GREY, "Benutze: /register [password]");
    return 1;
    }
    if (gPlayerAccount[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_GREY, "Der Name ist bereits registriert");
    return 1;
    }
    strmid(PlayerInfo[playerid][pPassword], tmp, 0, strlen(cmdtext), 255);
    Encrypt(PlayerInfo[playerid][pPassword]);
    GetPlayerName(playerid, playername, sizeof(playername));
    format(string, sizeof(string), "PRT-GAMEMODE-USERS/%s.ini", playername);
    new File: file = fopen(string, io_read);
    if (file)
    {
    SendClientMessage(playerid, COLOR_GREY, "Der Name ist bereits registriert");
    fclose(file);
    return 1;
    }
    new File:hFile;
    hFile = fopen(string, io_append);
    new var[32];//
    format(var, 32, "%s\n", PlayerInfo[playerid][pPassword]);fwrite(hFile, var);
    format(var, 32, "Kills=%d\n",PlayerInfo[playerid][pKills]);fwrite(hFile, var);
    format(var, 32, "Deaths=%d\n",PlayerInfo[playerid][pDeaths]);fwrite(hFile, var);
    PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
    format(var, 32, "Money=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);
    fclose(hFile);
    SendClientMessage(playerid, COLOR_WHITE, "Erfolgreich registriert!");
    SendClientMessage(playerid, COLOR_WHITE, "Gebe nächstes mal /login <password> zum einloggen ein.");
    OnPlayerLogin(playerid,PlayerInfo[playerid][pPassword]);
    return 1;
    }

    if (strcmp(cmd, "/stats", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if (gPlayerLogged[playerid] != 0)
    {
    ShowStats(playerid,playerid);
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, " Du bist nicht eingeloggt !");
    }
    }
    return 1;
    }
    //-------------commmands------------------------------------------------------------------------- REGISTER SYSTEM ENDE--------------------
    if(strcmp("/commands",cmdtext,true) == 0)
    {
    SendClientMessage(playerid,0x00FF00FF,"___________Alle Commands___________");
    SendClientMessage(playerid,0x00FF00FF,"Zum Registrieren /register , Zum Einloggen /login ,Für Afk /afk - /back .");
    SendClientMessage(playerid,0x00FF00FF,"Um einen Job anzunehmen /job[NR], Um DEN Job zu kündigen * /job kündigen *. ");
    }
    if(gTeam[playerid] == TEAM_POLICE)
    {
    SendClientMessage(playerid,0x00FF00FF,"___________Cop Commands___________");
    SendClientMessage(playerid,0x00FF00FF,"LSPD GATE Öffnen /pdopen, Um einen Wanted zu geben /su [ID]");
    SendClientMessage(playerid,0x00FF00FF,"Um zum LSPD zu kommen /copbase ");
    }
    if(gTeam[playerid] == TEAM_MAFIA)
    {
    SendClientMessage(playerid,0x00FF00FF,"___________Mafia Commands___________");
    SendClientMessage(playerid,0x00FF00FF,"Um zum Mafia HQ zu kommen /Mafia");
    }
    if(gTeam[playerid] == TEAM_TAXI)
    {
    SendClientMessage(playerid,0x00FF00FF,"___________Taxi Fahrer Commands___________");
    SendClientMessage(playerid,0x00FF00FF,"Um zum Taxi HQ zu kommen /Taxi");
    }
    return 1;
    }
    //-----------------------------------------NORMALE COMMANDS DER JEDER SUFÜHREN KANN-----------------------------------
    new pname[MAX_PLAYER_NAME];
    new string[100];
    new ziel = strval(strget(cmdtext,1));
    if (strcmp("/afk", cmdtext, true) == 0)
    {
    TogglePlayerControllable(playerid, false);
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "%s ist AFK! (/afk)", pname);
    SendClientMessageToAll(0xff3333ff, string);
    return 1;
    }