Beiträge von shocK

    Hey


    Habe hier eine /gotocoords Funktion die nie funktioniert.
    Immer wenn ich /gotocoords 300.189880,-1154.397094,81.390960 eingebe, nimmt er nie die Z-Achse mit.
    Z-Achse setzt er immer auf 0. Egal welche coordinaten ich eingebe.
    Was ist falsch daran?


    if(strcmp(cmd,"/gotocoords",true) == 0)
    {
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
    new coordstr[3][24], Float:coords[3];
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_WHITE," /gotocoords X,Y,Z");
    //if(strfind(tmp,",",true) != 0) return SendClientMessage(playerid,COLOR_WHITE," Koordinaten mit Kommata trennen und ohne Leerzeichen!");
    split(tmp,coordstr,',');
    coords[0] = floatstr(coordstr[0]);
    coords[1] = floatstr(coordstr[1]);
    coords[2] = floatstr(coordstr[2]);
    SetPlayerPos(playerid,coords[0],coords[1],coords[2]);
    format(string,sizeof(string)," Erfolgreich teleportiert: X %f Y %f Z %f",coords[0],coords[1],coords[2]);
    SendClientMessage(playerid,COLOR_YELLOW,string);
    }
    return 1;
    }

    Hey
    danke für die Antwort, habe den Fehler gefunden. In der Funktion da drüber war was falsch.
    Habe nun aber eine neue Frage.


    Habe hier eine /gotocoords Funktion die nie funktioniert.
    Immer wenn ich /gotocoords 300.189880,-1154.397094,81.390960 eingebe, nimmt er nie die Z-Achse mit.
    Z-Achse setzt er immer auf 0. EGal welche coordinaten ich eingebe.
    Was ist falsch daran?
    if(strcmp(cmd,"/gotocoords",true) == 0)
    {
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
    new coordstr[3][24], Float:coords[3];
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_WHITE," /gotocoords X,Y,Z");
    //if(strfind(tmp,",",true) != 0) return SendClientMessage(playerid,COLOR_WHITE," Koordinaten mit Kommata trennen und ohne Leerzeichen!");
    split(tmp,coordstr,',');
    coords[0] = floatstr(coordstr[0]);
    coords[1] = floatstr(coordstr[1]);
    coords[2] = floatstr(coordstr[2]);
    SetPlayerPos(playerid,coords[0],coords[1],coords[2]);
    format(string,sizeof(string)," Erfolgreich teleportiert: X %f Y %f Z %f",coords[0],coords[1],coords[2]);
    SendClientMessage(playerid,COLOR_YELLOW,string);
    }
    return 1;
    }

    Hallo
    ich bekomme jedes mal beim compilen in dieser funktion ein error


    Error:


    Code
    C:\Users\Main\Desktop\Neues Verzeichnis\gamemodes\Release.pwn(33669) : warning 225: unreachable code


    Funktion:


    if(strcmp(cmd, "/gethere", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Benutzung: /gethere [Spieler ID]");
    return 1;
    }
    new Float:plocx,Float:plocy,Float:plocz;
    new plo;
    plo = ReturnUser(tmp);
    if (IsPlayerConnected(plo))
    {
    if(plo != INVALID_PLAYER_ID)
    {
    if (PlayerInfo[playerid][pAdmin] >= 3)
    {
    GetPlayerPos(playerid, plocx, plocy, plocz);
    if (GetPlayerState(plo) == 2)
    {
    TelePos[plo][0] = 0.0;
    TelePos[plo][1] = 0.0;
    new tmpcar = GetPlayerVehicleID(plo);
    SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
    }
    else
    {
    SetPlayerPos(plo,plocx,plocy+2, plocz);
    }
    PlayerInfo[plo][pLocal] = PlayerInfo[playerid][pLocal];
    PlayerInfo[plo][pInt] = PlayerInfo[playerid][pInt];
    SetPlayerInterior(plo,PlayerInfo[playerid][pInt]);
    SetPlayerVirtualWorld(plo,GetPlayerVirtualWorld(playerid));
    SendClientMessage(plo, COLOR_GRAD1, "Du wurdest Teleportiert");
    GetPlayerName(plo, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s hat %s zu sich geportet.", sendername, giveplayer);
    ABroadCast(0x00F5FFFF,string,4);
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Du bist nicht befugt!");
    }
    }
    }
    else
    {
    format(string, sizeof(string), "%d ist kein Aktiver Spieler.", plo);
    SendClientMessage(playerid, COLOR_GRAD1, string);
    }
    }
    return 1;
    }


    Ich weiß echt nicht mehr weiter. was habe ich falsch gemacht?
    Hoffe mir kann jemand helfen.


    Lg
    shocK