Was ist Hier falsch?

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
  • Was ist Hier Falsch??



    #include <a_samp>
    #include <core>
    #include <float>
    static gTeam[MAX_PLAYERS];
    new gPlayerClass[MAX_PLAYERS];
    #define COLOR_GREY 0xAFAFAFAA
    #define COLOR_GREEN 0x33AA33AA
    #define COLOR_RED 0xAA3333AA
    #define COLOR_YELLOW 0xFFFF00AA
    #define COLOR_PINK 0xFF66FFAA
    #define COLOR_BLUE 0x0000BBAA
    #define COLOR_LIGHTBLUE 0x33CCFFAA
    #define COLOR_DARKRED 0x660000AA
    #define COLOR_ORANGE 0xFF9900AA
    #define TEAM_TERRORIST
    #define TEAM_COUNTER_TERRORIST



    // Round duration


    //new gRoundTime = 3600000; // 60 mins


    //new gRoundTime = 900000; //15 mins


    //new gRoundTime = 300000; // 5 mins




    //------------------------------------------------------------------------------


    main()
    {
    }


    //------------------------------------------------------------------------------


    public OnGameModeInit()
    {
    SetGameModeText("San Fierro TDM");
    SetTeamCount(2);
    SetWorldTime(12);
    AddPlayerClass(285,2776.2981,-2379.0464,16.2244,88.4118,16,3,4,1,22,22); // CT
    AddPlayerClass(258,2536.9382,-2535.7244,13.6250,268.8935,16,3,4,1,22,22); // T
    return 1;
    }




    //------------------------------------------------------------------------------




    public OnPlayerConnect(playerid)
    {
    GameTextForPlayer(playerid,"Counter Strike",2500,5);
    GivePlayerMoney(playerid, 2000);
    SetPlayerColor(playerid, COLOR_GREY);
    return 1;
    }




    //------------------------------------------------------------------------------




    public OnPlayerSpawn(playerid)
    {
    if(gTeam[playerid] == TEAM_TERRORIST)
    {
    SetPlayerColor(playerid,COLOR_RED); // Green
    }
    if(gTeam[playerid] == TEAM_COUNTER_TERRORIST)
    {
    SetPlayerColor(playerid,COLOR_GREEN); // Red
    }
    return 1;
    }




    //------------------------------------------------------------------------------




    public OnPlayerDeath(playerid, killerid, reason)
    {
    if(killerid == INVALID_PLAYER_ID) {
    SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
    } else {
    if(gTeam[killerid] != gTeam[playerid]) {
    // Valid kill
    SendDeathMessage(killerid,playerid,reason);
    SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
    GivePlayerMoney(killerid, 1000);
    }
    else {
    //Team Killer!
    new warning[256];
    format(warning, sizeof(warning), "Du hast Teamkill Begangen, dir wurden 1000$ abgezogen.");
    SendClientMessage(killerid, 0xFFFF00AA, warning);
    SendDeathMessage(killerid,playerid,reason);
    GivePlayerMoney(killerid, -1000);
    SetPlayerScore(killerid, GetPlayerScore(killerid) - 1);
    }
    }
    return 1;
    }




    //------------------------------------------------------------------------------




    public SetupPlayerForClassSelection(playerid)
    {
    SetPlayerFacingAngle(playerid, 90.0);
    SetPlayerPos(playerid, 2715.2871,-2486.3831,29.1932);
    SetPlayerCameraPos(playerid, 2715.2393,-2492.1199,29.1932);
    SetPlayerCameraLookAt(playerid, 2715.2871,-2486.3831,29.1932);
    }




    //------------------------------------------------------------------------------




    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerClass(playerid, classid);
    SetupPlayerForClassSelection(playerid);
    gPlayerClass[playerid] = classid;
    switch (classid) {
    case 0:
    {
    GameTextForPlayer(playerid, "~g~Worker", 500, 3);
    }
    case 1:
    {
    GameTextForPlayer(playerid, "~g~Pimp", 500, 3);
    }
    }
    return 1;
    }




    //------------------------------------------------------------------------------




    public GameModeExitFunc()
    {
    GameModeExit();
    return 1;
    }




    //------------------------------------------------------------------------------




    SetPlayerClass(playerid, classid) {


    if(classid == 0)
    {
    gTeam[playerid] = TEAM_TERRORIST;
    }
    else if(classid == 1)
    {
    gTeam[playerid] = TEAM_COUNTER_TERRORIST;
    }



    //------------------------------------------------------------------------------



    Errors:

  • lude <a_samp>
    #include <core>
    #include <float>
    static gTeam[MAX_PLAYERS];
    new gPlayerClass[MAX_PLAYERS];


    #define COLOR_GREY 0xAFAFAFAA
    #define COLOR_GREEN 0x33AA33AA
    #define COLOR_RED 0xAA3333AA
    #define COLOR_YELLOW 0xFFFF00AA
    #define COLOR_PINK 0xFF66FFAA
    #define COLOR_BLUE 0x0000BBAA
    #define COLOR_LIGHTBLUE 0x33CCFFAA
    #define COLOR_DARKRED 0x660000AA
    #define COLOR_ORANGE 0xFF9900AA
    #define TEAM_TERRORIST 1
    #define TEAM_COUNTER_TERRORIST 2



    // Round duration


    //new gRoundTime = 3600000; // 60 mins


    //new gRoundTime = 900000; //15 mins


    //new gRoundTime = 300000; // 5 mins




    //------------------------------------------------------------------------------


    main()
    {
    }


    //------------------------------------------------------------------------------


    public OnGameModeInit()
    {
    SetGameModeText("San Fierro TDM");
    SetTeamCount(2);
    SetWorldTime(12);
    AddPlayerClass(285,2776.2981,-2379.0464,16.2244,88.4118,16,3,4,1,22,22); // CT
    AddPlayerClass(258,2536.9382,-2535.7244,13.6250,268.8935,16,3,4,1,22,22); // T
    return 1;
    }




    //------------------------------------------------------------------------------




    public OnPlayerConnect(playerid)
    {
    GameTextForPlayer(playerid,"Counter Strike",2500,5);
    GivePlayerMoney(playerid, 2000);
    SetPlayerColor(playerid, COLOR_GREY);
    return 1;
    }




    //------------------------------------------------------------------------------




    public OnPlayerSpawn(playerid)
    {
    if(gTeam[playerid] == TEAM_TERRORIST)
    {
    SetPlayerColor(playerid,COLOR_RED); // Green
    }
    if(gTeam[playerid] == TEAM_COUNTER_TERRORIST)
    {
    SetPlayerColor(playerid,COLOR_GREEN); // Red
    }
    return 1;
    }




    //------------------------------------------------------------------------------




    public OnPlayerDeath(playerid, killerid, reason)
    {
    if(killerid == INVALID_PLAYER_ID) {
    SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
    } else {
    if(gTeam[killerid] != gTeam[playerid]) {
    // Valid kill
    SendDeathMessage(killerid,playerid,reason);
    SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
    GivePlayerMoney(killerid, 1000);
    }
    else {
    //Team Killer!
    new warning[256];
    format(warning, sizeof(warning), "Du hast Teamkill Begangen, dir wurden 1000$ abgezogen.");
    SendClientMessage(killerid, 0xFFFF00AA, warning);
    SendDeathMessage(killerid,playerid,reason);
    GivePlayerMoney(killerid, -1000);
    SetPlayerScore(killerid, GetPlayerScore(killerid) - 1);
    }
    }
    return 1;
    }




    //------------------------------------------------------------------------------




    public SetupPlayerForClassSelection(playerid)
    {
    SetPlayerFacingAngle(playerid, 90.0);
    SetPlayerPos(playerid, 2715.2871,-2486.3831,29.1932);
    SetPlayerCameraPos(playerid, 2715.2393,-2492.1199,29.1932);
    SetPlayerCameraLookAt(playerid, 2715.2871,-2486.3831,29.1932);
    }




    //------------------------------------------------------------------------------




    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerClass(playerid, classid);
    SetupPlayerForClassSelection(playerid);
    gPlayerClass[playerid] = classid;
    switch (classid) {
    case 0:
    {
    GameTextForPlayer(playerid, "~g~Worker", 500, 3);
    }
    case 1:
    {
    GameTextForPlayer(playerid, "~g~Pimp", 500, 3);
    }
    }
    return 1;
    }




    //------------------------------------------------------------------------------




    public GameModeExitFunc()
    {
    GameModeExit();
    return 1;
    }




    //------------------------------------------------------------------------------




    SetPlayerClass(playerid, classid) {


    if(classid == 0)
    {
    gTeam[playerid] = TEAM_TERRORIST;
    }
    else if(classid == 1)
    {
    gTeam[playerid] = TEAM_COUNTER_TERRORIST;
    }
    return 1;
    }




    So sollte es gehen...



  • #include <a_samp>
    #include <core>
    #include <float>
    static gTeam[MAX_PLAYERS];
    new gPlayerClass[MAX_PLAYERS];


    #define COLOR_GREY 0xAFAFAFAA
    #define COLOR_GREEN 0x33AA33AA
    #define COLOR_RED 0xAA3333AA
    #define COLOR_YELLOW 0xFFFF00AA
    #define COLOR_PINK 0xFF66FFAA
    #define COLOR_BLUE 0x0000BBAA
    #define COLOR_LIGHTBLUE 0x33CCFFAA
    #define COLOR_DARKRED 0x660000AA
    #define COLOR_ORANGE 0xFF9900AA
    #define TEAM_TERRORIST 1
    #define TEAM_COUNTER_TERRORIST 2



    // Round duration


    //new gRoundTime = 3600000; // 60 mins


    //new gRoundTime = 900000; //15 mins


    //new gRoundTime = 300000; // 5 mins




    //------------------------------------------------------------------------------


    main()
    {
    }


    //------------------------------------------------------------------------------


    public OnGameModeInit()
    {
    SetGameModeText("San Fierro TDM");
    SetTeamCount(2);
    SetWorldTime(12);
    AddPlayerClass(285,2776.2981,-2379.0464,16.2244,88.4118,16,3,4,1,22,22); // CT
    AddPlayerClass(258,2536.9382,-2535.7244,13.6250,268.8935,16,3,4,1,22,22); // T
    return 1;
    }




    //------------------------------------------------------------------------------




    public OnPlayerConnect(playerid)
    {
    GameTextForPlayer(playerid,"Counter Strike",2500,5);
    GivePlayerMoney(playerid, 2000);
    SetPlayerColor(playerid, COLOR_GREY);
    return 1;
    }




    //------------------------------------------------------------------------------




    public OnPlayerSpawn(playerid)
    {
    if(gTeam[playerid] == TEAM_TERRORIST)
    {
    SetPlayerColor(playerid,COLOR_RED); // Green
    }
    if(gTeam[playerid] == TEAM_COUNTER_TERRORIST)
    {
    SetPlayerColor(playerid,COLOR_GREEN); // Red
    }
    return 1;
    }




    //------------------------------------------------------------------------------




    public OnPlayerDeath(playerid, killerid, reason)
    {
    if(killerid == INVALID_PLAYER_ID) {
    SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
    } else {
    if(gTeam[killerid] != gTeam[playerid]) {
    // Valid kill
    SendDeathMessage(killerid,playerid,reason);
    SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
    GivePlayerMoney(killerid, 1000);
    }
    else {
    //Team Killer!
    new warning[256];
    format(warning, sizeof(warning), "Du hast Teamkill Begangen, dir wurden 1000$ abgezogen.");
    SendClientMessage(killerid, 0xFFFF00AA, warning);
    SendDeathMessage(killerid,playerid,reason);
    GivePlayerMoney(killerid, -1000);
    SetPlayerScore(killerid, GetPlayerScore(killerid) - 1);
    }
    }
    return 1;
    }




    //------------------------------------------------------------------------------




    public SetupPlayerForClassSelection(playerid)
    {
    SetPlayerFacingAngle(playerid, 90.0);
    SetPlayerPos(playerid, 2715.2871,-2486.3831,29.1932);
    SetPlayerCameraPos(playerid, 2715.2393,-2492.1199,29.1932);
    SetPlayerCameraLookAt(playerid, 2715.2871,-2486.3831,29.1932);
    }




    //------------------------------------------------------------------------------




    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerClass(playerid, classid);
    SetupPlayerForClassSelection(playerid);
    gPlayerClass[playerid] = classid;
    switch (classid) {
    case 0:
    {
    GameTextForPlayer(playerid, "~g~Worker", 500, 3);
    }
    case 1:
    {
    GameTextForPlayer(playerid, "~g~Pimp", 500, 3);
    }
    }
    return 1;
    }




    //------------------------------------------------------------------------------




    public GameModeExitFunc()
    {
    GameModeExit();
    return 1;
    }




    //------------------------------------------------------------------------------




    SetPlayerClass(playerid, classid) {


    if(classid == 0)
    {
    gTeam[playerid] = TEAM_TERRORIST;
    }
    else if(classid == 1)
    {
    gTeam[playerid] = TEAM_COUNTER_TERRORIST;
    }
    return 1;