Brauche Hilfe bei 3 Errors (tmp,strtok & str...) [HELP] :)

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
  • Guten Abend Leute :)

    Ich habe ein kleines Problem mit einem Bereich des Scriptens, in dem ich mich nicht ganz gut auskenne! ;)

    Fehler:


    Fehlerzeilen:


    Zeile: 226 cmd = strtok(cmdtext, idx);
    Zeile: 227 tmp = strtok(cmdtext, idx);
    Zeile: 235 dini_Create(str);
    Zeile: 246 LadenInfo[i][hLabel] = Create3DTextLabel(str, COLOR_LADENLABEL, LadenInfo[i][hEntrx], LadenInfo[i][hEntry], LadenInfo[i][hEntrz], 20);



    Hier der Code:



    new str[180];
    new cmd[256];
    new tmp[256];
    cmd = strtok(cmdtext, idx);
    tmp = strtok(cmdtext, idx);
    new inttype = strval(tmp);
    if(inttype < 1 || inttype > sizeof(Interiors)) return SendClientMessage(playerid, Rot, "Ungültige Interior ID!");
    inttype -= 1;
    new i = GetLadenID(); if(i == -1) return SendClientMessage(playerid, Rot, "Es kann kein weiterer Waffenladen erstellt werden!");
    format(str, sizeof str, "/Laden/%d.ini", i);
    dini_Create(str);
    LadenInfo[i][hEntrx] = GetX(playerid);
    LadenInfo[i][hEntry] = GetY(playerid);
    LadenInfo[i][hEntrz] = GetZ(playerid);
    LadenInfo[i][hInt] = Interiors[inttype][interiorid];
    LadenInfo[i][hIntx] = Interiors[inttype][intpx];
    LadenInfo[i][hInty] = Interiors[inttype][intpy];
    LadenInfo[i][hIntz] = Interiors[inttype][intpz];
    LadenInfo[i][hIntid] = inttype;
    format(LadenInfo[i][hDescr], 128, "", Interiors[inttype][description]);
    format(str, sizeof str, "%s\nZum Verkauf\nPreis: %d€", LadenInfo[i][hDescr], LadenInfo[i]);
    LadenInfo[i][hLabel] = Create3DTextLabel(str, COLOR_LADENLABEL, LadenInfo[i][hEntrx], LadenInfo[i] [ hEntry], LadenInfo[i][hEntrz], 20);
    LadenInfo[i][hPick] = CreatePickup(1273, 1, LadenInfo[i][hEntrx], LadenInfo[i][hEntry], LadenInfo[i][hEntrz]);
    SendClientMessage(playerid, Grün, "Du hast Erfolgreich einen XXXXXXX erstellt!");
    return 1;



    Die Stocks / Der Stock:


    strtok(const string[], &index)
    {
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
    index++;
    }


    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
    result[index - offset] = string[index];
    index++;
    }
    result[index - offset] = EOS;
    return result;
    }


    stock GetLadenID()
    {
    new str[128];
    for(new i = 0; i<MAX_LADEN; i++)
    {
    format(str, sizeof str, "/Laden/%d.ini", i);
    if(!fexist(str))
    {
    return i;
    }
    }
    return -1;
    }


    stock CreatePickupEx(modelid, spawntype, Float:x, Float:y, Float:z, text[])
    {
    Create3DTextLabel(text, WHITE, x, y, z, 15.0);
    return CreatePickup(modelid, spawntype, x, y, z);
    }


    stock Float:GetX(i)
    {
    new Float:xasdf, Float:yasdf, Float:zasdf;
    GetPlayerPos(i, xasdf, yasdf, zasdf);
    return Float:xasdf;
    }


    stock Float:GetY(i)
    {
    new Float:xasdf, Float:yasdf, Float:zasdf;
    GetPlayerPos(i, xasdf, yasdf, zasdf);
    return yasdf;
    }


    stock Float:GetZ(i)
    {
    new Float:xasdf, Float:yasdf, Float:zasdf;
    GetPlayerPos(i, xasdf, yasdf, zasdf);
    return zasdf;
    }



    Der / Die Enum:


    enum hInfo
    {
    hDescr[50],
    Float:hEntrx,
    Float:hEntry,
    Float:hEntrz,
    Float:hIntx,
    Float:hInty,
    Float:hIntz,
    hInt,
    Text3D:hLabel,
    hPick,
    hIntid,
    }
    new LadenInfo[MAX_LADEN][hInfo];


    enum int_enum
    {
    Float:intpx,
    Float:intpy,
    Float:intpz,
    interiorid,
    description[128]
    }
    new Interiors[][int_enum] ={
    {235.508994 ,1189.169897 ,1080.339966, 4, "XXXXXXXXX 1"},
    {225.756989 ,1240.000000 ,1082.149902, 5, "XXXXXXXXX 2"},
    {223.043991 ,1289.259888 ,1082.199951, 6, "XXXXXXXXX 3"}
    };


    Defines:


    #define MAX_LADEN 25 //Maximale Anzahl an XXXXXXXXXX ;)
    #define COLOR_LADENLABEL 0x1E00FFFF//Farbe der Schrift des Labels am XXXXXXXXXX ! Anpassen ;)


    Das ist alles was mit dem Scriptteil (dem code) zu tun hat ;)


    Ich bedanke mich bei jedem der mir hilft / geholfen hat :love:


    MFG
    Hami aka. Psycho_O ;)