No idea where i have gone wrong
#2

try this
pawn Код:
#include <a_samp>

#define TEAM_GROVE 1
#define TEAM_BALLA 2
#define TEAM_GROVE_COLOR 0x00FF00AA // Bright Green (in RGBA format)
#define TEAM_BALLA_COLOR 0xFF00FFAA // Bright Purple
new gTeam[MAX_PLAYERS];

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Andy's test server");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}


main()
{
    print("\n----------------------------------");
    print(" Andy's test server");
    print("----------------------------------\n");
}

public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Andy Test");
    AddPlayerClass(0, 2162.6753,1866.7643,248.2952,146.9800, 38, 100000, 37, 100, 46, 0);
    AddPlayerClass(102, 1958.3783, 1343.1572, 15.3746, 269.1425, 5, 0, 22, 100, 32, 50);
    // car
    AddStaticVehicle(411, 2040.2279, 1344.4127, 10.6719, 3.5436, 126, 54);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerTeamFromClass(playerid, classid);
    SetPlayerToTeamColor(playerid);
    return 1;
}

SetPlayerTeamFromClass(playerid, classid)
{
    if (classid == 0)
    {
        gTeam[playerid] = TEAM_GROVE;
    }
    else
    {
        gTeam[playerid] = TEAM_BALLA;
    }
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

SetPlayerToTeamColor(playerid)
{
    if (gTeam[playerid] == TEAM_GROVE)
    {
        SetPlayerColor(playerid, TEAM_GROVE_COLOR);
    }
    else if (gTeam[playerid] == TEAM_BALLA)
    {
        SetPlayerColor(playerid, TEAM_BALLA_COLOR);
    }
    return 1;
}

public OnPlayerConnect(playerid)
{
    return 1;
}
Reply


Messages In This Thread
No idea where i have gone wrong - by Andy_P - 01.07.2009, 14:42
Re: No idea where i have gone wrong - by James_Alex - 01.07.2009, 14:47
Re: No idea where i have gone wrong - by Andy_P - 01.07.2009, 15:06

Forum Jump:


Users browsing this thread: 1 Guest(s)