[SAMMELTHREAD] Kleine Scripting Fragen

Dein Problem konnte durch einen User gelöst werden? Bedank dich bei ihm indem du seinen Beitrag als Hilfreich markierst sowie einen Daumen oben dalässt
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
  • Die Variable "Haus" wird bei dir ja auf ein enum zu greifen.
    Könntest du dieses mal bitte hier schicken?
    MfG


    enum Hauser
    {
    Float:hX, //Haus-X Koordinate
    Float:hY, //Haus-Y Koordinate
    Float:hZ, //Haus-Z Koordinate
    Float:iX, //Int-X Koordinate
    Float:iY, //Int-Y Koordinate
    Float:iZ, //Int-Z Koordinate
    hBesitzer[MAX_PLAYER_NAME], //Besitzer
    hBeschreibung[MaxHausBeschreibung], //Beschreibung
    hLevel, //Hauslevel
    hZimmerA, //Aktuelle Zimmer
    hZimmerM, //Maximale Zimmer
    hInteriorID,//InteriorID
    hPreis, //Hauspreis
    hID, //HausID
    hPickup, //HausPickup
    hMapIcon,//Map Icon
    hMietbar,//Mietbar
    hMietpreis,//Mietpreis
    Text3D:hText //Haus3D-Text*/
    };
    new Haus[MaxHaus][Hauser];



    Jeffry

    Mit freundlichen Grüßen
    [KoSoVa] :klugs:

    2 Mal editiert, zuletzt von [KoSoVa] ()

  • Beitrag von TheOneBehindYou1 ()

    Dieser Beitrag wurde gelöscht, Informationen über den Löschvorgang sind nicht verfügbar.
  • wie bekomme ich es hin das es so ausschaut?


    if (strcmp(cmd, "/ot", true) == 0)
    {
    new str[512];
    if(ReturnPlayerID("Basti") != INVALID_PLAYER_ID) format(str, sizeof(str), "%s{00FF00}Spieler Basti ist Online\n", str);
    else format(str, sizeof(str), "%s{FF0000}Spieler Basti ist Offline\n", str);
    if(ReturnPlayerID("Hansi") != INVALID_PLAYER_ID) format(str, sizeof(str), "%s{00FF00}Spieler Hansi ist Online\n", str);
    else format(str, sizeof(str), "%s{FF0000}Spieler Hansi ist Offline\n", str);
    if(ReturnPlayerID("Ulli") != INVALID_PLAYER_ID) format(str, sizeof(str), "%s{00FF00}Spieler Ulli ist Online\n", str);
    else format(str, sizeof(str), "%s{FF0000}Spieler Ulli ist Offline\n", str);
    return ShowPlayerDialog(playerid, 4521, DIALOG_STYLE_MSGBOX, "Spieler", str, "Ok");
    }


    Oder eben:
    if (strcmp(cmd, "/ot", true) == 0)
    {
    new str[512];
    if(ReturnPlayerID("Basti") != INVALID_PLAYER_ID) format(str, sizeof(str), "%s{FFFFFF}Basti - {00FF00}Online\n", str);
    else format(str, sizeof(str), "%s{FFFFFF}Basti - {FF0000}Offline\n", str);
    if(ReturnPlayerID("Hansi") != INVALID_PLAYER_ID) format(str, sizeof(str), "%s{FFFFFF}Hansi - {00FF00}Online\n", str);
    else format(str, sizeof(str), "%s{FFFFFF}Hansi - {FF0000}Offline\n", str);
    if(ReturnPlayerID("Ulli") != INVALID_PLAYER_ID) format(str, sizeof(str), "%s{FFFFFF}Ulli - {00FF00}Online\n", str);
    else format(str, sizeof(str), "%s{FFFFFF}Ulli - {FF0000}Offline\n", str);
    return ShowPlayerDialog(playerid, 4521, DIALOG_STYLE_MSGBOX, "Spieler", str, "Ok");
    }

  • In Pseudo-Code:
    GFirmaInfo[gfirma][firmenname] = OrgInfo[Spieler[playerid][OrgID]][orgname];


    Er packt OrgInfo[Spieler[playerid][OrgID]][orgname] in die GFirmaInfo[gfirma][firmenname] Variable.


    Man könnte es auch so schreiben:
    format(GFirmaInfo[gfirma][firmenname],64,OrgInfo[Spieler[playerid][OrgID]][orgname]);
    oder:
    format(GFirmaInfo[gfirma][firmenname],64,"%s",OrgInfo[Spieler[playerid][OrgID]][orgname]);


    Wie du willst.

  • Woher kommt der?
    [18:51:21] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE FROM db_firmagrundstuck SET `firmenid` = '-1', igekauft =", callback: "(null)", format: "(null)"
    [18:51:21] [DEBUG] CMySQLQuery::Execute[] - starting query execution
    [18:51:21] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM db_firmagrundstuck SET `firmenid` = '-1', igekauft = '1', firmenname = 'Cry' at line 1
    [18:51:21] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError
    [18:51:21] [DEBUG] Calling callback "OnQueryError"..

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • oneText[playerid] = CreatePlayerTextDraw(playerid,497.333496, 173.392700, "Kills: 31 Tode: 69");
    PlayerTextDrawBackgroundColor(playerid,oneText[playerid], 51);
    PlayerTextDrawFont(playerid,oneText[playerid], 1);
    PlayerTextDrawLetterSize(playerid,oneText[playerid], 0.310000, 1.600000);
    PlayerTextDrawColor(playerid,oneText[playerid], -1);
    PlayerTextDrawSetOutline(playerid,oneText[playerid], 1);
    PlayerTextDrawSetProportional(playerid,oneText[playerid], 1);
    PlayerTextDrawSetShadow(playerid,oneText[playerid], 0);


    Textdraw0[playerid] = CreatePlayerTextDraw(playerid, 546.000183, 24.888887, "EXP: 0 / 0");
    PlayerTextDrawBackgroundColor(playerid,Textdraw0[playerid], 51);
    PlayerTextDrawFont(playerid,Textdraw0[playerid], 1);
    PlayerTextDrawLetterSize(playerid,Textdraw0[playerid], 0.234666, 1.222518);
    PlayerTextDrawColor(playerid,Textdraw0[playerid], -1);
    PlayerTextDrawSetOutline(playerid,Textdraw0[playerid], 1);
    PlayerTextDrawSetProportional(playerid,Textdraw0[playerid], 1);


    Wenn ich "oneText" unter Textdraw0 habe, dann wird Textdraw0 nicht mehr angezeigt. Anders rum genau so.
    Es wird also immer irgendwie nur eins angezeigt.


    An sich sollte das Ganze "PlayerTextDrawShow" richtig sein.

  • Möglicherweise hast du irgendwo im Code einen Fehler, der das PlayerTextDraw mit der ID 0 löscht.


    oneText[playerid] = CreatePlayerTextDraw(playerid,497.333496, 173.392700, "Kills: 31 Tode: 69");
    zu:
    CreatePlayerTextDraw(playerid,0.0, 0.0, "DUMMY");
    oneText[playerid] = CreatePlayerTextDraw(playerid,497.333496, 173.392700, "Kills: 31 Tode: 69");


    Oder du prüfst alle deine Löschungen.

  • Klappt.


    _____________________________________________


    stock IsAFraktionsVeh(vehicleid)
    {
    for(new fV;fV<MAX_FVEHS;fV++)
    {
    if(vehicleid == fVehicle[fV][vehID])return fV;
    }
    return INVALID_VEHICLE_ID;
    }


    [22:25:07] [debug] Run time error 4: "Array index out of bounds"
    [22:25:07] [debug] Accessing element at index 65535 past array upper bound 449
    [22:25:07] [debug] AMX backtrace:
    [22:25:07] [debug] #0 000290d4 in public OnPlayerStateChange (0x00000000, 0x00000002, 0x00000001) from selfmade.amx
    [22:25:07] [debug] Run time error 4: "Array index out of bounds"
    [22:25:07] [debug] Accessing element at index 65535 past array upper bound 449
    [22:25:07] [debug] AMX backtrace:
    [22:25:07] [debug] #0 000290d4 in public OnPlayerStateChange (0x00000001, 0x00000002, 0x00000001) from selfmade.amx
    [22:25:07] [debug] Run time error 4: "Array index out of bounds"
    [22:25:07] [debug] Accessing element at index 65535 past array upper bound 449
    [22:25:07] [debug] AMX backtrace:
    [22:25:07] [debug] #0 000290d4 in public OnPlayerStateChange (0x00000002, 0x00000002, 0x00000001) from selfmade.amx



    MAX_FVEHS ist auf 450.


    ?(

  • Erstelle in dem /pawno/ Ordner neben der pawno.exe eine "pawn.cfg" Datei und schreibe dort "-d3" rein (ohne die Anführungszeichen). Anschließend öffne die pawno.exe und wähle deinen Code aus, dann kompiliere ihn neu. Dann poste nochmal was das crashdetect Plugin ausgibt.


    Poste gegebenenfalls die entsprechende Code Zeile dazu, die angegeben wird.

  • Der Code:
    new fV = IsAFraktionsVeh(vehicleid);
    if(Spieler[playerid][Gang] != fVehicle[fV][vehFraktion])
    {
    RemovePlayerFromVehicle(playerid);
    new Float:slx, Float:sly, Float:slz;
    GetPlayerPos(playerid, slx, sly, slz);
    SetPlayerPos(playerid, slx, sly, slz+1);
    }


    [22:44:55] [debug] Run time error 4: "Array index out of bounds"
    [22:44:55] [debug] Accessing element at index 65535 past array upper bound 449
    [22:44:55] [debug] AMX backtrace:
    [22:44:55] [debug] #0 000333c4 in public OnPlayerStateChange (playerid=0, newstate=2, oldstate=1) at \gamemodes\selfmade.pwn:3958
    [22:44:55] [debug] Run time error 4: "Array index out of bounds"
    [22:44:55] [debug] Accessing element at index 65535 past array upper bound 449
    [22:44:55] [debug] AMX backtrace:
    [22:44:55] [debug] #0 000333c4 in public OnPlayerStateChange (playerid=1, newstate=2, oldstate=1) at \gamemodes\selfmade.pwn:3958
    [22:44:55] [debug] Run time error 4: "Array index out of bounds"
    [22:44:55] [debug] Accessing element at index 65535 past array upper bound 449
    [22:44:55] [debug] AMX backtrace:
    [22:44:55] [debug] #0 000333c4 in public OnPlayerStateChange (playerid=2, newstate=2, oldstate=1) at \gamemodes\selfmade.pwn:3958

  • Moin, ich habe mir grad einen 3 Npc erstelt, jedoch will er nicht die Animation machen die ich will. Also er bleibt einfach nur grade stumpf stehen.
    if(!strcmp(botname, "Dealer", true))
    {
    SetPlayerSkin(playerid,29);
    SetPlayerInterior(playerid,-1);
    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY);
    }

    Mit freundlichen Grüßen
    [KoSoVa] :klugs:

  • [KoSoVa]:
    static s_AnimationLibraries[][] = {
    !"AIRPORT", !"ATTRACTORS", !"BAR", !"BASEBALL",
    !"BD_FIRE", !"BEACH", !"BENCHPRESS", !"BF_INJECTION",
    !"BIKED", !"BIKEH", !"BIKELEAP", !"BIKES",
    !"BIKEV", !"BIKE_DBZ", !"BMX", !"BOMBER",
    !"BOX", !"BSKTBALL", !"BUDDY", !"BUS",
    !"CAMERA", !"CAR", !"CARRY", !"CAR_CHAT",
    !"CASINO", !"CHAINSAW", !"CHOPPA", !"CLOTHES",
    !"COACH", !"COLT45", !"COP_AMBIENT", !"COP_DVBYZ",
    !"CRACK", !"CRIB", !"DAM_JUMP", !"DANCING",
    !"DEALER", !"DILDO", !"DODGE", !"DOZER",
    !"DRIVEBYS", !"FAT", !"FIGHT_B", !"FIGHT_C",
    !"FIGHT_D", !"FIGHT_E", !"FINALE", !"FINALE2",
    !"FLAME", !"FLOWERS", !"FOOD", !"FREEWEIGHTS",
    !"GANGS", !"GHANDS", !"GHETTO_DB", !"GOGGLES",
    !"GRAFFITI", !"GRAVEYARD", !"GRENADE", !"GYMNASIUM",
    !"HAIRCUTS", !"HEIST9", !"INT_HOUSE", !"INT_OFFICE",
    !"INT_SHOP", !"JST_BUISNESS", !"KART", !"KISSING",
    !"KNIFE", !"LAPDAN1", !"LAPDAN2", !"LAPDAN3",
    !"LOWRIDER", !"MD_CHASE", !"MD_END", !"MEDIC",
    !"MISC", !"MTB", !"MUSCULAR", !"NEVADA",
    !"ON_LOOKERS", !"OTB", !"PARACHUTE", !"PARK",
    !"PAULNMAC", !"PED", !"PLAYER_DVBYS", !"PLAYIDLES",
    !"POLICE", !"POOL", !"POOR", !"PYTHON",
    !"QUAD", !"QUAD_DBZ", !"RAPPING", !"RIFLE",
    !"RIOT", !"ROB_BANK", !"ROCKET", !"RUSTLER",
    !"RYDER", !"SCRATCHING", !"SHAMAL", !"SHOP",
    !"SHOTGUN", !"SILENCED", !"SKATE", !"SMOKING",
    !"SNIPER", !"SPRAYCAN", !"STRIP", !"SUNBATHE",
    !"SWAT", !"SWEET", !"SWIM", !"SWORD",
    !"TANK", !"TATTOOS", !"TEC", !"TRAIN",
    !"TRUCK", !"UZI", !"VAN", !"VENDING",
    !"VORTEX", !"WAYFARER", !"WEAPONS", !"WUZI",
    !"WOP", !"GFUNK", !"RUNNINGMAN"
    };
    stock static PreloadAnimations(playerid){
    for(new i = 0; i < sizeof(s_AnimationLibraries); i ++){
    ApplyActorAnimation(playerid, s_AnimationLibraries[i], "null", 0.0, 0, 0, 0, 0, 0);
    }
    }
    //OnPlayerSpawn!
    PreloadAnimations(playerid);

  • Warum bekomme ich die Warnings/Error´s? ?(


    [15:54:06] Filterscripts
    [15:54:06] ---------------
    [15:54:06] Loading filterscript 'map.amx'...
    [15:54:06] Error: Function not registered: 'CreateDynamic3DTextLabel'
    [15:54:06] Error: Function not registered: 'CreateDynamicPickup'
    [15:54:06] Error: Function not registered: 'Streamer_VisibleItems'
    [15:54:06] Error: Function not registered: 'CreateDynamicObject'
    [15:54:06] Error: Function not registered: 'SetDynamicObjectMaterial'
    [15:54:06] *** Streamer Plugin: Warning: Include file version (0x275201) does not match plugin version (0x27201) (script might need to be recompiled with the latest include file)
    [15:54:06] *** Streamer_SetVisibleItems: Expecting 2 parameter(s), but found 3
    [15:54:06] Loaded 1 filterscripts.

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen