Krankenhaus-System geht nicht

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 ihr da :)
    Ich habe das Problem, wenn ich sterbe lande ich nicht im Krankenhaus, ich werde stattdessen einfach nur wieder neu gespawnt.
    Der Code:

    new Float:health;
    GetPlayerHealth(playerid,health);
    health = 100.0;
    printf("SetPlayerHealth(playerid,%f);",health);
    SetPlayerHealth(playerid,health);
    if(PlayerInfo[playerid][pTod] == 1)
    {
    SetTimer("TOTTimer",60000,1);
    SetPVarInt(playerid,"tot_Skin",GetPlayerSkin(playerid));
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, "{FFA500}Information{FFFFFF}: Durch deine schweren Verletzungen liegst du im Koma!");
    SendClientMessage(playerid, COLOR_WHITE, "{FFA500}Information{FFFFFF}: Du befindest dich für 2 Minuten im Krankenhaus.");
    SendClientMessage(playerid, COLOR_WHITE, "{FFA500}Information{FFFFFF}: In 2 bis 3 Minuten kommst du wieder raus, da du gerade behandelt wirst.");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SetPlayerPos(playerid,941.7925,1734.3978,21.1277);
    SetPlayerCameraPos(playerid, 993.5776,1653.3435,10.3279);
    SetPlayerCameraLookAt(playerid, 949.7623,1748.0996,26.2525);
    TogglePlayerControllable(playerid, 0);
    ResetPlayerWeapons(playerid);
    SetPlayerInterior(playerid, 0);
    SetPlayerColor(playerid, COLOR_ZIVI);
    return 1;
    }


    Ich habe auch schon versucht,
    SetPlayerSpawn(playerid);
    SpawnPlayer(playerid);
    einzufügen, hat aber nichts am Problem geändert.


    Ich hoffe ihr wisst woran es liegt. ;(

  • Zeig mal Tottimer


    public TOTTimer()
    {
    for(new i=0; i<MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(PlayerInfo[i][pTod] == 1)
    {
    pIstTot[i] += 1;
    }
    if(PlayerInfo[i][pTod] == 1 && pIstTot[i] == 2)
    {
    PlayerInfo[i][pTod] = 0;
    pIstTot[i] = 0;
    SetPlayerVirtualWorld(i,0);
    SendClientMessage(i, COLOR_WHITE, "{FFA500}Information{FFFFFF}: Du bist nun aus dem Krankenhaus entlassen!");
    SetPlayerSkin(i,GetPVarInt(i,"tot_Skin"));
    TogglePlayerControllable(i,1);
    SetPlayerSpawn(i);
    SpawnPlayer(i);
    }
    }
    }
    }

    Woran liegt es? :huh:

  • Zeig mal den Part, wo du pTod gleich 1 setzt.

    ich habe es bereits bei OnPlayerSpawn gelöscht - ich dussel :S
    bei OnPlayerDeath steht dies:

    public OnPlayerDeath(playerid, killerid, reason)
    {
    PlayerInfo[playerid][pTod] = 1; // <------
    new name[MAX_PLAYER_NAME];
    new string[256];
    //new dmessage[128];
    //new deathreason[20];
    //new FloatX,FloatY,FloatZ;
    new Float:health;
    GetPlayerHealth(playerid,health);
    health = 100.0;
    printf("SetPlayerHealth(playerid,%f);",health);
    SetPlayerHealth(playerid,health);
    if(PlayerInfo[playerid][pTod] == 1)
    {
    SetPVarInt(playerid,"tot_Skin",GetPlayerSkin(playerid));
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, "{FFA500}Information{FFFFFF}: Durch deine schweren Verletzungen liegst du im Koma!");
    SendClientMessage(playerid, COLOR_WHITE, "{FFA500}Information{FFFFFF}: Du befindest dich für 2 Minuten im Krankenhaus.");
    SendClientMessage(playerid, COLOR_WHITE, "{FFA500}Information{FFFFFF}: In 2 bis 3 Minuten kommst du wieder raus, da du gerade behandelt wirst.");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SetPlayerPos(playerid,941.7925,1734.3978,21.1277);
    SetPlayerCameraPos(playerid, 993.5776,1653.3435,10.3279);
    SetPlayerCameraLookAt(playerid, 949.7623,1748.0996,26.2525);
    TogglePlayerControllable(playerid, 0);
    ResetPlayerWeapons(playerid);
    SetPlayerInterior(playerid, 0);
    SetPlayerColor(playerid, COLOR_ZIVI);
    return 1;
    }

    Ich habe es nur hier zu 1 gesetzt. (also beim Tod)
    Nur das Problem ist, ich lande nicht direkt im Krankenhaus, sondern werde dann gleich wieder gespawnt.

  • Ja, Zeile 14 - 37 nach OnPlayerSpawn() verschieben.

    Dankeschön! :)
    Ich habe jetzt aber noch das Problem, wenn ich mich einloggen will/registrieren will dann lande ich immer im Krankenhaus. (also ich gebe mein Passwort ein, und dann bin ich im KH)


    OnPlayerLogin:

    public OnPlayerLogin(playerid,password[])
    {
    if(IsPlayerNPC(playerid)) return 1;
    new tmp2[256];
    new string2[100];
    //new string[256];
    new playername2[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername2, sizeof(playername2));
    format(string2, sizeof(string2), "/Accounts/%s.ini", playername2);
    SpawnPlayer(playerid);
    if ( fexist(string2) )
    {
    new valtmp[256];
    valtmp = dini_Get(string2, "Key");
    strmid(PlayerInfo[playerid][pKey], valtmp, 0, strlen(valtmp), 255);
    //printf("key: %s | pw: %s", PlayerInfo[playerid][pKey],password);
    if(strcmp(PlayerInfo[playerid][pKey],password) == 0 )
    {
    PlayerInfo[playerid][pLevel] = dini_Int(string2, "Level");
    PlayerInfo[playerid][pAdmin] = dini_Int(string2, "AdminLevel");
    PlayerInfo[playerid][pDonateRank] = dini_Int(string2, "DonateRank");
    PlayerInfo[playerid][gPupgrade] = dini_Int(string2, "UpgradePoints");
    PlayerInfo[playerid][pConnectTime] = dini_Int(string2, "ConnectedTime");
    PlayerInfo[playerid][pReg] = dini_Int(string2, "Registered");
    PlayerInfo[playerid][pSex] = dini_Int(string2, "Sex");
    PlayerInfo[playerid][pAge] = dini_Int(string2, "Age");
    PlayerInfo[playerid][pOrigin] = dini_Int(string2, "Origin");
    PlayerInfo[playerid][pCK] = dini_Int(string2, "CK");
    PlayerInfo[playerid][pMuted] = dini_Int(string2, "Muted");
    PlayerInfo[playerid][pExp] = dini_Int(string2, "Respect");
    PlayerInfo[playerid][pCash] = dini_Int(string2, "Money");
    PlayerInfo[playerid][pAccount] = dini_Int(string2, "Bank");
    PlayerInfo[playerid][pCrimes] = dini_Int(string2, "Crimes");
    PlayerInfo[playerid][pKills] = dini_Int(string2, "Kills");
    PlayerInfo[playerid][pDeaths] = dini_Int(string2, "Deaths");
    PlayerInfo[playerid][pArrested] = dini_Int(string2, "Arrested");
    PlayerInfo[playerid][pWantedDeaths] = dini_Int(string2, "WantedDeaths");
    PlayerInfo[playerid][pPhoneBook] = dini_Int(string2, "Phonebook");
    PlayerInfo[playerid][pLottoNr] = dini_Int(string2, "LottoNr");
    PlayerInfo[playerid][pFishes] = dini_Int(string2, "Fishes");
    PlayerInfo[playerid][pBiggestFish] = dini_Int(string2, "BiggestFish");
    PlayerInfo[playerid][pJob] = dini_Int(string2, "Job");
    PlayerInfo[playerid][pPayCheck] = dini_Int(string2, "Paycheck");
    PlayerInfo[playerid][pHeadValue] = dini_Int(string2, "HeadValue");
    PlayerInfo[playerid][pJailed] = dini_Int(string2, "Jailed");
    PlayerInfo[playerid][pJailTime] = dini_Int(string2, "JailTime");
    PlayerInfo[playerid][pMats] = dini_Int(string2, "Materials");
    PlayerInfo[playerid][pDrugs] = dini_Int(string2, "Drugs");
    PlayerInfo[playerid][pLeader] = dini_Int(string2, "Leader");
    PlayerInfo[playerid][pMember] = dini_Int(string2, "Member");
    PlayerInfo[playerid][pFMember] = dini_Int(string2, "FMember");
    PlayerInfo[playerid][pRank] = dini_Int(string2, "Rank");
    PlayerInfo[playerid][pChar] = dini_Int(string2, "Char");
    PlayerInfo[playerid][pContractTime] = dini_Int(string2, "ContractTime");
    PlayerInfo[playerid][pDetSkill] = dini_Int(string2, "DetSkill");
    PlayerInfo[playerid][pSexSkill] = dini_Int(string2, "SexSkill");
    PlayerInfo[playerid][pBoxSkill] = dini_Int(string2, "BoxSkill");
    PlayerInfo[playerid][pLawSkill] = dini_Int(string2, "LawSkill");
    PlayerInfo[playerid][pMechSkill] = dini_Int(string2, "MechSkill");
    PlayerInfo[playerid][pJackSkill] = dini_Int(string2, "JackSkill");
    PlayerInfo[playerid][pCarSkill] = dini_Int(string2, "CarSkill");
    PlayerInfo[playerid][pNewsSkill] = dini_Int(string2, "NewsSkill");
    PlayerInfo[playerid][pDrugsSkill] = dini_Int(string2, "DrugsSkill");
    PlayerInfo[playerid][pCookSkill] = dini_Int(string2, "CookSkill");
    PlayerInfo[playerid][pFishSkill] = dini_Int(string2, "FishSkill");
    PlayerInfo[playerid][pSHealth] = dini_Int(string2, "pSHealth");
    PlayerInfo[playerid][pHealth] = dini_Int(string2, "pHealth");
    PlayerInfo[playerid][pInt] = dini_Int(string2, "Int");
    PlayerInfo[playerid][pLocal] = dini_Int(string2, "Local"); //
    PlayerInfo[playerid][pTeam] = dini_Int(string2, "Team");
    PlayerInfo[playerid][pModel] = dini_Int(string2, "Model");
    PlayerInfo[playerid][pPnumber] = dini_Int(string2, "PhoneNr");
    PlayerInfo[playerid][pPhousekey] = dini_Int(string2, "House");
    PlayerInfo[playerid][pPbiskey] = dini_Int(string2, "Bizz");
    PlayerInfo[playerid][pPos_x] = dini_Int(string2, "Pos_x");
    PlayerInfo[playerid][pPos_y] = dini_Int(string2, "Pos_y");
    PlayerInfo[playerid][pPos_z] = dini_Int(string2, "Pos_z");
    PlayerInfo[playerid][pCarLic] = dini_Int(string2, "CarLic");
    PlayerInfo[playerid][pTruckLic] = dini_Int(string2, "TruckLic");
    PlayerInfo[playerid][pBikeLic] = dini_Int(string2, "BikeLic");
    PlayerInfo[playerid][pFlyLic] = dini_Int(string2, "FlyLic");
    PlayerInfo[playerid][pBoatLic] = dini_Int(string2, "BoatLic");
    PlayerInfo[playerid][pFishLic] = dini_Int(string2, "FishLic");
    PlayerInfo[playerid][pGunLic] = dini_Int(string2, "GunLic");
    PlayerInfo[playerid][pGun1] = dini_Int(string2, "Gun1");
    PlayerInfo[playerid][pGun2] = dini_Int(string2, "Gun2");
    PlayerInfo[playerid][pGun3] = dini_Int(string2, "Gun3");
    PlayerInfo[playerid][pGun4] = dini_Int(string2, "Gun4");
    PlayerInfo[playerid][pAmmo1] = dini_Int(string2, "Ammo1");
    PlayerInfo[playerid][pAmmo2] = dini_Int(string2, "Ammo2");
    PlayerInfo[playerid][pAmmo3] = dini_Int(string2, "Ammo3");
    PlayerInfo[playerid][pAmmo4] = dini_Int(string2, "Ammo4");
    PlayerInfo[playerid][pCarTime] = dini_Int(string2, "CarTime");
    PlayerInfo[playerid][pPayDay] = dini_Int(string2, "PayDay");
    PlayerInfo[playerid][pPayDayZeit] = dini_Int(string2, "PayDayZeit");
    PlayerInfo[playerid][pPayDayHad] = dini_Int(string2, "PayDayHad");
    PlayerInfo[playerid][pCDPlayer] = dini_Int(string2, "CDPlayer");
    PlayerInfo[playerid][pWins] = dini_Int(string2, "Wins");
    PlayerInfo[playerid][pLoses] = dini_Int(string2, "Loses");
    PlayerInfo[playerid][pAlcoholPerk] = dini_Int(string2, "AlcoholPerk");
    PlayerInfo[playerid][pDrugPerk] = dini_Int(string2, "DrugPerk");
    PlayerInfo[playerid][pMiserPerk] = dini_Int(string2, "MiserPerk");
    PlayerInfo[playerid][pPainPerk] = dini_Int(string2, "PainPerk");
    PlayerInfo[playerid][pTraderPerk] = dini_Int(string2, "TraderPerk");
    PlayerInfo[playerid][pTut] = dini_Int(string2, "Tutorial");
    PlayerInfo[playerid][pMissionNr] = dini_Int(string2, "Mission");
    PlayerInfo[playerid][pWarns] = dini_Int(string2, "Warnings");
    PlayerInfo[playerid][pAdjustable] = dini_Int(string2, "Adjustable");
    PlayerInfo[playerid][pOwnPerso] = dini_Int(string2, "Perso");
    PlayerInfo[playerid][pGangJailed] = dini_Int(string2, "GangJailed");
    PlayerInfo[playerid][pFuel] = dini_Int(string2, "Fuel");
    PlayerInfo[playerid][pMarried] = dini_Int(string2, "Married");
    PlayerInfo[playerid][pMarriedTo] = dini_Int(string2, "MarriedTo");
    PlayerInfo[playerid][pMuteTime] = dini_Int(string2, "MuteTime");
    PlayerInfo[playerid][pPunkte] = dini_Int(string2, "Punkte");
    PlayerInfo[playerid][pMauled] = dini_Int(string2, "Mauled");
    PlayerInfo[playerid][pGehalt] = dini_Int(string2, "Gehalt");
    PlayerInfo[playerid][pFrakSperre] = dini_Int(string2, "FrakSperre");
    PlayerInfo[playerid][pGWD] = dini_Int(string2, "GWD");
    Knast[playerid] = dini_Int(string2, "Knast");
    KnastTime[playerid] = dini_Int(string2, "KnastTime");
    SpawnChange[playerid] = dini_Int(string2, "SpawnChange");
    WantedLevel[playerid] = SetPlayerWantedLevel(playerid, WantedLevel[playerid]);
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"{FFFFFF}GER | Login","{FFFFFF}\n{FF0000}Falsches Passwort! (verleibene Versuche: {FFFFFF}1{FF0000}){FFFFFF}\nDas Passwort ist nicht korrekt! Bitte gib nun dein richtiges Passwort ein:","Login","Abbrechen");
    gPlayerLogTries[playerid] += 1;
    pIstTot[playerid] = 0;
    PlayerInfo[playerid][pTod] = 0;
    if(gPlayerLogTries[playerid] == 2)
    {
    new string[128];
    new sendername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    pIstTot[playerid] = 0;
    PlayerInfo[playerid][pTod] = 0;
    format(string,sizeof(string),"%s wurde vom Server gekickt, Begründung: falsches Passwort (Login)",sendername);
    SendClientMessageToAll(COLOR_IRED,string);
    SendClientMessage(playerid,COLOR_IRED,"SERVER: Du hast zu oft das falsche Passwort angegeben, deshalb wurdest du gekickt!");
    SpawnPlayer(playerid);
    Kick(playerid);
    }
    return 1;
    }
    PlayerInfo[playerid][pAdjustable] = 0;
    ResetPlayerMoney(playerid);
    ConsumingMoney[playerid] = 1;
    GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]);
    CurrentMoney[playerid] = PlayerInfo[playerid][pCash];
    if(PlayerInfo[playerid][pReg] == 0)
    {
    PlayerInfo[playerid][pLevel] = 1;
    PlayerInfo[playerid][pSHealth] = 100.0;
    PlayerInfo[playerid][pHealth] = 100.0;
    PlayerInfo[playerid][pPos_x] = 1478.6859;
    PlayerInfo[playerid][pPos_y] = -1674.6659;
    PlayerInfo[playerid][pPos_z] = 14.0469;
    PlayerInfo[playerid][pInt] = 0;
    PlayerInfo[playerid][pLocal] = 255;
    PlayerInfo[playerid][pTeam] = 3;
    PlayerInfo[playerid][pModel] = 137;
    new randphone = 1000 + random(8999);//minimum 1000 max 9999 //giving one at the start
    PlayerInfo[playerid][pPnumber] = randphone;
    PlayerInfo[playerid][pPhousekey] = 255;
    PlayerInfo[playerid][pPbiskey] = 255;
    PlayerInfo[playerid][pAccount] = 0;
    PlayerInfo[playerid][pReg] = 1;
    GivePlayerMoney(playerid, 2000);
    }
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,sizeof(pName));
    format(tbDir,sizeof(tbDir),foxBanFile,pName);
    if(dini_Exists(tbDir))
    {
    if(dini_Int(tbDir,"fbTime")+dini_Int(tbDir,"fbDuration") > Time())
    {
    new sekki=(dini_Int(tbDir,"fbTime")+dini_Int(tbDir,"fbDuration"))-Time(),minni=sekki/60;
    sekki=sekki-minni*60;
    format(ALLSTRING,sizeof(ALLSTRING),"** Du wurdest für eine Weile vom Server gebannt. Restliche Zeit: %d Minuten %d Sekunden.",minni,sekki);
    SendClientMessage(playerid,COLOR_IRED,ALLSTRING);
    format(ALLSTRING,sizeof(ALLSTRING),"%s wurde vom Server gekickt, Begründung: Timeban", pName);
    SendClientMessageToAll(COLOR_IRED,ALLSTRING);
    Kick(playerid);
    } else { dini_Remove(tbDir); }
    }
    if(PlayerInfo[playerid][pLevel] == -999) //autoban
    {
    Ban(playerid);
    }
    else if(PlayerInfo[playerid][pCK] > 0)
    {
    Kick(playerid);
    }
    format(string2, sizeof(string2), "{FFA500}Information{FFFFFF}: Herzlich Willkommen zurück, %s!",playername2);
    SendClientMessage(playerid, COLOR_WHITE,string2);
    printf("%s has logged in.",playername2);
    if (PlayerInfo[playerid][pDonateRank] >= 1)
    {
    SendClientMessage(playerid, COLOR_WHITE,"{FFA500}Information{FFFFFF}: Du hast dich mit deinem Donator-Account {00FF00}erfolgreich{FFFFFF} eingeloggt!");
    }
    if (PlayerInfo[playerid][pAdmin] >= 1)
    {
    format(string2, sizeof(string2), "{FFA500}Information{FFFFFF}: Du bist dem Administratoren-Rang {FF0000}%d{FFFFFF} eingeloggt!",PlayerInfo[playerid][pAdmin]);
    SendClientMessage(playerid, COLOR_WHITE,string2);
    }
    SetSpawnInfo(playerid, PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pModel], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], 1.0, -1, -1, -1, -1, -1, -1);
    if(gTeam[playerid] == 0)
    {
    gTeam[playerid] = 3;
    }
    else
    {
    gTeam[playerid] = PlayerInfo[playerid][pTeam];
    }
    SpawnPlayer(playerid);
    gPlayerLogged[playerid] = 1;
    pIstTot[playerid] = 0;
    PlayerInfo[playerid][pTod] = 0;
    SetPlayerHealth(playerid,100);
    format(tmp2, sizeof(tmp2), "~w~Willkommen ~n~~y~ %s", playername2);
    DateProp(playerid);
    GameTextForPlayer(playerid, tmp2, 5000, 1);
    SendClientMessage(playerid, COLOR_YELLOW, motd);
    if(PlayerInfo[playerid][pFMember] < 255)
    {
    format(tmp2, sizeof(tmp2), "Familie MOTD: %s.", FamilyInfo[PlayerInfo[playerid][pFMember]][FamilyMOTD]);
    SendClientMessage(playerid, COLOR_YELLOW, tmp2);
    }
    }
    return 1;
    }


    Die Dialogid:

    if(dialogid == DIALOG_LOGIN)
    {
    if(response && strlen(inputtext) > 0)
    {
    OnPlayerLogin(playerid,inputtext);
    RegistrationStep[playerid]=0;
    }
    else
    {
    Kick(playerid);
    }
    }

  • So wird er dir das auch gar nicht printen. Wenn du eine Variable definierst die, wie in deinem Falle,
    dem Spieler das Leben auf 100 setzt, kannst du es dem Spieler auch per eigene Eingabe setzen, statt
    Ressourcen zu verschwenden.


    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


    //Ordne das ein, wo es deiner Meinung nach bei dir am besten hingehört.
    new Float:health, pleben[2];
    pleben[0] = GetPlayerHealth(playerid,health);
    pleben[1] = SetPlayerHealth(playerid,100);
    printf("Spieler Leben: %f; Spieler leben gesetzt: %f", pleben[0], pleben[1]);



    //...Weiterhin zu deinem Todestimer
    //Und dann halt TOTTimer aufrufen, indem du in ins gewünschte Public einsetzt bzw. in OnPlayerDeath so:

    public OnPlayerDeath(...)
    {
    pIstTot[playerid] += 1;
    PlayerInfo[playerid][pTod] = 1;
    SetTimerEx("TOTTimer", 60000, 1, "i", playerid);
    SetPVarInt(playerid,"tot_Skin",GetPlayerSkin(playerid));
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, "{FFA500}Information{FFFFFF}: Durch deine schweren Verletzungen liegst du im Koma!");
    SendClientMessage(playerid, COLOR_WHITE, "{FFA500}Information{FFFFFF}: Du befindest dich für 2 Minuten im Krankenhaus.");
    SendClientMessage(playerid, COLOR_WHITE, "{FFA500}Information{FFFFFF}: In 2 bis 3 Minuten kommst du wieder raus, da du gerade behandelt wirst.");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SetPlayerPos(playerid,941.7925,1734.3978,21.1277);
    SetPlayerCameraPos(playerid, 993.5776,1653.3435,10.3279);
    SetPlayerCameraLookAt(playerid, 949.7623,1748.0996,26.2525);
    TogglePlayerControllable(playerid, 0);
    ResetPlayerWeapons(playerid);
    SetPlayerInterior(playerid, 0);
    SetPlayerColor(playerid, COLOR_ZIVI);
    return 1;
    }



    public TOTTimer(playerid)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pTod] == 1)
    {
    //Dein gewünschter Code, wenn er tot ist, aber pIstTot noch nicht 2 ist, sondern 1 oder so.
    }
    else if(PlayerInfo[playerid][pTod] == 1 && pIstTot[playerid] == 2)
    {
    PlayerInfo[playerid][pTod] = 0;
    pIstTot[playerid] = 0;
    SetPlayerVirtualWorld(playerid,0);
    SendClientMessage(playerid, COLOR_WHITE, "{FFA500}Information{FFFFFF}: Du bist nun aus dem Krankenhaus entlassen!");
    SetPlayerSkin(playerid,GetPVarInt(playerid,"tot_Skin"));
    TogglePlayerControllable(playerid,1);
    SpawnPlayer(playerid);
    }
    else return 1;
    }
    }


    Ich hoffe, ich konnte dir helfen und es funktioniert nun so, wie du es dir wünscht und hoffen wir mal, dass es nun auch richtig printet.


    Mit freundlichen Grüßen


    Kristik47

    Einmal editiert, zuletzt von Kristik47 ()

  • Derzeitigen Code bitte.


    pIstTot[playerid] += 1;
    PlayerInfo[playerid][pTod] = 1;
    SetTimerEx("TOTTimer", 60000, 1, "i", playerid);
    SetPVarInt(playerid,"tot_Skin",GetPlayerSkin(playerid));
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, "{FFA500}Information{FFFFFF}: Durch deine schweren Verletzungen liegst du im Koma!");
    SendClientMessage(playerid, COLOR_WHITE, "{FFA500}Information{FFFFFF}: Du befindest dich für 2 Minuten im Krankenhaus.");
    SendClientMessage(playerid, COLOR_WHITE, "{FFA500}Information{FFFFFF}: In 2 bis 3 Minuten kommst du wieder raus, da du gerade behandelt wirst.");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SetPlayerPos(playerid,941.7925,1734.3978,21.1277);
    SetPlayerCameraPos(playerid, 993.5776,1653.3435,10.3279);
    SetPlayerCameraLookAt(playerid, 949.7623,1748.0996,26.2525);
    TogglePlayerControllable(playerid, 0);
    ResetPlayerWeapons(playerid);
    SetPlayerInterior(playerid, 0);
    SetPlayerColor(playerid, COLOR_ZIVI);
    ClearCrime(playerid);

    der TOTTimer:

    public TOTTimer(playerid)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pTod] == 1 && pIstTot[playerid] == 2)
    {
    PlayerInfo[playerid][pTod] = 0;
    pIstTot[playerid] = 0;
    SetPlayerVirtualWorld(playerid,0);
    SendClientMessage(playerid, COLOR_WHITE, "{FFA500}Information{FFFFFF}: Du bist nun aus dem Krankenhaus entlassen!");
    SetPlayerSkin(playerid,GetPVarInt(playerid,"tot_Skin"));
    TogglePlayerControllable(playerid,1);
    SpawnPlayer(playerid);
    }
    else return 1;
    }
    return true;
    }


  • pIstTot[playerid] += 1;
    PlayerInfo[playerid][pTod] = 1;
    SetTimerEx("TOTTimer", 120000, 0, "i", playerid); //Fehler sollte hier liegen - bin mir nicht ganz sicher
    SetPVarInt(playerid,"tot_Skin",GetPlayerSkin(playerid));
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, "{FFA500}Information{FFFFFF}: Durch deine schweren Verletzungen liegst du im Koma!");
    SendClientMessage(playerid, COLOR_WHITE, "{FFA500}Information{FFFFFF}: Du befindest dich für 2 Minuten im Krankenhaus.");
    SendClientMessage(playerid, COLOR_WHITE, "{FFA500}Information{FFFFFF}: In 2 bis 3 Minuten kommst du wieder raus, da du gerade behandelt wirst.");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SetPlayerPos(playerid,941.7925,1734.3978,21.1277);
    SetPlayerCameraPos(playerid, 993.5776,1653.3435,10.3279);
    SetPlayerCameraLookAt(playerid, 949.7623,1748.0996,26.2525);
    TogglePlayerControllable(playerid, 0);
    ResetPlayerWeapons(playerid);
    SetPlayerInterior(playerid, 0); //Das richtige Interior, in dem er sich befindet, setzen und dann sollte es funktionieren.
    SetPlayerColor(playerid, COLOR_ZIVI);
    ClearCrime(playerid);


    //Ich hoffe, dass du diesen Code bei OnPlayerDeath eingesetzt hast, ansonsten wirds auch nicht funktionieren.
    //Wenns nicht funktioniert, dann weiß ich leider auch nicht weiter.


    public TOTTimer(playerid)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pTod] == 1 && pIstTot[playerid] == 2)
    {
    PlayerInfo[playerid][pTod] = 0;
    pIstTot[playerid] = 0;
    SetPlayerVirtualWorld(playerid,0);
    SendClientMessage(playerid, COLOR_WHITE, "{FFA500}Information{FFFFFF}: Du bist nun aus dem Krankenhaus entlassen!");
    SetPVarInt(playerid,GetPVarInt(playerid,"tot_Skin"));
    TogglePlayerControllable(playerid,1);
    SpawnPlayer(playerid);
    }
    else if(PlayerInfo[playerid][pTod] == 1 && pIstTot[playerid] != 2)
    {
    //Dein Code, wenn er gestorben ist, aber nicht pIstTod auf 2 ist.
    }
    else return 1;
    }
    return 1;
    }

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