Nach Tot nicht aufm Friedhof ?

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
  • Hey ich habe das Problem das ich nach dem Tot immernoch am Friedhof gespawnt werde aber wieso ?
    Jeffry:
    hast du ein Plan ?
    public OnPlayerSpawn(playerid)
    {
    if(sInfo[playerid][PTot] == 1)
    {
    SetPlayerVirtualWorld(playerid,89);
    SetPlayerPos(playerid,1760.8271,-1895.8221,13.5615);
    SetPlayerFacingAngle(playerid,271.5753);
    SetCameraBehindPlayer(playerid);
    }
    else if(sInfo[playerid][jailtime] > 0)
    {
    SetPlayerInterior(playerid,10);
    SetPlayerVirtualWorld(playerid,24);
    SetPlayerPos(playerid,sInfo[playerid][kx],sInfo[playerid][ky],sInfo[playerid][kz]);
    SetCameraBehindPlayer(playerid);
    }
    else
    {
    if(sInfo[playerid][spawnchange]==0)
    {
    SetPlayerPos(playerid,1760.8271,-1895.8221,13.5615);
    SetPlayerFacingAngle(playerid,268.2114);
    SetPlayerInterior(playerid,0);
    SetPlayerVirtualWorld(playerid,0);
    SetCameraBehindPlayer(playerid);
    }
    if(sInfo[playerid][spawnchange]==1)
    {
    new fID;
    fID = sInfo[playerid][fraktion];
    SetPlayerPos(playerid, fInfo[fID][f_x],fInfo[fID][f_y],fInfo[fID][f_z]);
    SetPlayerFacingAngle(playerid, fInfo[fID][f_r]);
    SetPlayerInterior(playerid, fInfo[fID][f_inter]);
    SetPlayerVirtualWorld(playerid, fInfo[fID][f_world]);
    SetCameraBehindPlayer(playerid);
    GivePlayerWeapon(playerid, fInfo[fID][f_waffe1], fInfo[fID][f_ammo1]);
    GivePlayerWeapon(playerid, fInfo[fID][f_waffe2], fInfo[fID][f_ammo2]);
    GivePlayerWeapon(playerid, fInfo[fID][f_waffe3], fInfo[fID][f_ammo3]);
    GivePlayerWeapon(playerid, fInfo[fID][f_waffe4], fInfo[fID][f_ammo4]);
    }
    }
    SetPlayerSkin(playerid,sInfo[playerid][Skin]);
    return 1;
    }


    public OnPlayerRequestClass(playerid, classid)
    {
    if(sInfo[playerid][PTot] == 1)
    {
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"Du bist soeben gestorben!");
    SendClientMessageEx(playerid,weiß,"Gleich wird ein Wunder passieren!");
    SetTimer("sekunde",sInfo[playerid][tott],0);
    SetPlayerVirtualWorld(playerid,89);
    SetPlayerPos(playerid,816.6987,-1103.0229,25.7914);
    }
    if(sInfo[playerid][jailtime] > 0)
    {
    SendClientMessageEx(playerid,IGELB,"Du musst deine Zeit im Knast noch absitzen!");
    SetTimer("sekunde",sInfo[playerid][jailtime],0);
    SetPlayerInterior(playerid,10);
    SetPlayerVirtualWorld(playerid,24);
    SetPlayerPos(playerid,sInfo[playerid][kx],sInfo[playerid][ky],sInfo[playerid][kz]);
    }
    else
    {
    SetSpawnInfo(playerid,0,sInfo[playerid][Skin],0,0,0,0,0,0,0,0,0,0);
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid, 0);
    SpawnPlayer(playerid);
    }
    return 1;
    }

  • Da ich nicht weiß ob du da Spawnen willst oder nicht ( weil du beides nennst )


    if(sInfo[playerid][PTot] == 1)
    {
    SetPlayerVirtualWorld(playerid,89);
    SetPlayerPos(playerid,1760.8271,-1895.8221,13.5615);
    SetPlayerFacingAngle(playerid,271.5753);
    SetCameraBehindPlayer(playerid);
    }


    Das ist der ausschlaggebene Code wo du Spawnst wenn du tot bist.


  • public OnPlayerSpawn(playerid)
    {
    SetPlayerSkin(playerid,sInfo[playerid][Skin]);
    if(sInfo[playerid][PTot] == 1)
    {
    SetPlayerSkin(playerid,sInfo[playerid][Skin]);
    SetPlayerVirtualWorld(playerid,89);
    SetPlayerPos(playerid,1760.8271,-1895.8221,13.5615);
    SetPlayerFacingAngle(playerid,271.5753);
    SetCameraBehindPlayer(playerid);
    Return 1;
    }
    else if(sInfo[playerid][jailtime] > 0)
    {
    SetPlayerInterior(playerid,10);
    SetPlayerVirtualWorld(playerid,24);
    SetPlayerPos(playerid,sInfo[playerid][kx],sInfo[playerid][ky],sInfo[playerid][kz]);
    SetCameraBehindPlayer(playerid);
    }
    else
    {
    if(sInfo[playerid][spawnchange]==0)
    {
    SetPlayerPos(playerid,1760.8271,-1895.8221,13.5615);
    SetPlayerFacingAngle(playerid,268.2114);
    SetPlayerInterior(playerid,0);
    SetPlayerVirtualWorld(playerid,0);
    SetCameraBehindPlayer(playerid);
    }
    if(sInfo[playerid][spawnchange]==1)
    {
    new fID;
    fID = sInfo[playerid][fraktion];
    SetPlayerPos(playerid, fInfo[fID][f_x],fInfo[fID][f_y],fInfo[fID][f_z]);
    SetPlayerFacingAngle(playerid, fInfo[fID][f_r]);
    SetPlayerInterior(playerid, fInfo[fID][f_inter]);
    SetPlayerVirtualWorld(playerid, fInfo[fID][f_world]);
    SetCameraBehindPlayer(playerid);
    GivePlayerWeapon(playerid, fInfo[fID][f_waffe1], fInfo[fID][f_ammo1]);
    GivePlayerWeapon(playerid, fInfo[fID][f_waffe2], fInfo[fID][f_ammo2]);
    GivePlayerWeapon(playerid, fInfo[fID][f_waffe3], fInfo[fID][f_ammo3]);
    GivePlayerWeapon(playerid, fInfo[fID][f_waffe4], fInfo[fID][f_ammo4]);
    }
    }
    return 1;
    }


    //geschrieben am Handy

  • Beim Logout/Disconnect speichern, und beim Connecten/Login laden.


    Und dann müsstest du eig. nurnoch folgende Abfrage machen (nach dem der Spieler geladen wurde):
    if(sInfo[playerid][PTot] == 1)
    {
    SetPlayerVirtualWorld(playerid,89);
    SetPlayerPos(playerid,1760.8271,-1895.8221,13.5615);
    SetPlayerFacingAngle(playerid,271.5753);
    SetCameraBehindPlayer(playerid);
    }
    else
    {
    //Ansonsten ganz normal spawnen
    }

  • Nein, wenn man connectet muss man sich doch einloggen oder nicht ?
    Und wen du alles Geladen hast (Geld, Level, etc.), machst du anschließend die Abfrage.
    Wichtig ist aber das du die Variable PTot auch abspeicherst und lädst

  • Hey ich habe das Jetze so
    es funktioniert auch aber wenn ich Sterbe und aufm Friedhof komme dann sehe ich ganz kurz woran liegt das ?


    public OnPlayerRequestClass(playerid, classid)
    {
    if(sInfo[playerid][PTot] == 1)
    {
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"Du bist soeben gestorben!");
    SendClientMessageEx(playerid,weiß,"Gleich wird ein Wunder passieren!");
    SetTimer("sekunde",sInfo[playerid][tott],0);
    SetPlayerVirtualWorld(playerid,89);
    SetSpawnInfo(playerid,0,sInfo[playerid][Skin],816.6987,-1103.0229,25.7914,271.5753,0,0,0,0,0,0);
    SpawnPlayer(playerid);
    SetCameraBehindPlayer(playerid);
    return 1;
    }
    if(sInfo[playerid][jailtime] > 0)
    {
    SendClientMessageEx(playerid,IGELB,"Du musst deine Zeit im Knast noch absitzen!");
    SetTimer("sekunde",sInfo[playerid][jailtime],0);
    SetPlayerInterior(playerid,10);
    SetPlayerVirtualWorld(playerid,24);
    SetSpawnInfo(playerid,0,sInfo[playerid][Skin],sInfo[playerid][kx],sInfo[playerid][ky],sInfo[playerid][kz],0.0,0,0,0,0,0,0);
    SpawnPlayer(playerid);
    SetCameraBehindPlayer(playerid);
    return 1;
    }
    else
    {
    SetSpawnInfo(playerid,0,sInfo[playerid][Skin],1760.8271,-1895.8221,13.5615,268.2114,0,0,0,0,0,0);
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid, 0);
    SpawnPlayer(playerid);
    return 1;
    }
    }


    public OnPlayerSpawn(playerid)
    {
    if(sInfo[playerid][PTot] == 1)
    {
    SetPlayerVirtualWorld(playerid,89);
    SetPlayerInterior(playerid,0);
    SetPlayerPos(playerid,816.6987,-1103.0229,25.7914);
    SetCameraBehindPlayer(playerid);
    SetPlayerFacingAngle(playerid,271.5753);
    SetPlayerSkin(playerid,sInfo[playerid][Skin]);
    return 1;
    }
    else if(sInfo[playerid][jailtime] > 0)
    {
    SetPlayerInterior(playerid,10);
    SetPlayerVirtualWorld(playerid,24);
    SetPlayerPos(playerid,sInfo[playerid][kx],sInfo[playerid][ky],sInfo[playerid][kz]);
    SetCameraBehindPlayer(playerid);
    SetPlayerSkin(playerid,sInfo[playerid][Skin]);
    return 1;
    }
    else
    {
    if(sInfo[playerid][spawnchange]==0)
    {

    SetPlayerPos(playerid,1760.8271,-1895.8221,13.5615);
    SetPlayerFacingAngle(playerid,268.2114);
    SetCameraBehindPlayer(playerid);
    SetPlayerInterior(playerid,0);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerSkin(playerid,sInfo[playerid][Skin]);
    return 1;
    }
    if(sInfo[playerid][spawnchange]==1)
    {
    new fID;
    fID = sInfo[playerid][fraktion];
    SetPlayerPos(playerid, fInfo[fID][f_x],fInfo[fID][f_y],fInfo[fID][f_z]);
    SetPlayerFacingAngle(playerid, fInfo[fID][f_r]);
    SetCameraBehindPlayer(playerid);
    SetPlayerInterior(playerid, fInfo[fID][f_inter]);
    SetPlayerVirtualWorld(playerid, fInfo[fID][f_world]);
    SetPlayerSkin(playerid,sInfo[playerid][Skin]);
    GivePlayerWeapon(playerid, fInfo[fID][f_waffe1], fInfo[fID][f_ammo1]);
    GivePlayerWeapon(playerid, fInfo[fID][f_waffe2], fInfo[fID][f_ammo2]);
    GivePlayerWeapon(playerid, fInfo[fID][f_waffe3], fInfo[fID][f_ammo3]);
    GivePlayerWeapon(playerid, fInfo[fID][f_waffe4], fInfo[fID][f_ammo4]);
    return 1;
    }
    }
    return 1;
    }

  • Also beim Login jetzt oder wie ? Schreibe es mal so:
    public OnPlayerRequestClass(playerid, classid)
    {
    if(sInfo[playerid][PTot] == 1)
    {
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"");
    SendClientMessageEx(playerid,weiß,"Du bist soeben gestorben!");
    SendClientMessageEx(playerid,weiß,"Gleich wird ein Wunder passieren!");
    SetTimer("sekunde",sInfo[playerid][tott],0);
    SetPlayerVirtualWorld(playerid,89);
    SetSpawnInfo(playerid,0,sInfo[playerid][Skin],816.6987,-1103.0229,25.7914,271.5753,0,0,0,0,0,0);
    SpawnPlayer(playerid);
    SetCameraBehindPlayer(playerid);
    return 1;
    }
    else if(sInfo[playerid][jailtime] > 0)
    {
    SendClientMessageEx(playerid,IGELB,"Du musst deine Zeit im Knast noch absitzen!");
    SetTimer("sekunde",sInfo[playerid][jailtime],0);
    SetPlayerInterior(playerid,10);
    SetPlayerVirtualWorld(playerid,24);
    SetSpawnInfo(playerid,0,sInfo[playerid][Skin],sInfo[playerid][kx],sInfo[playerid][ky],sInfo[playerid][kz],0.0,0,0,0,0,0,0);
    SpawnPlayer(playerid);
    SetCameraBehindPlayer(playerid);
    return 1;
    }
    else
    {
    SetSpawnInfo(playerid,0,sInfo[playerid][Skin],1760.8271,-1895.8221,13.5615,268.2114,0,0,0,0,0,0);
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid, 0);
    SpawnPlayer(playerid);
    return 1;
    }
    return 1;
    }