Varriable Fehler

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
  • Hallo Community, weiss wer woran diese Fehler liegen ?


    GLOTZ MICH NICHT SO AN! ICH BIN AUCH NUR EINE SIGNATUR!!!


  • // uuh sry hab ich mich verklickt :/ sry kannst du es vllt verschieben ?

    GLOTZ MICH NICHT SO AN! ICH BIN AUCH NUR EINE SIGNATUR!!!

  • Die hier oben


    #include <a_samp>
    #include <float>
    #include <time>
    #include <file>
    #include <utils>
    #include <dini>
    #include <morphinc>
    #include <a_players>
    #include <obj_streamer>

    GLOTZ MICH NICHT SO AN! ICH BIN AUCH NUR EINE SIGNATUR!!!

  • In der Include finde ich nix mit x3, z3, y3 usw,
    das unter ongamemodeexit
    StreamObject_OnGameModeExit();
    und das unter ongamemodeinit
    StreamObject_OnGameModeInit();
    Naja bin jezt pennen gucke dann morgen nach ner antwort :)
    MfG

    GLOTZ MICH NICHT SO AN! ICH BIN AUCH NUR EINE SIGNATUR!!!

  • Dann will ich dich mal über die Warnings aufklären...
    Du verwendest die Variablen doppelt, es gibt sie (wahrscheinlich) in der Include und auch im Script als globale Variablen...
    Benenn sie in der Include einfach mal um, häng da noch ne 2 rann, oder meinetwegen ne 500

  • Habs versucht umzustellen aber iwas is immer falsch ;/
    Das sind die errors:


    Und das is meine inc:
    /* Object Streamer
    *
    * (c) Copyright 2009, Einstein
    * Thx here also to Trivial
    */


    #define MAX_STREAM_OBJECTS 10000
    #define MAX_STREAM_AT_SAME_TIME 142
    #define MAXUPDATES 13


    forward ObjectCheck(playerid);


    new ObjectCount[MAX_PLAYERS];
    new haveobject[MAX_PLAYERS][MAX_STREAM_OBJECTS];
    new ID;
    new modelid3[MAX_STREAM_OBJECTS];
    new Float:x3[MAX_STREAM_OBJECTS];
    new Float:y3[MAX_STREAM_OBJECTS];
    new Float:z3[MAX_STREAM_OBJECTS];
    new Float:rX3[MAX_STREAM_OBJECTS];
    new Float:rY3[MAX_STREAM_OBJECTS];
    new Float:rZ3[MAX_STREAM_OBJECTS];
    new ViewDistance2[MAX_STREAM_OBJECTS];
    new Float:MoveX2[MAX_STREAM_OBJECTS];
    new Float:MoveY2[MAX_STREAM_OBJECTS];
    new Float:MoveZ2[MAX_STREAM_OBJECTS];
    new Float:MoveSpeed2[MAX_STREAM_OBJECTS];
    new moved[MAX_STREAM_OBJECTS];
    new objectres[MAX_PLAYERS][MAX_STREAM_OBJECTS];
    new Float:playerpos3[MAX_PLAYERS][3];
    new updatespassed[MAX_PLAYERS] = 0;


    //From the Samp Forums: Usual Functions


    stock IsPlayerInBall(playerid,Float:x,Float:y,Float:z,radius)
    {
    if(GetPlayerDistanceToPoint(playerid,x,y,z) < radius)
    {
    return 1;
    }
    return 0;
    }


    stock GetPlayerDistanceToPoint(playerid,Float:x,Float:y,Float:z)
    {
    new Float:x1,Float:y1,Float:z1;
    new Float:tmpdis;
    GetPlayerPos(playerid,x1,y1,z1);
    tmpdis = floatsqroot(floatpower(floatabs(floatsub(Float:x,x1)),2)+floatpower(floatabs(floatsub(Float:y,y1)),2)+floatpower(floatabs(floatsub(Float:z,z1)),2));
    return floatround(tmpdis);
    }


    //ObjectStreamer Functions
    stock CreateObjectToStream(modelid, Float:x, Float:y, Float:z, Float:rX, Float:rY, Float:rZ)
    {
    modelid3[ID] = modelid;
    x3[ID] = Float:x;
    y3[ID] = Float:y;
    z3[ID] = Float:z;
    rX3[ID] = Float:rX;
    rY3[ID] = Float:rY;
    rZ3[ID] = Float:rZ;
    ViewDistance2[ID] = 142;
    ID++;
    return ID-1;
    }


    stock CreatePlayerObjectToStream(playerid ,modelid, Float:x, Float:y, Float:z, Float:rX, Float:rY, Float:rZ) //untested
    {
    modelid3[ID] = modelid;
    x3[ID] = Float:x;
    y3[ID] = Float:y;
    z3[ID] = z;
    rX3[ID] = rX;
    rY3[ID] = rY;
    rZ3[ID] = rZ;
    ViewDistance2[ID] = 142;
    ID++;
    for(new i=0; i<YOUPLAYERSLOTS; i++)
    {
    haveobject[i][ID] = -1;
    }
    haveobject[playerid][ID] = 0;
    return ID-1;
    }


    stock DestroyObjectToStream(streamobjectid)
    {
    modelid3[streamobjectid] = 0;
    x3[streamobjectid] = 0;
    y3[streamobjectid] = 0;
    z3[streamobjectid] = -1000;
    rX3[streamobjectid] = 0;
    rY3[streamobjectid] = 0;
    rZ3[streamobjectid] = 0;
    ViewDistance2[streamobjectid] = 0;
    for(new i=0; i<YOUPLAYERSLOTS; i++)
    {
    if(haveobject[i][streamobjectid] == 1)
    {
    DestroyPlayerObject(i, objectres[i][streamobjectid]);
    }
    haveobject[i][streamobjectid] = -1;
    }
    }


    stock DestroyPlayerObjectToStream(playerid, streamobjectid) //untested
    {
    modelid3[streamobjectid] = 0;
    x3[streamobjectid] = 0;
    y3[streamobjectid] = 0;
    z3[streamobjectid] = -1000;
    rX3[streamobjectid] = 0;
    rY3[streamobjectid] = 0;
    rZ3[streamobjectid] = 0;
    ViewDistance2[streamobjectid] = 0;
    if(haveobject[playerid][streamobjectid] == 1)
    {
    DestroyPlayerObject(playerid, objectres[playerid][streamobjectid]);
    }
    haveobject[playerid][streamobjectid] = -1;
    }

    stock MoveObjectToStream(streamobjectid, Float:Movex, Float:Movey, Float:Movez, Float:Speed)
    {
    MoveX3[streamobjectid] = Movex;
    MoveY3[streamobjectid] = Movey;
    MoveZ3[streamobjectid] = Movez;
    MoveSpeed3[streamobjectid] = Speed;
    moved[streamobjectid] = 1;
    for(new i=0; i<YOUPLAYERSLOTS; i++)
    {
    if(haveobject[i][streamobjectid] == 1)
    {
    MovePlayerObject(i, objectres[i][streamobjectid], MoveX2[streamobjectid], MoveY2[streamobjectid], MoveZ2[streamobjectid], MoveSpeed2[streamobjectid]);
    }
    }
    }

    stock StopObjectToStream(streamobjectid)
    {
    for(new i=0; i<YOUPLAYERSLOTS; i++)
    {
    if(haveobject[i][streamobjectid] == 1)
    {
    StopPlayerObject(i, objectres[i][streamobjectid]);
    }
    }
    }


    stock GetBasePosObjectToStream(streamobjectid, &Float:x, &Float:y, &Float:z) //untested
    {
    x = x3[streamobjectid];
    y = y3[streamobjectid];
    z = z3[streamobjectid];
    }


    stock GetMovePosObjectToStream(stramobjectid, &Float:x, &Float:y, &Float:z) //untested
    {
    x = MoveX3[streamobjectid];
    y = MoveY3[streamobjectid];
    z = MoveZ3[streamobjectid];
    }


    stock GetCurrentPosObjectToStream(streamobjectid, &Float:x, &Float:y, &Float:z) //untested
    {
    if(moved[streamobjectid] == 0)
    {
    x = x3[streamobjectid];
    y = y3[streamobjectid];
    z = z3[streamobjectid];
    }
    else if(moved[streamobjectid] == 1)
    {
    x = MoveX3[streamobjectid];
    y = MoveY3[streamobjectid];
    z = MoveZ3[streamobjectid];
    }
    }


    stock GetCurrentRotObjectToStream(streamobjectid, &Float:Rx, &Float:Ry, &Float:Rz) //untested
    {
    Rx = rX3[streamobjectid];
    Ry = rY3[streamobjectid];
    Rz = rZ3[streamobjectid];
    }

    stock SetObjectPosToStream(streamobjectid, Float:x, Float:y, Float:z)
    {
    for(new i=0; i<YOUPLAYERSLOTS; i++)
    {
    if(haveobject[i][streamobjectid] == 1)
    {
    SetPlayerObjectPos(i, objectres[i][streamobjectid], x, y, z);
    }
    }
    x3[streamobjectid] = x;
    y3[streamobjectid] = y;
    z3[streamobjectid] = z;
    }


    stock SetObjectRotToStream(streamobjectid, Float:rX, Float:rY, Float:rZ)
    {
    for(new i=0; i<YOUPLAYERSLOTS; i++)
    {
    if(haveobject[i][streamobjectid] == 1)
    {
    SetPlayerObjectRot(i, objectres[i][streamobjectid], rX, rY, rZ);
    }
    }
    rX3[streamobjectid] = Float:rX;
    rY3[streamobjectid] = Float:rY;
    rZ3[streamobjectid] = Float:rZ;
    }


    stock SetObjectViewDistanceToStream(streamobjectid, Viewdistance)
    {
    ViewDistance2[streamobjectid] = Viewdistance;
    }

    stock SetGloabalViewDistanceToStream(Viewdistance)
    {
    for(new Objects=0; Objects<ID; Objects++)
    {
    ViewDistance2[Objects] = Viewdistance;
    }
    }


    stock SetObjectViewDistanceToStreamEx(streamobjectidMIN, streamobjectidMAX, Viewdistance)
    {
    for(new Objects=streamobjectidMIN; Objects<streamobjectidMAX; Objects++)
    {
    ViewDistance2[Objects] = Viewdistance;
    }
    }


    stock HavePlayerObjectToStream(playerid,streamobjectid)
    {
    if(haveobject[playerid][streamgateid] == 1)
    {
    return 0;
    }
    else if(haveobject[playerid][streamobjectid] == 0)
    {
    return 1;
    }
    }

    stock HavePlayerAnyObjectToStream(playerid)
    {
    for(new object=0; object<ID; object++)
    {
    if(haveobject[playerid][object] == 1)
    {
    return 0;
    }
    }
    return 1;
    }


    stock HaveObjectAnyPlayerToStream(streamobjectid) //untested
    {
    for(new i=0; i<YOUPLAYERSLOTS< i++)
    {
    if(haveobject[i][streamobjectid] == 1)
    {
    return 0;
    }
    }
    return 1;
    }


    stock StreamObject_OnPlayerUpdate(playerid)
    {
    updatespassed++;
    if( updatespassed == MAXUPDATES)
    {
    ObjectCheck(playerid);
    updatespassed = 0;
    }
    }

    stock StreamObject_OnPlayerDisconnect(playerid)
    {
    for(new k=0; k<ID; k++)
    {
    haveobject[playerid][k] = 0;
    objectres[playerid][k] = -1;

    }
    ObjectCount[playerid] = 0; //untested
    }


    public ObjectCheck(playerid)
    {
    new Float:playerx, Float:playery, Float:playerz;
    GetPlayerPos(playerid, playerx, playery, playerz);
    if(playerpos3[playerid][0] != playerx || playerpos3[playerid][1] != playery || playerpos3[playerid][2] != playerz)
    {
    playerpos3[playerid][0] = playerx;
    playerpos3[playerid][1] = playery;
    playerpos3[playerid][2] = playerz;
    for(new objects=0; objects<ID; objects++)
    {
    if(IsPlayerInBall(playerid,x3[objects], y3[objects], z3[objects], ViewDistance2[objects]))
    {
    if(ObjectCount[playerid] < MAX_STREAM_AT_SAME_TIME)
    {
    if(haveobject[playerid][objects] == 0)
    {
    if(moved[objects] == 0)
    {
    objectres[playerid][objects] = CreatePlayerObject(playerid, modelid3[objects], x3[objects], y3[objects], z3[objects], rX3[objects], rY3[objects], rZ3[objects]);
    ObjectCount[playerid]++;
    haveobject[playerid][objects] = 1;
    }
    else if(moved[objects] == 1)
    {
    objectres[playerid][objects] = CreatePlayerObject(playerid, modelid3[objects], Movex3[objects], MoveY3[objects], MoveZ3[objects], rX3[objects], rY3[objects], rZ3[objects]);
    ObjectCount[playerid]++;
    haveobject[playerid][objects] = 1;
    }
    }
    }
    }
    else
    {
    if(haveobject[playerid][objects] == 1)
    {
    DestroyPlayerObject(playerid, objectres[playerid][objects]);
    ObjectCount[playerid]--;
    haveobject[playerid][objects] = 0;
    }
    }
    }
    }
    return 1;
    }

    GLOTZ MICH NICHT SO AN! ICH BIN AUCH NUR EINE SIGNATUR!!!

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