Laggs & Spawnen

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 leute,



    Ich brauche sehr, sehr, sehr dringend hilfe!
    Unzwar habe ich nen script, von früher, was ich geändert hatte etc...


    Das problem


    Es ist ein Godfather edit, was etwas älter ist.
    aber auf neusten stand gemacht wurde.
    Es wurden viele neue sachen hinzugefügt aber auch alte sachen behalten


    1. Zum problem
    Wenn man sich im Dialogfenster registriert,
    dauert das schon jahre, bis das Dialogfenster da ist.
    Dann wenn es dann endlich da ist, gibt man passwort ein und
    drückt den button, registrieren. Dann dauerts wieder Jahre, bis das login fenster da ist.
    Irgendwann kommt ein Login fenster.
    Dort gibt man das pw ein, und drückt login.
    Dann wenn man login gemacht hat, dauerts NOCHMAL jahre, bis man endlich spawnt



    2. Problem
    Abundzu, laggt das total.
    Das kann nicht am server liegen.
    Weil, nen anderes script, garnicht laggt...



    Wer bekannt ist und sich gut auskennt kanns gerne angucken.
    Timer etc habe ich fast alle raus & viele objecte hab ich net -.-

    Einmal editiert, zuletzt von Jay ()

  • public OnPlayerUpdate(playerid)
    {
    if(IsPlayerConnected(playerid))
    {
    if(gPlayerLogged[playerid])
    {
    new weap0, ammo0, weap1, ammo1, weap2, ammo2, weap3, ammo3, weap4, ammo4, weap5, ammo5, weap6, ammo6, weap7, ammo7;
    GetPlayerWeaponData(playerid,0,weap0,ammo0);
    GetPlayerWeaponData(playerid,1,weap1,ammo1);
    GetPlayerWeaponData(playerid,2,weap2,ammo2);
    GetPlayerWeaponData(playerid,3,weap3,ammo3);
    GetPlayerWeaponData(playerid,4,weap4,ammo4);
    GetPlayerWeaponData(playerid,5,weap5,ammo5);
    GetPlayerWeaponData(playerid,6,weap6,ammo6);
    GetPlayerWeaponData(playerid,7,weap7,ammo7);
    new string3[32];
    new playername3[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername3, sizeof(playername3));
    format(string3, sizeof(string3), "Accounts/%s.ini", playername3);
    new File: hFile = fopen(string3, io_write);
    if (hFile)
    {
    new var[32];
    format(var, 32, "Key=%s\n", PlayerInfo[playerid][pKey]);fwrite(hFile, var);
    PlayerInfo[playerid][pCash] = GetPlayerPCash(playerid);
    format(var, 32, "Level=%d\n",PlayerInfo[playerid][pLevel]);fwrite(hFile, var);
    _______________________________GANZ VIELE FORMAT NOCH_________________________
    if ((PlayerInfo[playerid][pPos_x]==0.0 && PlayerInfo[playerid][pPos_y]==0.0 && PlayerInfo[playerid][pPos_z]==0.0))
    {
    PlayerInfo[playerid][pPos_x] = 1684.9;
    PlayerInfo[playerid][pPos_y] = -2244.5;
    PlayerInfo[playerid][pPos_z] = 13.5;
    }
    if(Spectate[playerid] != 255)
    {
    PlayerInfo[playerid][pPos_x] = Unspec[playerid][sPx];
    PlayerInfo[playerid][pPos_y] = Unspec[playerid][sPy];
    PlayerInfo[playerid][pPos_z] = Unspec[playerid][sPz];
    PlayerInfo[playerid][pInt] = Unspec[playerid][sPint];
    PlayerInfo[playerid][pLocal] = Unspec[playerid][sLocal];
    }
    format(var, 32, "Pos_x=%.1f\n",PlayerInfo[playerid][pPos_x]);fwrite(hFile, var);
    format(var, 32, "Pos_y=%.1f\n",PlayerInfo[playerid][pPos_y]);fwrite(hFile, var);
    format(var, 32, "Pos_z=%.1f\n",PlayerInfo[playerid][pPos_z]);fwrite(hFile, var);
    format(var, 32, "CarLic=%d\n",PlayerInfo[playerid][pCarLic]);fwrite(hFile, var);
    format(var, 32, "FlyLic=%d\n",PlayerInfo[playerid][pFlyLic]);fwrite(hFile, var);
    format(var, 32, "BoatLic=%d\n",PlayerInfo[playerid][pBoatLic]);fwrite(hFile, var);
    format(var, 32, "FishLic=%d\n",PlayerInfo[playerid][pFishLic]);fwrite(hFile, var);
    format(var, 32, "BSLic=%d\n",PlayerInfo[playerid][pBSLic]);fwrite(hFile, var);
    format(var, 32, "SFLic=%d\n",PlayerInfo[playerid][pSFLic]);fwrite(hFile, var);
    format(var, 32, "GunLic=%d\n",PlayerInfo[playerid][pGunLic]);fwrite(hFile, var);
    format(var, 32, "CarTime=%d\n",PlayerInfo[playerid][pCarTime]);fwrite(hFile, var);
    format(var, 32, "PayDay=%d\n",PlayerInfo[playerid][pPayDay]);fwrite(hFile, var);
    format(var, 32, "PayDayHad=%d\n",PlayerInfo[playerid][pPayDayHad]);fwrite(hFile, var);
    format(var, 32, "CDPlayer=%d\n",PlayerInfo[playerid][pCDPlayer]);fwrite(hFile, var);
    format(var, 32, "Wins=%d\n",PlayerInfo[playerid][pWins]);fwrite(hFile, var);
    format(var, 32, "Loses=%d\n",PlayerInfo[playerid][pLoses]);fwrite(hFile, var);
    format(var, 32, "AlcoholPerk=%d\n",PlayerInfo[playerid][pAlcoholPerk]);fwrite(hFile, var);
    format(var, 32, "DrugPerk=%d\n",PlayerInfo[playerid][pDrugPerk]);fwrite(hFile, var);
    format(var, 32, "MiserPerk=%d\n",PlayerInfo[playerid][pMiserPerk]);fwrite(hFile, var);
    format(var, 32, "PainPerk=%d\n",PlayerInfo[playerid][pPainPerk]);fwrite(hFile, var);
    format(var, 32, "TraderPerk=%d\n",PlayerInfo[playerid][pTraderPerk]);fwrite(hFile, var);
    format(var, 32, "Tutorial=%d\n",PlayerInfo[playerid][pTut]);fwrite(hFile, var);
    format(var, 32, "Mission=%d\n",PlayerInfo[playerid][pMissionNr]);fwrite(hFile, var);
    format(var, 32, "Warnings=%d\n",PlayerInfo[playerid][pWarns]);fwrite(hFile, var);
    format(var, 32, "Adjustable=%d\n",PlayerInfo[playerid][pAdjustable]);fwrite(hFile, var);
    if(PlayerInfo[playerid][pDonateRank] < 1) { PlayerInfo[playerid][pFuel] = 0; }
    format(var, 32, "Fuel=%d\n",PlayerInfo[playerid][pFuel]);fwrite(hFile, var);
    format(var, 32, "MatsHolding=%d\n",MatsHolding[playerid]);fwrite(hFile, var);
    format(var, 32, "WantedLevel=%d\n",WantedLevel[playerid]);fwrite(hFile, var);
    format(var, 32, "WantedPoints=%d\n",WantedPoints[playerid]);fwrite(hFile, var);
    format(var, 32, "Bag=%d\n",PlayerInfo[playerid][pBag]);fwrite(hFile, var);
    format(var, 32, "playingseconds=%d\n",playingseconds[playerid]);fwrite(hFile, var);
    format(var, 32, "Married=%d\n",PlayerInfo[playerid][pMarried]);fwrite(hFile, var);
    format(var, 32, "felon=%d\n",felon[playerid]);fwrite(hFile, var);
    format(var, 32, "MarriedTo=%s\n",PlayerInfo[playerid][pMarriedTo]);fwrite(hFile, var);
    format(var, 32, "Gun0=%d\n",PlayerInfo[playerid][pGun0]);fwrite(hFile, var);
    format(var, 32, "Gun1=%d\n",PlayerInfo[playerid][pGun1]);fwrite(hFile, var);
    format(var, 32, "Gun2=%d\n",PlayerInfo[playerid][pGun2]);fwrite(hFile, var);
    format(var, 32, "Gun3=%d\n",PlayerInfo[playerid][pGun3]);fwrite(hFile, var);
    format(var, 32, "Gun4=%d\n",PlayerInfo[playerid][pGun4]);fwrite(hFile, var);
    format(var, 32, "Gun5=%d\n",PlayerInfo[playerid][pGun5]);fwrite(hFile, var);
    format(var, 32, "Gun6=%d\n",PlayerInfo[playerid][pGun6]);fwrite(hFile, var);
    format(var, 32, "Gun7=%d\n",PlayerInfo[playerid][pGun7]);fwrite(hFile, var);
    format(var, 32, "Gun8=%d\n",PlayerInfo[playerid][pGun8]);fwrite(hFile, var);
    format(var, 32, "Ammo0=%d\n",PlayerInfo[playerid][pAmmo0]);fwrite(hFile, var);
    format(var, 32, "Ammo1=%d\n",PlayerInfo[playerid][pAmmo1]);fwrite(hFile, var);
    format(var, 32, "Ammo2=%d\n",PlayerInfo[playerid][pAmmo2]);fwrite(hFile, var);
    format(var, 32, "Ammo3=%d\n",PlayerInfo[playerid][pAmmo3]);fwrite(hFile, var);
    format(var, 32, "Ammo4=%d\n",PlayerInfo[playerid][pAmmo4]);fwrite(hFile, var);
    format(var, 32, "Ammo5=%d\n",PlayerInfo[playerid][pAmmo5]);fwrite(hFile, var);
    format(var, 32, "Ammo6=%d\n",PlayerInfo[playerid][pAmmo6]);fwrite(hFile, var);
    format(var, 32, "Ammo7=%d\n",PlayerInfo[playerid][pAmmo7]);fwrite(hFile, var);
    format(var, 32, "Ammo8=%d\n",PlayerInfo[playerid][pAmmo8]);fwrite(hFile, var);
    PlayerInfo[playerid][pInterior] = GetPlayerInterior(playerid);
    format(var, 32, "Interior=%d\n",PlayerInfo[playerid][pInterior]);fwrite(hFile, var);
    PlayerInfo[playerid][pWorld] = GetPlayerVirtualWorld(playerid);
    format(var, 32, "World=%d\n",PlayerInfo[playerid][pWorld]);fwrite(hFile, var);
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid, x, y, z);
    PlayerInfo[playerid][pPosx] = x;
    PlayerInfo[playerid][pPosy] = y;
    PlayerInfo[playerid][pPosz] = z;
    format(var, 32, "Posx=%.1f\n",PlayerInfo[playerid][pPos_x]);fwrite(hFile, var);
    format(var, 32, "Posy=%.1f\n",PlayerInfo[playerid][pPos_y]);fwrite(hFile, var);
    format(var, 32, "Posz=%.1f\n",PlayerInfo[playerid][pPos_z]);fwrite(hFile, var);
    fclose(hFile);
    }
    }
    }


    return 1;
    }


    hab ein paar format dinger
    rausgenommen

  • ja, ich hatte auch mal ein gf-edit. ich hatte ein neues police department gaddet, und das laggen war nicht mehr aufzuhalten.

    hmm das hab ich z.B. aber nicht

  • Der Callback OnPlayerUpdate wird mehrmals in einer Sekunde aufgerufen und ihr benutzt das nur um die aktuellen Spieler stats zu updaten?
    Sinnloser Resourcen Verbrauch! Deswegen auch die Epic Lags.


    beim OnPlayerDisconnect callback kannst ruft er all diese Funktionen nur ein mal ab wenn der Spieler disconnected. (Ausloggen, timeout & kicked) das dürfte dein Problem lösen)

  • Kannste mir noch sagen, was ich raustun, bzw reintun muss?

  • Es kommt drauf an welches Betriebsystem auf deinem host läuft. Das OnPlayerUpdate versteht sich komischer weise mit Windows manschmal besser als mit Linux so ein ähnlisches problem hatte auch BFX denn sein streamer führte zu vielen usern die einen Linuxserver hatten zu extremen laggs, bei Windows war dies aber nicht der Fall.

  • Glaube ich wohl kaum.
    Lesen Bildet.

    Code
    Important Note: This callback is called very frequently  per second per player, only use it when you know what it's meant for.


    Code
    Wichtige Nachricht: Dieser Callback wird sehr häufig per Sekunde aufgerufen. Benutz diesen Callback nur wenn du weißt was dieser auch kann.


  • Glaube ich wohl kaum.
    Lesen Bildet.

    Code
    Important Note: This callback is called very frequently  per second per player, only use it when you know what it's meant for.


    Code
    Wichtige Nachricht: Dieser Callback wird sehr häufig per Sekunde aufgerufen. Benutz diesen Callback nur wenn du weißt was dieser auch kann.


    Kannste mir irgendwie helfen.
    Das sagt mir nix, was muss ich den raustun oder so.
    Du weißt es doch bestimmt... ;(

  • Ganz einfach, über das public OnPlayerUpdate(playerid)


    forward OnPlayerUpdateAtExit(playerid);


    und dann die Public umschreiben:


    public OnPlayerUpdateAtExit(playerid)


    Und dann:


    public OnPlayerDisconnect(playerid, reason)
    {
    OnPlayerUpdateAtExit(playerid);
    }


    Da wird nun nurnoch beim Exit gespeichert.

    Mfg kony




  • Alles aus dem OnPlayerUpdate entfernen, return 1 machen (wichtig!) das soll dann so aussehen:


    Public OnPlayerUpdate(playerid)
    {
    return 1;
    }


    danach fügst du das hier hinzu:
    public OnPlayerLogoutUpate(playerid)
    {
    if(IsPlayerConnected(playerid))
    {
    if(gPlayerLogged[playerid])
    {
    new weap0, ammo0, weap1, ammo1, weap2, ammo2, weap3, ammo3, weap4, ammo4, weap5, ammo5, weap6, ammo6, weap7, ammo7;
    GetPlayerWeaponData(playerid,0,weap0,ammo0);
    GetPlayerWeaponData(playerid,1,weap1,ammo1);
    GetPlayerWeaponData(playerid,2,weap2,ammo2);
    GetPlayerWeaponData(playerid,3,weap3,ammo3);
    GetPlayerWeaponData(playerid,4,weap4,ammo4);
    GetPlayerWeaponData(playerid,5,weap5,ammo5);
    GetPlayerWeaponData(playerid,6,weap6,ammo6);
    GetPlayerWeaponData(playerid,7,weap7,ammo7);
    new string3[32];
    new playername3[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername3, sizeof(playername3));
    format(string3, sizeof(string3), "Accounts/%s.ini", playername3);
    new File: hFile = fopen(string3, io_write);
    if (hFile)
    {
    new var[32];
    format(var, 32, "Key=%s\n", PlayerInfo[playerid][pKey]);fwrite(hFile, var);
    PlayerInfo[playerid][pCash] = GetPlayerPCash(playerid);
    format(var, 32, "Level=%d\n",PlayerInfo[playerid][pLevel]);fwrite(hFile, var);
    if ((PlayerInfo[playerid][pPos_x]==0.0 && PlayerInfo[playerid][pPos_y]==0.0 && PlayerInfo[playerid][pPos_z]==0.0))
    {
    PlayerInfo[playerid][pPos_x] = 1684.9;
    PlayerInfo[playerid][pPos_y] = -2244.5;
    PlayerInfo[playerid][pPos_z] = 13.5;
    }
    if(Spectate[playerid] != 255)
    {
    PlayerInfo[playerid][pPos_x] = Unspec[playerid][sPx];
    PlayerInfo[playerid][pPos_y] = Unspec[playerid][sPy];
    PlayerInfo[playerid][pPos_z] = Unspec[playerid][sPz];
    PlayerInfo[playerid][pInt] = Unspec[playerid][sPint];
    PlayerInfo[playerid][pLocal] = Unspec[playerid][sLocal];
    }
    format(var, 32, "Pos_x=%.1f\n",PlayerInfo[playerid][pPos_x]);fwrite(hFile, var);
    format(var, 32, "Pos_y=%.1f\n",PlayerInfo[playerid][pPos_y]);fwrite(hFile, var);
    format(var, 32, "Pos_z=%.1f\n",PlayerInfo[playerid][pPos_z]);fwrite(hFile, var);
    format(var, 32, "CarLic=%d\n",PlayerInfo[playerid][pCarLic]);fwrite(hFile, var);
    format(var, 32, "FlyLic=%d\n",PlayerInfo[playerid][pFlyLic]);fwrite(hFile, var);
    format(var, 32, "BoatLic=%d\n",PlayerInfo[playerid][pBoatLic]);fwrite(hFile, var);
    format(var, 32, "FishLic=%d\n",PlayerInfo[playerid][pFishLic]);fwrite(hFile, var);
    format(var, 32, "BSLic=%d\n",PlayerInfo[playerid][pBSLic]);fwrite(hFile, var);
    format(var, 32, "SFLic=%d\n",PlayerInfo[playerid][pSFLic]);fwrite(hFile, var);
    format(var, 32, "GunLic=%d\n",PlayerInfo[playerid][pGunLic]);fwrite(hFile, var);
    format(var, 32, "CarTime=%d\n",PlayerInfo[playerid][pCarTime]);fwrite(hFile, var);
    format(var, 32, "PayDay=%d\n",PlayerInfo[playerid][pPayDay]);fwrite(hFile, var);
    format(var, 32, "PayDayHad=%d\n",PlayerInfo[playerid][pPayDayHad]);fwrite(hFile, var);
    format(var, 32, "CDPlayer=%d\n",PlayerInfo[playerid][pCDPlayer]);fwrite(hFile, var);
    format(var, 32, "Wins=%d\n",PlayerInfo[playerid][pWins]);fwrite(hFile, var);
    format(var, 32, "Loses=%d\n",PlayerInfo[playerid][pLoses]);fwrite(hFile, var);
    format(var, 32, "AlcoholPerk=%d\n",PlayerInfo[playerid][pAlcoholPerk]);fwrite(hFile, var);
    format(var, 32, "DrugPerk=%d\n",PlayerInfo[playerid][pDrugPerk]);fwrite(hFile, var);
    format(var, 32, "MiserPerk=%d\n",PlayerInfo[playerid][pMiserPerk]);fwrite(hFile, var);
    format(var, 32, "PainPerk=%d\n",PlayerInfo[playerid][pPainPerk]);fwrite(hFile, var);
    format(var, 32, "TraderPerk=%d\n",PlayerInfo[playerid][pTraderPerk]);fwrite(hFile, var);
    format(var, 32, "Tutorial=%d\n",PlayerInfo[playerid][pTut]);fwrite(hFile, var);
    format(var, 32, "Mission=%d\n",PlayerInfo[playerid][pMissionNr]);fwrite(hFile, var);
    format(var, 32, "Warnings=%d\n",PlayerInfo[playerid][pWarns]);fwrite(hFile, var);
    format(var, 32, "Adjustable=%d\n",PlayerInfo[playerid][pAdjustable]);fwrite(hFile, var);
    if(PlayerInfo[playerid][pDonateRank] < 1) { PlayerInfo[playerid][pFuel] = 0; }
    format(var, 32, "Fuel=%d\n",PlayerInfo[playerid][pFuel]);fwrite(hFile, var);
    format(var, 32, "MatsHolding=%d\n",MatsHolding[playerid]);fwrite(hFile, var);
    format(var, 32, "WantedLevel=%d\n",WantedLevel[playerid]);fwrite(hFile, var);
    format(var, 32, "WantedPoints=%d\n",WantedPoints[playerid]);fwrite(hFile, var);
    format(var, 32, "Bag=%d\n",PlayerInfo[playerid][pBag]);fwrite(hFile, var);
    format(var, 32, "playingseconds=%d\n",playingseconds[playerid]);fwrite(hFile, var);
    format(var, 32, "Married=%d\n",PlayerInfo[playerid][pMarried]);fwrite(hFile, var);
    format(var, 32, "felon=%d\n",felon[playerid]);fwrite(hFile, var);
    format(var, 32, "MarriedTo=%s\n",PlayerInfo[playerid][pMarriedTo]);fwrite(hFile, var);
    format(var, 32, "Gun0=%d\n",PlayerInfo[playerid][pGun0]);fwrite(hFile, var);
    format(var, 32, "Gun1=%d\n",PlayerInfo[playerid][pGun1]);fwrite(hFile, var);
    format(var, 32, "Gun2=%d\n",PlayerInfo[playerid][pGun2]);fwrite(hFile, var);
    format(var, 32, "Gun3=%d\n",PlayerInfo[playerid][pGun3]);fwrite(hFile, var);
    format(var, 32, "Gun4=%d\n",PlayerInfo[playerid][pGun4]);fwrite(hFile, var);
    format(var, 32, "Gun5=%d\n",PlayerInfo[playerid][pGun5]);fwrite(hFile, var);
    format(var, 32, "Gun6=%d\n",PlayerInfo[playerid][pGun6]);fwrite(hFile, var);
    format(var, 32, "Gun7=%d\n",PlayerInfo[playerid][pGun7]);fwrite(hFile, var);
    format(var, 32, "Gun8=%d\n",PlayerInfo[playerid][pGun8]);fwrite(hFile, var);
    format(var, 32, "Ammo0=%d\n",PlayerInfo[playerid][pAmmo0]);fwrite(hFile, var);
    format(var, 32, "Ammo1=%d\n",PlayerInfo[playerid][pAmmo1]);fwrite(hFile, var);
    format(var, 32, "Ammo2=%d\n",PlayerInfo[playerid][pAmmo2]);fwrite(hFile, var);
    format(var, 32, "Ammo3=%d\n",PlayerInfo[playerid][pAmmo3]);fwrite(hFile, var);
    format(var, 32, "Ammo4=%d\n",PlayerInfo[playerid][pAmmo4]);fwrite(hFile, var);
    format(var, 32, "Ammo5=%d\n",PlayerInfo[playerid][pAmmo5]);fwrite(hFile, var);
    format(var, 32, "Ammo6=%d\n",PlayerInfo[playerid][pAmmo6]);fwrite(hFile, var);
    format(var, 32, "Ammo7=%d\n",PlayerInfo[playerid][pAmmo7]);fwrite(hFile, var);
    format(var, 32, "Ammo8=%d\n",PlayerInfo[playerid][pAmmo8]);fwrite(hFile, var);
    PlayerInfo[playerid][pInterior] = GetPlayerInterior(playerid);
    format(var, 32, "Interior=%d\n",PlayerInfo[playerid][pInterior]);fwrite(hFile, var);
    PlayerInfo[playerid][pWorld] = GetPlayerVirtualWorld(playerid);
    format(var, 32, "World=%d\n",PlayerInfo[playerid][pWorld]);fwrite(hFile, var);
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid, x, y, z);
    PlayerInfo[playerid][pPosx] = x;
    PlayerInfo[playerid][pPosy] = y;
    PlayerInfo[playerid][pPosz] = z;
    format(var, 32, "Posx=%.1f\n",PlayerInfo[playerid][pPos_x]);fwrite(hFile, var);
    format(var, 32, "Posy=%.1f\n",PlayerInfo[playerid][pPos_y]);fwrite(hFile, var);
    format(var, 32, "Posz=%.1f\n",PlayerInfo[playerid][pPos_z]);fwrite(hFile, var);
    fclose(hFile);
    }
    }
    }


    return 1;
    }


    Danach fügst du das noch bei OnPlayerDisconnect hinzu. (Ganz Oben direkt unter {.)
    Public OnPlayerDisconnect(playerid, reason)
    {
    OnPlayerLogoutUpate(playerid);
    // Dein Ganzes zeugs danach...
    return 1;
    }


    Danach dürfte es nicht mehr laggen.

  • also
    über


    onplayerupdate
    forward OnPlayerUpateAtExit(playerid);


    und dann einfach


    public OnPlayerUpdateAtExit(playerid)
    erstellen?
    und was soll darein?
    checks net sry

  • ehm adm level etc wird netmehr gespeichert...



    EDIT:


    Doch geht, schreibfehler
    OnPlayerLogoutUpate zu OnPlayerLogoutUpdate
    __________________________________________


    EDIT2:


    Habs so gemacht, beides getestet.
    Läd vllt schneller. allerdings wenn man login drückt, laggt das immernoch.
    forward OnPlayerUpdateAtExit(playerid);
    public OnPlayerUpdateAtExit(playerid)
    {
    if(IsPlayerConnected(playerid))
    {
    if(gPlayerLogged[playerid])
    {
    new weap0, ammo0, weap1, ammo1, weap2, ammo2, weap3, ammo3, weap4, ammo4, weap5, ammo5, weap6, ammo6, weap7, ammo7;
    GetPlayerWeaponData(playerid,0,weap0,ammo0);
    GetPlayerWeaponData(playerid,1,weap1,ammo1);
    GetPlayerWeaponData(playerid,2,weap2,ammo2);
    GetPlayerWeaponData(playerid,3,weap3,ammo3);
    GetPlayerWeaponData(playerid,4,weap4,ammo4);
    GetPlayerWeaponData(playerid,5,weap5,ammo5);
    GetPlayerWeaponData(playerid,6,weap6,ammo6);
    GetPlayerWeaponData(playerid,7,weap7,ammo7);
    new string3[32];
    new playername3[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername3, sizeof(playername3));
    format(string3, sizeof(string3), "Accounts/%s.ini", playername3);
    new File: hFile = fopen(string3, io_write);
    if (hFile)
    {
    new var[32];
    format(var, 32, "Key=%s\n", PlayerInfo[playerid][pKey]);fwrite(hFile, var);
    PlayerInfo[playerid][pCash] = GetPlayerPCash(playerid);
    format(var, 32, "Level=%d\n",PlayerInfo[playerid][pLevel]);fwrite(hFile, var);
    paar formats raus genommen
    format(var, 32, "ammo3=%d\n",ammo3);fwrite(hFile, var);
    format(var, 32, "ammo4=%d\n",ammo4);fwrite(hFile, var);
    format(var, 32, "ammo5=%d\n",ammo5);fwrite(hFile, var);
    format(var, 32, "ammo6=%d\n",ammo6);fwrite(hFile, var);
    format(var, 32, "ammo7=%d\n",ammo7);fwrite(hFile, var);
    if ((PlayerInfo[playerid][pPos_x]==0.0 && PlayerInfo[playerid][pPos_y]==0.0 && PlayerInfo[playerid][pPos_z]==0.0))
    {
    PlayerInfo[playerid][pPos_x] = 1684.9;
    PlayerInfo[playerid][pPos_y] = -2244.5;
    PlayerInfo[playerid][pPos_z] = 13.5;
    }
    if(Spectate[playerid] != 255)
    {
    PlayerInfo[playerid][pPos_x] = Unspec[playerid][sPx];
    PlayerInfo[playerid][pPos_y] = Unspec[playerid][sPy];
    PlayerInfo[playerid][pPos_z] = Unspec[playerid][sPz];
    PlayerInfo[playerid][pInt] = Unspec[playerid][sPint];
    PlayerInfo[playerid][pLocal] = Unspec[playerid][sLocal];
    }
    format(var, 32, "Pos_x=%.1f\n",PlayerInfo[playerid][pPos_x]);fwrite(hFile, var);
    format(var, 32, "Pos_y=%.1f\n",PlayerInfo[playerid][pPos_y]);fwrite(hFile, var);
    paar formats raus genommen
    format(var, 32, "Ammo6=%d\n",PlayerInfo[playerid][pAmmo6]);fwrite(hFile, var);
    format(var, 32, "Ammo7=%d\n",PlayerInfo[playerid][pAmmo7]);fwrite(hFile, var);
    format(var, 32, "Ammo8=%d\n",PlayerInfo[playerid][pAmmo8]);fwrite(hFile, var);
    PlayerInfo[playerid][pInterior] = GetPlayerInterior(playerid);
    format(var, 32, "Interior=%d\n",PlayerInfo[playerid][pInterior]);fwrite(hFile, var);
    PlayerInfo[playerid][pWorld] = GetPlayerVirtualWorld(playerid);
    format(var, 32, "World=%d\n",PlayerInfo[playerid][pWorld]);fwrite(hFile, var);
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid, x, y, z);
    PlayerInfo[playerid][pPosx] = x;
    PlayerInfo[playerid][pPosy] = y;
    PlayerInfo[playerid][pPosz] = z;
    format(var, 32, "Posx=%.1f\n",PlayerInfo[playerid][pPos_x]);fwrite(hFile, var);
    format(var, 32, "Posy=%.1f\n",PlayerInfo[playerid][pPos_y]);fwrite(hFile, var);
    format(var, 32, "Posz=%.1f\n",PlayerInfo[playerid][pPos_z]);fwrite(hFile, var);
    fclose(hFile);
    }
    }
    }


    return 1;
    }

    3 Mal editiert, zuletzt von Jay ()

  • laggs sind leider nicht weg.


    Laggt beim einloggen immernoch, so das man fliegt.
    Haben das gestern getestet alles...

  • Ist ja sehr komisch 8|

    Einmal editiert, zuletzt von Profi-Script.etc ()

  • Ist da sehr komisch 8|

    ja so ist es....


    also ich zeigs nochmal:


    Man mach "/login password", dann passiert ganzezeit nichts!
    irgendwann steht im chat oben dann endlich, willkommen ....
    dann erstmal wieder nichts, bis man spawnt, dann fliegt man aber erstmal
    eine runde... und dann spawnt man erst