gTeam Fail

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
  • Hallu,
    irgendwie ist mein Script verbuggt, die Teams sind irgendwie im Eimer..
    Das AntiTeamKill System ist kaputt und die SetPlayerColor Dinger stimmen auch nicht bei jedem Skin.. Kann mir jmd sagen was falsch ist?


    #include <a_samp>
    new gTeam[MAX_PLAYERS];
    #define TEAM_ARMY 0
    #define TEAM_POLICE 1
    #define TEAM_GROVE 2
    #define TEAM_BALLAS 3
    #if defined FILTERSCRIPT


    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
    }



    public OnFilterScriptExit()
    {
    return 1;
    }



    #else


    main()
    {
    print("\n----------------------------------");
    print(" Jays TDM Script V1.0");
    print("----------------------------------\n");
    }
    #endif


    public OnGameModeInit()
    {
    SetGameModeText("Jays TDM");
    AddPlayerClassEx(0,287,-1334.0078,441.4025,7.1875,357.2941,8,1,23,500,30,800);
    AddPlayerClassEx(0,286,-1339.8912,452.5998,7.1809,354.4741,8,1,23,500,30,800);
    AddPlayerClassEx(0,121,-1292.6415,484.1460,1.1774,91.7766,8,1,23,500,30,800);
    AddPlayerClassEx(1,284,-1591.9758,716.1756,-5.2422,264.0909,3,1,22,500,31,800);
    AddPlayerClassEx(1,280,-1606.5433,674.4794,-5.2422,358.3818,3,1,22,500,31,800);
    AddPlayerClassEx(1,285,-1574.3364,699.1381,-4.9063,87.6827,3,1,22,500,31,800);
    AddPlayerClassEx(2,269,-1976.6028,429.3107,25.0264,359.5037,4,1,24,500,28,800);
    AddPlayerClassEx(2,270,-1978.5875,429.7266,25.0977,0.4437,4,1,24,500,28,800);
    AddPlayerClassEx(2,271,-1981.9962,430.2668,25.1903,353.5504,4,1,24,500,28,800);
    AddPlayerClassEx(3,102,-2047.7546,145.5065,28.8359,138.5074,5,1,41,500,29,800);
    AddPlayerClassEx(3,103,-2046.6425,143.9610,28.8359,138.5074,5,1,41,500,29,800);
    AddPlayerClassEx(3,104,-2050.9727,145.8623,28.8359,138.5074,5,1,41,500,29,800);
    // C1
    AddStaticVehicleEx(490,-1573.0447,705.8344,-5.1138,90.6184,0,0,300);
    // a1
    AddStaticVehicleEx(432,-1229.7350,444.0813,7.2013,89.0855,43,0,300);
    // C2
    AddStaticVehicleEx(523,-1607.7482,734.6541,-5.6817,87.7287,0,0,300);
    // C3
    AddStaticVehicleEx(523,-1605.9863,730.6590,-5.6759,92.3712,0,0,300);
    // C4
    AddStaticVehicleEx(523,-1605.0555,735.8050,-5.6686,84.3161,0,0,300);
    // C5
    AddStaticVehicleEx(523,-1605.6749,732.3183,-5.6730,91.8298,0,0,300);
    // C6
    AddStaticVehicleEx(523,-1608.6682,731.7576,-5.6720,20.9557,0,0,300);
    // Hydra
    AddStaticVehicleEx(520,-1940.6139,294.4272,48.4264,118.8874,0,0,300);


    return 1;
    }


    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerPos(playerid, -1753.7964,885.6885,295.8750);
    SetPlayerCameraPos(playerid, -1753.7997,887.6885,297.8750);
    SetPlayerCameraLookAt(playerid, -1753.7964,885.6885,295.8750);
    switch(classid) {
    case 0:
    gTeam[playerid] = TEAM_ARMY;
    }
    switch(classid) {
    case 1:
    gTeam[playerid] = TEAM_POLICE;
    }
    switch(classid) {
    case 2:
    gTeam[playerid] = TEAM_GROVE;
    }
    switch(classid) {
    case 3:
    gTeam[playerid] = TEAM_BALLAS;
    }
    return 1;
    }



    public OnPlayerConnect(playerid)
    {
    SendClientMessage(playerid,0x3366FF,"Welcome to Jay's Teamdeathmatch Server!");
    SendClientMessage(playerid,0x3366FF,"If u have questions use /help - have fun!");
    return 1;
    }



    public OnPlayerDisconnect(playerid, reason)
    {
    return 1;
    }



    public OnPlayerSpawn(playerid)
    {
    if(gTeam[playerid] == TEAM_GROVE) {
    SetPlayerColor(playerid,0x008e00);
    SetPlayerTeam(playerid, TEAM_GROVE);
    return 1;
    }
    if(gTeam[playerid] == TEAM_POLICE) {
    SetPlayerColor(playerid,0x000092);
    SetPlayerTeam(playerid, TEAM_POLICE);
    return 1;
    }
    if(gTeam[playerid] == TEAM_BALLAS) {
    SetPlayerColor(playerid,0x830083);
    SetPlayerTeam(playerid, TEAM_BALLAS);
    return 1;
    }
    if(gTeam[playerid] == TEAM_ARMY) {
    SetPlayerColor(playerid,0x005200);
    SetPlayerTeam(playerid, TEAM_ARMY);
    return 1;
    }
    }


    public OnPlayerDeath(playerid, killerid, reason)
    {
    SendDeathMessage(killerid, playerid, reason);
    SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
    return 1;
    }



    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp("/kill", cmdtext, true, 10) == 0) {
    SetPlayerHealth(playerid,0);
    return 1;
    }
    return 0;
    }


  • Mach ma aus



    if (strcmp("/kill", cmdtext, true, 10) == 0) {
    SetPlayerHealth(playerid,0);
    return 1;
    }



    if (strcmp("/kill", cmdtext, true, 10) == 0)
    {
    SetPlayerHealth(playerid,0);
    return 1;
    }


    und so bei allen



    also nicht bei )==0){



    die klammer sondern


    )==0)
    {
    .............
    }