Beiträge von CrueL

    if(strcmp(cmd, "/kick", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "BENUTZE: /kick [PlayerID/Name] [Grund]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if(Spieler[playerid][Admin] >= 3)
    {
    if(IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    new length = strlen(cmdtext);
    while ((idx < length) && (cmdtext[idx] <= ' '))
    {
    idx++;
    }
    new offset = idx;
    new result[64];
    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
    {
    result[idx - offset] = cmdtext[idx];
    idx++;
    }
    result[idx - offset] = EOS;
    if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "BENUTZE: /kick [PlayerID/Name] [Grund]");
    return 1;
    }
    new year, month,day;
    getdate(year, month, day);
    format(string, sizeof(string), "AdmCmd: %s wurde von %s gekickt, Grund: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
    KickLog(string);
    format(string, sizeof(string), "AdmCmd: %s wurde von %s gekickt, Grund: %s", giveplayer, sendername, (result));
    SendClientMessageToAll(COLOR_LIGHTRED, string);
    Kick(giveplayerid);
    return 1;
    }
    }
    else
    {
    format(string, sizeof(string), "%d ist kein aktiver Spieler.", giveplayerid);
    SendClientMessage(playerid, COLOR_GRAD1, string);
    }
    }
    return 1;
    }

    Anleitung für das Hinzufügen neuer Maps!


    Zunächst solltest du den Quellcode der Objekte hinzufügen:


    stock LoadMap()
    {
    if(MapStatus == 0)
    {
    // ...
    }
    else if(MapStatus == 1) // < 1 durch deine Map ersetzen! (Falls es zum Beispiel bereits eine Map gibt, solltest du die 0 in dem Fall durch die 1 ersetzen)
    {
    //Hier der Code
    }
    }


    Anschließend solltest du, da du nun eine zweite Maps hast, unter "public NeueRunde()" folgendes auskommentieren:
    Vergiss nicht "MAX_MAPS" pro hinzugefügter Map, einen Wert höherzusetzen.

    if(MapStatus >= MAX_MAPS)
    {
    MapStatus = 0;
    }
    else
    {
    MapStatus ++;
    }
    //Erst einsetzen, sobald mehrere Maps vorhanden sind.


    Nun müssen die Spawn Koordinaten für die neue Map deklariert werden:


    //=================MAP-0==================
    new Float:RandomTerroristSpawn_MAP0[][4] = //MAP: Bohrinsel by Viper
    {
    {428.0871,-3010.1772,20.1679,131.5774}, //TERRORIST_SPAWN_NEW1
    {429.9714,-3029.3347,20.1679,45.0966}, //TERRORIST_SPAWN_NEW2
    {341.5532,-3073.6931,16.9875,343.3692}, //TERRORIST_SPAWN_NEW3
    {367.5688,-3014.2917,17.0104,83.5900}, //TERRORIST_SPAWN_NEW4
    {355.0757,-3019.5112,17.0248,288.1755}, //TERRORIST_SPAWN_NEW5
    {381.4002,-2993.8557,18.4809,179.1576}, //TERRORIST_SPAWN_NEW6
    {316.7557,-3017.1697,17.0264,325.1489}, //TERRORIST_SPAWN_NEW7
    {315.5986,-2971.5220,17.0119,196.0543} //TERRORIST_SPAWN_NEW8
    };
    new Float:RandomCTerroristSpawn_MAP0[][4] = //MAP: Bohrinsel by Viper
    {
    {345.1668,-2967.3567,3.8303,135.8936}, //COUNTER_TERRORIST_SPAWN_NEW1
    {314.4386,-2971.5730,3.8262,207.3343}, //COUNTER_TERRORIST_SPAWN_NEW2
    {318.8269,-2955.7024,2.5307,186.6540}, //COUNTER_TERRORIST_SPAWN_NEW3
    {344.6979,-2969.3035,3.8255,127.4336}, //COUNTER_TERRORIST_SPAWN_NEW4
    {343.4093,-2999.1848,3.8248,59.1263}, //COUNTER_TERRORIST_SPAWN_NEW5
    {326.4463,-2986.4290,3.8331,176.6041}, //COUNTER_TERRORIST_SPAWN_NEW6
    {311.9734,-3001.5444,3.8334,319.7754}, //COUNTER_TERRORIST_SPAWN_NEW7
    {325.3206,-2979.4104,3.8287,16.1760} //COUNTER_TERRORIST_SPAWN_NEW8
    };
    //========================================


    //=================MAP-1==================
    new Float:RandomTerroristSpawn_MAP1[][4] = //MAP: "Neue Map" <<<<<<<<<<<
    {
    {428.0871,-3010.1772,20.1679,131.5774}, //TERRORIST_SPAWN_NEW1
    {429.9714,-3029.3347,20.1679,45.0966}, //TERRORIST_SPAWN_NEW2
    {341.5532,-3073.6931,16.9875,343.3692}, //TERRORIST_SPAWN_NEW3
    {367.5688,-3014.2917,17.0104,83.5900}, //TERRORIST_SPAWN_NEW4
    {355.0757,-3019.5112,17.0248,288.1755}, //TERRORIST_SPAWN_NEW5
    {381.4002,-2993.8557,18.4809,179.1576}, //TERRORIST_SPAWN_NEW6
    {316.7557,-3017.1697,17.0264,325.1489}, //TERRORIST_SPAWN_NEW7
    {315.5986,-2971.5220,17.0119,196.0543} //TERRORIST_SPAWN_NEW8
    };
    new Float:RandomCTerroristSpawn_MAP1[][4] = //MAP: "Neue Map" <<<<<<<<<<<
    {
    {345.1668,-2967.3567,3.8303,135.8936}, //COUNTER_TERRORIST_SPAWN_NEW1
    {314.4386,-2971.5730,3.8262,207.3343}, //COUNTER_TERRORIST_SPAWN_NEW2
    {318.8269,-2955.7024,2.5307,186.6540}, //COUNTER_TERRORIST_SPAWN_NEW3
    {344.6979,-2969.3035,3.8255,127.4336}, //COUNTER_TERRORIST_SPAWN_NEW4
    {343.4093,-2999.1848,3.8248,59.1263}, //COUNTER_TERRORIST_SPAWN_NEW5
    {326.4463,-2986.4290,3.8331,176.6041}, //COUNTER_TERRORIST_SPAWN_NEW6
    {311.9734,-3001.5444,3.8334,319.7754}, //COUNTER_TERRORIST_SPAWN_NEW7
    {325.3206,-2979.4104,3.8287,16.1760} //COUNTER_TERRORIST_SPAWN_NEW8
    };
    //========================================


    Nun hast du den zu zufälligen Spawn deklariert.


    Allerdings musst du unter:


    if(MapStatus == 0)//MAP: Bohrinsel by Viper
    {
    if(gTeam[playerid] == TEAM_TERRORIST)
    {
    new rand = random(sizeof(RandomTerroristSpawn_MAP0));
    SetPlayerPos(playerid, RandomTerroristSpawn_MAP0[rand][0], RandomTerroristSpawn_MAP0[rand][1],RandomTerroristSpawn_MAP0[rand][2]);
    SetPlayerFacingAngle(playerid, RandomTerroristSpawn_MAP0[rand][3]);
    }
    else if(gTeam[playerid] == TEAM_COUNTER_TERRORIST)
    {
    new rand = random(sizeof(RandomCTerroristSpawn_MAP0));
    SetPlayerPos(playerid, RandomCTerroristSpawn_MAP0[rand][0], RandomCTerroristSpawn_MAP0[rand][1],RandomCTerroristSpawn_MAP0[rand][2]);
    SetPlayerFacingAngle(playerid, RandomCTerroristSpawn_MAP0[rand][3]);
    }
    }


    bei public OnPlayerSpawn(playerid) noch dies hinzufügen:




    }
    else if(MapStatus == 1)//MAP: "Neue Map"<<<<<<<<<<<<<
    {
    if(gTeam[playerid] == TEAM_TERRORIST)
    {
    new rand = random(sizeof(RandomTerroristSpawn_MAP1));
    SetPlayerPos(playerid, RandomTerroristSpawn_MAP1[rand][0], RandomTerroristSpawn_MAP1[rand][1],RandomTerroristSpawn_MAP1[rand][2]);
    SetPlayerFacingAngle(playerid, RandomTerroristSpawn_MAP1[rand][3]);
    }
    else if(gTeam[playerid] == TEAM_COUNTER_TERRORIST)
    {
    new rand = random(sizeof(RandomCTerroristSpawn_MAP1));
    SetPlayerPos(playerid, RandomCTerroristSpawn_MAP1[rand][0], RandomCTerroristSpawn_MAP1[rand][1],RandomCTerroristSpawn_MAP1[rand][2]);
    SetPlayerFacingAngle(playerid, RandomCTerroristSpawn_MAP1[rand][3]);
    }
    }


    Ich hoffe die Anleitung ist halbwegs verständlich!


    MfG K4biX

    SetTimerEx("UpdateLeben", 100, true, "i", playerid);
    TextDrawShowForPlayer(playerid, Lebensanzeige[playerid]);


    public UpdateLeben(playerid)
    {
    new Float:lebenvonplayer;
    GetPlayerHealth(playerid, lebenvonplayer);
    new string[256];
    format(string, sizeof(string)," %.1f",lebenvonplayer);
    TextDrawSetString(Lebensanzeige[playerid],string);
    }



    und das new Lebenanzeige;


    in


    new Lebensanzeige[MAX_PLAYERS];


    ersetzen.


    Außerdem musst du das Textdraw nun unter public OnPlayerConnect(playerid)


    erstellen und alle TextDraw definitionen die sich Lebensanzeige nennen in Lebensanzeige[playerid]


    umbenennen!

    Moment, versuch mal noch schnell:


    Unter: OnPlayerSpawn(playerid);

    SetPlayerPos(playerid,sSpieler[playerid][X],sSpieler[playerid][Y],sSpieler[playerid][Z]);



    Das new aber entfernen!

    Manno, wenn ich jetzt nicht so unter Zeitdruck stehen würde, könnte ich dir helfen. Ich muss nun aber leider weg. Wünsche dir viel Erfolg. Wenn du es später noch immer nicht geschafft hast, kann ich das per Teamviewer machen!


    Sorry!! :(


    MfG