DM Arena Spawn

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


    Ich will in der DM Arena wenn man dort rein geht und stribt das man wieder drine spawnt solange man /dmexit macht..
    Zur Zeit habe ich das so gemacht:


    public OnPlayerDeath(playerid, killerid, reason)
    {
    if(GetPVarInt(playerid,"DM1") == 1)
    {
    SetPlayerPos(playerid,2169.3865,1589.8315,999.9716);
    SetCameraBehindPlayer(playerid);
    SetPlayerFacingAngle(playerid,271.2439);
    SetPlayerInterior(playerid,1);
    SetPlayerVirtualWorld(playerid,2);
    GivePlayerWeapon(playerid,24,100000);
    GivePlayerWeapon(playerid,31,100000);
    GivePlayerWeapon(playerid,25,100000);
    GivePlayerWeapon(playerid,29,100000);
    SetPlayerHealth(playerid,100);
    SetPlayerArmour(playerid,100);
    return 1;
    }
    if(GetPVarInt(playerid,"DM2") == 1)
    {
    SetPlayerPos(playerid,-975.975708,1060.983032,1345.671875);
    SetCameraBehindPlayer(playerid);
    SetPlayerInterior(playerid,10);
    SetPlayerVirtualWorld(playerid,2);
    GivePlayerWeapon(playerid,33,100000);
    GivePlayerWeapon(playerid,34,100000);
    SetPlayerHealth(playerid,100);
    SetPVarInt(playerid,"DM2",1);
    return 1;
    }
    return 1;
    }


    Es klappt aber nicht :S


    Wie ist es richtig?

  • Du machst oben ein new name[MAX_PALYERS];


    Dann gehst du hin machst bei OnPlayerDeath


    name[playerid] = 1; für z.B. wenn er in DM arena 1 ist und zwei wenn er in 2 ist.


    Dann bei OnPlayerSpawn


    Das dann mit SetPlayerPos usw hin machen.


    MFG


    EDIT:

    new name[MAX_PLAYERS]; //ganz oben


    //Unter OnPlayerDeath
    if(GetPVarInt(playerid,"DM1") == 1)
    {
    name[playerid] = 1;
    }
    if(GetPVarInt(playerid,"DM2") == 1)
    {
    name[playerid] = 2;
    }


    //Unter OnPlayerSpawn
    if(name[playerid] == 1)
    {
    SetPlayerPos(playerid,2169.3865,1589.8315,999.9716);
    SetCameraBehindPlayer(playerid);
    SetPlayerFacingAngle(playerid,271.2439);
    SetPlayerInterior(playerid,1);
    SetPlayerVirtualWorld(playerid,2);
    GivePlayerWeapon(playerid,24,100000);
    GivePlayerWeapon(playerid,31,100000);
    GivePlayerWeapon(playerid,25,100000);
    GivePlayerWeapon(playerid,29,100000);
    SetPlayerHealth(playerid,100);
    SetPlayerArmour(playerid,100);
    }
    if(name[playerid] == 2)
    {
    SetPlayerPos(playerid,-975.975708,1060.983032,1345.671875);
    SetCameraBehindPlayer(playerid);
    SetPlayerInterior(playerid,10);
    SetPlayerVirtualWorld(playerid,2);
    GivePlayerWeapon(playerid,33,100000);
    GivePlayerWeapon(playerid,34,100000);
    SetPlayerHealth(playerid,100);
    SetPVarInt(playerid,"DM2",1);
    }

  • Du könntest das anders lösen...


    Einfach:


    SetPlayerInt(playerid,"DM", 1);


    oder


    SetPlayerInt(playerid,"DM", 2);