pTod = 1 Funktioniert 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,
    Ich habe probiert das so zu erstellen das wen jemand einen umbringt das dieser +1 Verbrechen bekommt und wenm der Player so stirbt einfach auf den Friedhof kommt.


    Leider klappt es mit dem Normalen sterben nicht so wie es soll ;/


    public OnPlayerDeath(playerid, killerid, reason)
    {
    PlayerInfo[playerid][pTod] = 1;
    if(IsPlayerConnected(killerid) && killerid != playerid)
    {
    SendClientMessage(killerid,Rot, "Du hast ein Verbrechen begangen! (Mord) Reporter: Anonym");
    PlayerInfo[killerid][Verbrechen] += 1;
    SendClientMessage(playerid,Rot,"Du bist Gestorben! Grund: Unbekannt");
    PlayerInfo[playerid][pTod] = 1;
    GivePlayerMoney(playerid, 100);
    }
    PlayerInfo[playerid][InSkinChange] = false;
    PlayerInfo[playerid][Duty] = false;
    if(PlayerInfo[playerid][pTod] == 0) PlayerInfo[playerid][pTod] = 1;
    return 1;
    }


    Wen der Player Normal Stirbt soll ebenfalls kommen:


    SendClientMessage(playerid,Rot,"Du bist Gestorben! Grund: Unbekannt");



    Danke

    ↓Das ist der Youtube Channel von mir und meinen Kollegen↓



    Sa-Mp Server [Im Aufbau/Beta]
    128.65.216.200:7777

  • Ich weiß nicht wieso aber geht immer noch nicht mal der ganze Code!


    //-Friedhof
    forward WegVonFriedhof(playerid);


    public OnPlayerSpawn(playerid)
    if(PlayerInfo[playerid][pTod] == 1)
    {
    SetPlayerPos(playerid, 816.9099,-1102.9124,25.7917);
    SetPlayerWorldBounds(playerid, 20.0, 0.0, 20.0, 0.0);
    SetTimerEx("WegVonFriedhof", 120000, 0, "d", playerid);
    PlayerInfo[playerid][pTod] = 2; //Falls er auf dem Friedhof stirbt, dass der Timer nicht nochmal gestartet wird.
    }


    dcmd_friedhof(playerid,params[])
    {
    #pragma unused params
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pTod] >= 1)
    {
    new chat[128];
    new secs = PlayerInfo[playerid][pTod]-gettime();
    format(chat, sizeof(chat), "Du bist noch für ca %d Sekunden auf dem Friedhof",secs);
    SendClientMessage(playerid, Grün, chat);
    }
    else
    {
    SendClientMessage(playerid, Rot, "Du bist nicht auf dem Friedhof.");
    }
    }
    return 1;
    }


    public WegVonFriedhof(playerid)
    {
    PlayerInfo[playerid][pTod] = 0;
    SetPlayerPos(playerid, 816.9099,-1102.9124,25.7917);
    SetPlayerWorldBounds(playerid, 99999.0, -99999.0, 99999.0, -99999.0);
    return 1;
    }


    public OnPlayerDeath(playerid, killerid, reason)
    {
    if(killerid == INVALID_PLAYER_ID)
    PlayerInfo[playerid][pTod] = 1;
    if(IsPlayerConnected(killerid) && killerid != playerid)
    {
    SendClientMessage(killerid,Rot, "Du hast ein Verbrechen begangen! (Mord) Reporter: Anonym");
    PlayerInfo[killerid][Verbrechen] += 1;
    SendClientMessage(playerid,Rot,"Du bist Gestorben! Grund: Unbekannt");
    PlayerInfo[playerid][pTod] = 1;
    GivePlayerMoney(playerid, 100);
    }
    PlayerInfo[playerid][InSkinChange] = false;
    PlayerInfo[playerid][Duty] = false;
    if(PlayerInfo[playerid][pTod] == 0) PlayerInfo[playerid][pTod] = 1;
    return 1;
    }


    Bitte um schnelle hilfe

    ↓Das ist der Youtube Channel von mir und meinen Kollegen↓



    Sa-Mp Server [Im Aufbau/Beta]
    128.65.216.200:7777

  • public OnPlayerDeath(playerid, killerid, reason)
    {
    if(killerid == INVALID_PLAYER_ID)
    {
    //Wenn der Spieler Selbstmord gemacht hat!
    PlayerInfo[playerid][pTod] = 1;
    }
    else if(killerid != INVALID_PLAYER_ID)
    {
    SendClientMessage(killerid,Rot, "Du hast ein Verbrechen begangen! (Mord) Reporter: Anonym");
    PlayerInfo[killerid][Verbrechen] += 1;
    SendClientMessage(playerid,Rot,"Du bist Gestorben! Grund: Unbekannt");
    PlayerInfo[playerid][pTod] = 1;
    GivePlayerMoney(playerid, 100);
    }
    PlayerInfo[playerid][InSkinChange] = false;
    PlayerInfo[playerid][Duty] = false;
    return 1;
    }
    Vielleicht hilft dir das weiter? :)

  • Also jetzt kommt:


    Du bist Gestorben! Grund: Selbstmord


    public OnPlayerDeath(playerid, killerid, reason)
    {
    if(killerid == INVALID_PLAYER_ID)
    {
    SendClientMessage(playerid,Rot,"Du bist Gestorben! Grund: Selbstmord");
    PlayerInfo[playerid][pTod] = 1;
    }
    else if(killerid != INVALID_PLAYER_ID)
    {
    SendClientMessage(killerid,Rot, "Du hast ein Verbrechen begangen! (Mord) Reporter: Anonym");
    PlayerInfo[killerid][Verbrechen] += 1;
    SendClientMessage(playerid,Rot,"Du bist Gestorben! Grund: Unbekannt");
    PlayerInfo[playerid][pTod] = 1;
    GivePlayerMoney(playerid, 100);
    }
    PlayerInfo[playerid][InSkinChange] = false;
    PlayerInfo[playerid][Duty] = false;
    return 1;
    }


    Aber auf dem Friedhof komme ich immer noch net :/

    ↓Das ist der Youtube Channel von mir und meinen Kollegen↓



    Sa-Mp Server [Im Aufbau/Beta]
    128.65.216.200:7777

  • public OnPlayerSpawn(playerid)
    {
    new SSkin = PlayerInfo[playerid][Skin];
    SetPlayerSkin(playerid,SSkin);
    SetPlayerColor(playerid,Weiß);
    SetPlayerHealth(playerid,75.0);
    SetTimerEx("HealthLoss",380*1000,true,"if",playerid,0.5);
    if(Eingeloggt[playerid] == 0)
    {
    SendClientMessage(playerid,Rot,"Du wurdest gekickt Grund: gespawnt ohne einloggen!");
    Kick(playerid);
    return 1;
    }
    if(PlayerDeathTime[playerid] == 1)
    {
    SetPlayerPos(playerid, 0,0,0);
    }
    if(PlayerInfo[playerid][Gebannt] == 1)
    {
    SendClientMessage(playerid,Rot,"Du bist auf dem Server gebannt!");
    Kick(playerid);
    return 1;
    }
    if(PlayerInfo[playerid][pTod] == 1)
    {
    SetPlayerPos(playerid, 816.9099,-1102.9124,25.7917);
    SetPlayerWorldBounds(playerid, 20.0, 0.0, 20.0, 0.0);
    SetTimerEx("WegVonFriedhof", 120000, 0, "d", playerid);
    PlayerInfo[playerid][pTod] = 2; //Falls er auf dem Friedhof stirbt, dass der Timer nicht nochmal gestartet wird.
    }
    if(PlayerInfo[playerid][Register] == 0) //Erster Spawn
    {
    SetPlayerInterior(playerid,0);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerFacingAngle(playerid,29.3707);
    SetPlayerPos(playerid,1618.3164,-1893.8080,13.5488);
    ShowPlayerDialog(playerid,DIALOG_SEX,DIALOG_STYLE_LIST,"Geschlechtsangabe","Männlich\nWeiblich","Weiter","Beenden");
    PlayerInfo[playerid][Register] = 1;
    for(new i; i < 15; i++)
    {
    TextDrawHideForPlayer(playerid,LoadScreen[i]);
    }
    return 1;
    }
    if(PlayerInfo[playerid][Beruf] == 0 || PlayerInfo[playerid][Leader] == 0) //Normaler Spawn
    {
    SetPlayerInterior(playerid,0);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerFacingAngle(playerid,29.3707);
    SetPlayerPos(playerid,1618.3164,-1893.8080,13.5488);
    for(new i; i < 15; i++)
    {
    TextDrawHideForPlayer(playerid,LoadScreen[i]);
    }
    return 1;
    }
    if(PlayerInfo[playerid][Beruf] == 1 || PlayerInfo[playerid][Leader] == 1) //Lspd spawn
    {
    SetPlayerInterior(playerid,6);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerFacingAngle(playerid,180.7915);
    SetPlayerPos(playerid,235.2845,78.5378,1005.0391);
    }
    if(PlayerInfo[playerid][Beruf] == 2 || PlayerInfo[playerid][Leader] == 2) //Fbi Spawn
    {
    SetPlayerInterior(playerid,10);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerFacingAngle(playerid,274.5458);
    SetPlayerPos(playerid,234.4237,112.8228,1003.2257);


    }
    if(PlayerInfo[playerid][Beruf] == 3 || PlayerInfo[playerid][Leader] == 3) //Army Spawn
    {
    SetPlayerInterior(playerid,0);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerFacingAngle(playerid,2.1535);
    SetPlayerPos(playerid,246.3512,1859.8833,14.0840);
    }
    if(PlayerInfo[playerid][Beruf] == 4 || PlayerInfo[playerid][Leader] == 4) //Medic Spawn
    {
    SetPlayerInterior(playerid,0);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerFacingAngle(playerid,269.2677);
    SetPlayerPos(playerid,1172.2593,-1323.3839,15.4031);
    }
    if(PlayerInfo[playerid][Beruf] == 5 || PlayerInfo[playerid][Leader] == 5) //Fahrschule Spawn
    {
    SetPlayerInterior(playerid,3);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerFacingAngle(playerid,268.8902);
    SetPlayerPos(playerid,-2035.2633,-117.5481,1035.17198);
    if(PlayerInfo[playerid][fskin]) SetPlayerSkin(playerid,PlayerInfo[playerid][fskin]);
    }
    if(PlayerInfo[playerid][Beruf] == 6 || PlayerInfo[playerid][Leader] == 6) //Taxi Spawn
    {
    SetPlayerInterior(playerid,0);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerFacingAngle(playerid,29.3707);
    SetPlayerPos(playerid,1618.3164,-1893.8080,13.5488);
    if(PlayerInfo[playerid][fskin]) SetPlayerSkin(playerid,PlayerInfo[playerid][fskin]);
    }
    if(PlayerInfo[playerid][Beruf] == 7 || PlayerInfo[playerid][Leader] == 7) //Präsident Spawn
    {
    SetPlayerInterior(playerid,12);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerFacingAngle(playerid,307.5094);
    SetPlayerPos(playerid,2310.5024,-1141.3074,1054.3047);
    if(PlayerInfo[playerid][fskin]) SetPlayerSkin(playerid,PlayerInfo[playerid][fskin]);
    }
    if(PlayerInfo[playerid][Beruf] == 8 || PlayerInfo[playerid][Leader] == 8) //Sa-News Spawn
    {
    SetPlayerInterior(playerid,0);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerFacingAngle(playerid,300.1763);
    SetPlayerPos(playerid,-2057.7615,461.0594,35.1723);
    if(PlayerInfo[playerid][fskin]) SetPlayerSkin(playerid,PlayerInfo[playerid][fskin]);
    }
    if(PlayerInfo[playerid][Beruf] == 9 || PlayerInfo[playerid][Leader] == 9) //Ordnugsamt Spawn
    {
    SetPlayerInterior(playerid,0);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerFacingAngle(playerid,29.3707);
    SetPlayerPos(playerid,1618.3164,-1893.8080,13.5488);
    if(PlayerInfo[playerid][fskin]) SetPlayerSkin(playerid,PlayerInfo[playerid][fskin]);
    }
    if(PlayerInfo[playerid][Beruf] == 10 || PlayerInfo[playerid][Leader] == 10) //Groove Spawn
    {
    SetPlayerInterior(playerid,3);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerFacingAngle(playerid,165.3557);
    SetPlayerPos(playerid,2493.1985,-1702.5251,1018.3438);
    GivePlayerWeapon(playerid, 24, 250); GivePlayerWeapon(playerid, 5, 1);
    if(PlayerInfo[playerid][fskin]) SetPlayerSkin(playerid,PlayerInfo[playerid][fskin]);
    }
    if(PlayerInfo[playerid][Beruf] == 11 || PlayerInfo[playerid][Leader] == 11) //LCN Spawn
    {
    SetPlayerInterior(playerid,6);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerFacingAngle(playerid,180.0280);
    SetPlayerPos(playerid,748.3709,1437.8376,1102.9531);
    GivePlayerWeapon(playerid, 24, 250); GivePlayerWeapon(playerid, 5, 1);
    if(PlayerInfo[playerid][fskin]) SetPlayerSkin(playerid,PlayerInfo[playerid][fskin]);
    }
    if(PlayerInfo[playerid][Beruf] == 12 || PlayerInfo[playerid][Leader] == 12) //Ballas Spawn
    {
    SetPlayerInterior(playerid,1);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerFacingAngle(playerid,92.1924);
    SetPlayerPos(playerid,247.9777,304.9957,999.1484);
    GivePlayerWeapon(playerid, 24, 250); GivePlayerWeapon(playerid, 5, 1);
    if(PlayerInfo[playerid][fskin]) SetPlayerSkin(playerid,PlayerInfo[playerid][fskin]);
    }
    if(PlayerInfo[playerid][Beruf] == 13 || PlayerInfo[playerid][Leader] == 13) //Biker Spawn
    {
    SetPlayerInterior(playerid,18);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerFacingAngle(playerid,132.6569);
    SetPlayerPos(playerid,-219.1431,1406.3580,27.7734);
    GivePlayerWeapon(playerid, 24, 250); GivePlayerWeapon(playerid, 5, 1);
    if(PlayerInfo[playerid][fskin]) SetPlayerSkin(playerid,PlayerInfo[playerid][fskin]);
    }
    if(PlayerInfo[playerid][Beruf] == 14 || PlayerInfo[playerid][Leader] == 14) //Los Vagos
    {
    SetPlayerInterior(playerid,8);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerFacingAngle(playerid,88.5492);
    SetPlayerPos(playerid,2817.5002,-1166.6471,1029.1719);
    GivePlayerWeapon(playerid, 24, 250); GivePlayerWeapon(playerid, 5, 1);
    if(PlayerInfo[playerid][fskin]) SetPlayerSkin(playerid,PlayerInfo[playerid][fskin]);
    }
    if(PlayerInfo[playerid][Beruf] == 15 || PlayerInfo[playerid][Leader] == 15) //Yakuzza Spawn
    {
    SetPlayerInterior(playerid,1);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerFacingAngle(playerid,289.9613);
    SetPlayerPos(playerid,-2455.4277,-140.7562,26.1520);
    GivePlayerWeapon(playerid, 24, 250); GivePlayerWeapon(playerid, 5, 1);
    if(PlayerInfo[playerid][fskin]) SetPlayerSkin(playerid,PlayerInfo[playerid][fskin]);
    }
    if(PlayerInfo[playerid][Beruf] == 16 || PlayerInfo[playerid][Leader] == 16) // Rifa Spawn
    {
    SetPlayerInterior(playerid,2);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerFacingAngle(playerid,29.3707);
    SetPlayerPos(playerid,2449.3406,-1702.1798,1013.5078);
    GivePlayerWeapon(playerid, 24, 250); GivePlayerWeapon(playerid, 5, 1);
    if(PlayerInfo[playerid][fskin]) SetPlayerSkin(playerid,PlayerInfo[playerid][fskin]);
    }
    if(PlayerInfo[playerid][Beruf] == 17 || PlayerInfo[playerid][Leader] == 17) // Terror Spawn
    {
    SetPlayerInterior(playerid,0);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerFacingAngle(playerid,91.1871);
    SetPlayerPos(playerid,-1078.6906,-1625.7488,76.7029);
    GivePlayerWeapon(playerid, 24, 250); GivePlayerWeapon(playerid, 5, 1);
    if(PlayerInfo[playerid][fskin]) SetPlayerSkin(playerid,PlayerInfo[playerid][fskin]);
    }
    for(new i; i < 15; i++)
    {
    TextDrawHideForPlayer(playerid,LoadScreen[i]);
    }
    return 1;
    }

    ↓Das ist der Youtube Channel von mir und meinen Kollegen↓



    Sa-Mp Server [Im Aufbau/Beta]
    128.65.216.200:7777

  • if(PlayerInfo[playerid][pTod] == 1)
    {
    SetPlayerPos(playerid, 816.9099,-1102.9124,25.7917);
    SetPlayerWorldBounds(playerid, 20.0, 0.0, 20.0, 0.0);
    SetTimerEx("WegVonFriedhof", 120000, 0, "d", playerid);
    PlayerInfo[playerid][pTod] = 2; //Falls er auf dem Friedhof stirbt, dass der Timer nicht nochmal gestartet wird.
    return 1;//Das fehlte
    }
    Setz da einfach ein return 1; rein :)
    Wahrscheinlich wurde er auf dem Friedhof gespawnt, aber dadurch das der Code weiter lief, zum Spawn von der Fraktion gespawnt.

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