Problem mit Id und Fridhof system

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 ein problem mit meinem fridhof und zwar wen z.b. id 0 stirbt funktioniert alles wie geplant aber wen einer andere id stirb dan bleibt sie aufm friedhof und es passiert nix
    hier mal der code forward Friedhof(playerid);
    public Friedhof(playerid)
    {
    if(SpielerInfo[playerid][pTeam] == 0 || SpielerInfo[playerid][pLeader] == 0) { SetPlayerPos(playerid,2529.2078,2023.9097,11.1825); SetPlayerInterior(playerid,0); SetPlayerColor(playerid,0xFFFFFFFF); ResetPlayerWeapons(playerid); SetPlayerFacingAngle(playerid,180.2899); }
    if(SpielerInfo[playerid][pTeam] == 1 || SpielerInfo[playerid][pLeader] == 1) { SetPlayerPos(playerid,257.7142,186.3966,1008.1719); SetPlayerInterior(playerid,3); SetPlayerColor(playerid,0x00A3FFFF); ResetPlayerWeapons(playerid); SetPlayerFacingAngle(playerid,357.8066); }
    if(SpielerInfo[playerid][pTeam] == 2 || SpielerInfo[playerid][pLeader] == 2) { SetPlayerPos(playerid,1898.1693,729.1262,10.8198); SetPlayerInterior(playerid,0); SetPlayerColor(playerid,0x002BFFFF); ResetPlayerWeapons(playerid); SetPlayerFacingAngle(playerid,266.9465);}
    if(SpielerInfo[playerid][pTeam] == 3 || SpielerInfo[playerid][pLeader] == 3) { SetPlayerPos(playerid,153.7129,1847.7109,17.6406); SetPlayerInterior(playerid,0); SetPlayerColor(playerid,0x0FFF00FF); ResetPlayerWeapons(playerid); SetPlayerFacingAngle(playerid,359.1844); }
    if(SpielerInfo[playerid][pTeam] == 4 || SpielerInfo[playerid][pLeader] == 4) { SetPlayerPos(playerid,-959.5806,1941.5099,9.0000); SetPlayerInterior(playerid,17); SetPlayerColor(playerid,0x543700FF); ResetPlayerWeapons(playerid); SetPlayerFacingAngle(playerid,357.8444); }
    if(SpielerInfo[playerid][pTeam] == 5 || SpielerInfo[playerid][pLeader] == 5) { SetPlayerPos(playerid,958.8931,-59.7520,1001.1172); SetPlayerInterior(playerid,3); SetPlayerColor(playerid,0xFFA4CDFF); ResetPlayerWeapons(playerid); }
    if(SpielerInfo[playerid][pTeam] == 6 || SpielerInfo[playerid][pLeader] == 6) { SetPlayerColor(playerid,0x969696FF); SetPlayerPos(playerid,2315.9282,1800.8258,10.8203); SetPlayerFacingAngle(playerid,0.0194);}
    SetPlayerSkin(playerid,GetPVarInt(playerid,"Friedhof"));
    SpielerInfo[playerid][pTod] = 0;
    return 1;
    }

  • nein das is nur damit sie danach wieder spawnen ;) es geht darum das immer nur id 0 das richtige system erwischt und nach 10 sekunden respawnt und andere ids wie z.b. 3 oder so die kommen aufn friedhof kommen aber nich mehr runter von firedhof

  • So ich poste jetzt mal mein ganzes system weil es wieder nur mit id 0 funktioniert. bei OnPlayerSpawn: public OnPlayerSpawn(playerid)
    {
    PlayerPlaySound(playerid,1098,0.0,0.0,0.0);

    if(SpielerInfo[playerid][pTod] != 1) {SetPlayerPos(playerid,-333.6097,2219.8052,42.4882); SetTimer("Friedhof",10000,0);}
    else if(SpielerInfo[playerid][pTod] != 0){

    if(SpielerInfo[playerid][pPrison] == 1) { SetPlayerPos(playerid,-10.1993,2330.2234,24.3034);}
    if(SpielerInfo[playerid][pTeam] == 0 || SpielerInfo[playerid][pLeader] == 0) { SetPlayerPos(playerid,2529.2078,2023.9097,11.1825); SetPlayerInterior(playerid,0); SetPlayerColor(playerid,0xFFFFFFFF); ResetPlayerWeapons(playerid); SetPlayerFacingAngle(playerid,180.2899); }
    if(SpielerInfo[playerid][pTeam] == 1 || SpielerInfo[playerid][pLeader] == 1) { SetPlayerPos(playerid,257.7142,186.3966,1008.1719); SetPlayerInterior(playerid,3); SetPlayerColor(playerid,0x00A3FFFF); ResetPlayerWeapons(playerid); SetPlayerFacingAngle(playerid,357.8066); }
    if(SpielerInfo[playerid][pTeam] == 2 || SpielerInfo[playerid][pLeader] == 2) { SetPlayerPos(playerid,1898.1693,729.1262,10.8198); SetPlayerInterior(playerid,0); SetPlayerColor(playerid,0x002BFFFF); ResetPlayerWeapons(playerid); SetPlayerFacingAngle(playerid,266.9465);}
    if(SpielerInfo[playerid][pTeam] == 3 || SpielerInfo[playerid][pLeader] == 3) { SetPlayerPos(playerid,153.7129,1847.7109,17.6406); SetPlayerInterior(playerid,0); SetPlayerColor(playerid,0x0FFF00FF); ResetPlayerWeapons(playerid); SetPlayerFacingAngle(playerid,359.1844); }
    if(SpielerInfo[playerid][pTeam] == 4 || SpielerInfo[playerid][pLeader] == 4) { SetPlayerPos(playerid,-959.5806,1941.5099,9.0000); SetPlayerInterior(playerid,17); SetPlayerColor(playerid,0x543700FF); ResetPlayerWeapons(playerid); SetPlayerFacingAngle(playerid,357.8444); }
    if(SpielerInfo[playerid][pTeam] == 5 || SpielerInfo[playerid][pLeader] == 5) { SetPlayerPos(playerid,958.8931,-59.7520,1001.1172); SetPlayerInterior(playerid,3); SetPlayerColor(playerid,0xFFA4CDFF); ResetPlayerWeapons(playerid); }
    if(SpielerInfo[playerid][pTeam] == 6 || SpielerInfo[playerid][pLeader] == 6) { SetPlayerColor(playerid,0x969696FF); SetPlayerPos(playerid,2315.9282,1800.8258,10.8203); SetPlayerFacingAngle(playerid,0.0194);}
    if(SpielerInfo[playerid][pbekommen] == 0) {SetPlayerSkin(playerid,skins0[random(10)]);SpielerInfo[playerid][pbekommen] = 1; SetPlayerScore(playerid,1); }
    }
    //if(SpielerInfo[playerid][pTeam] == 6) { SetPlayerPos(playerid,Yakuza_Spawn); SetPlayerColor(playerid,COLOR_YAKUZA); SetPlayerSkin(playerid,120); ResetPlayerWeapons(playerid); }
    SetCameraBehindPlayer(playerid);
    TextDrawShowForPlayer(playerid,RealClock);



    return 1;
    }


    bei OnPlayerDeath: public OnPlayerDeath(playerid, killerid, reason)
    {


    SetPVarInt(playerid,"Friedhof",GetPlayerSkin(playerid));
    SpielerInfo[playerid][pDeaths] += 1;
    SpielerInfo[killerid][pKills] += 1;
    SpielerInfo[playerid][pTod] = 1;
    return 1;
    }


    bei OnPlayerUpdate: public OnPlayerUpdate(playerid)
    {
    new Float:health;
    GetPlayerHealth(playerid,health);
    if (health < 1)
    {
    SpielerInfo[playerid][pTod] = 1;
    }


    return 1;
    }


    und nun noch der Public: forward Friedhof(playerid);
    public Friedhof(playerid)
    {
    switch(SpielerInfo[playerid][pTeam])
    {
    case 0:{SetPlayerPos(playerid,2529.2078,2023.9097,11.1825); SetPlayerInterior(playerid,0); SetPlayerColor(playerid,0xFFFFFFFF); ResetPlayerWeapons(playerid); SetPlayerFacingAngle(playerid,180.2899);}
    case 1:{SetPlayerPos(playerid,257.7142,186.3966,1008.1719); SetPlayerInterior(playerid,3); SetPlayerColor(playerid,0x00A3FFFF); ResetPlayerWeapons(playerid); SetPlayerFacingAngle(playerid,357.8066);}
    case 2:{SetPlayerPos(playerid,1898.1693,729.1262,10.8198); SetPlayerInterior(playerid,0); SetPlayerColor(playerid,0x002BFFFF); ResetPlayerWeapons(playerid); SetPlayerFacingAngle(playerid,266.9465);}
    case 3:{SetPlayerPos(playerid,153.7129,1847.7109,17.6406); SetPlayerInterior(playerid,0); SetPlayerColor(playerid,0x0FFF00FF); ResetPlayerWeapons(playerid); SetPlayerFacingAngle(playerid,359.1844);}
    case 4:{SetPlayerPos(playerid,-959.5806,1941.5099,9.0000); SetPlayerInterior(playerid,17); SetPlayerColor(playerid,0x543700FF); ResetPlayerWeapons(playerid); SetPlayerFacingAngle(playerid,357.8444);}
    case 5:{SetPlayerPos(playerid,958.8931,-59.7520,1001.1172); SetPlayerInterior(playerid,3); SetPlayerColor(playerid,0xFFA4CDFF); ResetPlayerWeapons(playerid); }
    case 6:{SetPlayerColor(playerid,0x969696FF); SetPlayerPos(playerid,2315.9282,1800.8258,10.8203); SetPlayerFacingAngle(playerid,0.0194);}
    }
    SetPlayerSkin(playerid,GetPVarInt(playerid,"Friedhof"));
    SpielerInfo[playerid][pTod] = 0;
    return 1;
    }

    3 Mal editiert, zuletzt von _Flex_ ()

  • Mach mal irgendwo in deinem Script


    new FriedhofTimer[MAX_PLAYERS];

    und setz anstatt


    SetTimer("Friedhof",10000,0);


    einfach


    FriedhofTimer[playerid] = SetTimerEx("Friedhof", 10000, false, "i", playerid);


    Dann probiers nochmal.

    Mit freundlichen Grüßen - FamoZ

  • Bei OnplayerDeath wurde die Variable "pTot" nicht richtig auf 1 gesetzt.