Teams not working
#1

Hello, this script compiles without errors, but doesnt work ingame?:
pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#include <SAMSite>

#define COLOR_AQUA 0x00FFFFFF

//The Teams
#define TEAM_USA 0
#define TEAM_RUSSIA 1
#define TEAM_GERMANY 2
#define TEAM_BANGLADESH 3
#define TEAM_ITALY 4
#define TEAM_BRAZIL 5
#define TEAM_SERBIA 6
#define TEAM_FRANCE 7

//SAM Sites
#define US_SAM_1 0
#define US_SAM_2 1
#define US_SAM_3 2
#define US_SAM_4 3


#if defined FILTERSCRIPT

public OnFilterScriptInit()
{

    AddPlayerClassEx(0, 287, 89.5718, 1921.1682, 17.9202, 102.1499, 25, 50, 31, 400, 39, 20);
    AddPlayerClassEx(1, 166, 771.0197, 1873.7013, 8.0957, 266.5783, 18, 10, 30, 300, 34, 46);
    AddPlayerClassEx(2, 254, -642.4337, 2715.4758, 72.3750, 133.9510, 22, 85, 32, 200, 31, 700);
    AddPlayerClassEx(3, 120, -218.3907, 2645.5232, 63.1823, 178.6604, 24, 30, 30, 672, 33, 50);
    AddPlayerClassEx(4, 217, 1343.8055, -895.4852, 36.4187, 263.2225, 27, 20, 31, 965, 38, 200);
    AddPlayerClassEx(5, 239, 1421.5905, 2741.6765, 10.8203, 84.5192, 28, 40, 34, 90, 37, 120);
    AddPlayerClassEx(6, 220, -2350.1025, -1610.2853, 483.6269, 249.1130, 28, 200, 34, 40, 39, 25);
    AddPlayerClassEx(7, 123, -1505.2146, 2519.2820, 55.9182, 348.7282, 25, 50, 29, 400, 31, 300);
   
    //SAM Sites
    AddStaticSAM(237.5797,1698.6908,23.8673);
    AddStaticSAM(15.3281,1720.9646,23.8673);
    AddStaticSAM(188.2694,2083.4644,23.9063);
    AddStaticSAM(354.5453,2030.3062,23.8750);
   
    //print
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
   
    if(classid == 0)
    {
        GameTextForPlayer(playerid, "Team: ~b~USA", 6000, 6);
        SetPlayerColor(playerid, 0x0000FFFF);
    }
   
    if(classid == 1)
    {
        GameTextForPlayer(playerid, "Team: ~r~Russia", 6000, 6);
        SetPlayerColor(playerid, 0xFF0000FF);
    }
   
    if(classid == 2)
    {
        GameTextForPlayer(playerid, "Team: ~g~Germany", 6000, 6);
        SetPlayerColor(playerid, 0x00FF00FF);
    }
   
    if(classid == 3)
    {
        GameTextForPlayer(playerid, "Team: Bangladesh", 6000, 6);
        SetPlayerColor(playerid, 0xC0C0C0FF);
    }

    if(classid == 4)
    {
        GameTextForPlayer(playerid, "Team: Italy", 6000, 6);
        SetPlayerColor(playerid, 0x408080FF);
    }
   
    if(classid == 5)
    {
        GameTextForPlayer(playerid, "Team: Brazil", 6000, 6);
        SetPlayerColor(playerid, 0x808000FF);
    }
   
    if(classid == 6)
    {
        GameTextForPlayer(playerid, "Team: ~w~Serbia", 6000, 6);
        SetPlayerColor(playerid, 0xFFFFFFFF);
    }
   
    if(classid == 7)
    {
        GameTextForPlayer(playerid, "Team: France", 6000, 6);
        SetPlayerColor(playerid, 0xFF8040FF);
    }
    return 1;
}

public OnPlayerConnect(playerid)
{
    return 1;
}

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

public OnPlayerSpawn(playerid)
{
    if(GetPlayerColor(playerid) == 0x0000FFFF) SetPlayerTeam(playerid, TEAM_USA);
    if(GetPlayerColor(playerid) == 0xFF0000FF) SetPlayerTeam(playerid, TEAM_RUSSIA);
    if(GetPlayerColor(playerid) == 0x00FF00FF) SetPlayerTeam(playerid, TEAM_GERMANY);
    if(GetPlayerColor(playerid) == 0xC0C0C0FF) SetPlayerTeam(playerid, TEAM_BANGLADESH);
    if(GetPlayerColor(playerid) == 0x408080FF) SetPlayerTeam(playerid, TEAM_ITALY);
    if(GetPlayerColor(playerid) == 0x808000FF) SetPlayerTeam(playerid, TEAM_BRAZIL);
    if(GetPlayerColor(playerid) == 0xFFFFFFFF) SetPlayerTeam(playerid, TEAM_SERBIA);
    if(GetPlayerColor(playerid) == 0xFF8040FF) SetPlayerTeam(playerid, TEAM_FRANCE);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/myteam", cmdtext, true, 6) == 0)
    {
        SendClientMessage(playerid, 0xFF8040FF, "ERROR: Command is not active");
        return 1;
    }
    return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 1;
}

public OnRconCommand(cmd[])
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
    return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}

public OnSamSiteUpdate(samid, playerid)
{
    if(samid == US_SAM_1)
    {
        if(GetPlayerTeam(playerid, TEAM_USA))
        {
            return 0;
        }
    }
   
    if(samid == US_SAM_2)
    {
        if(GetPlayerTeam(playerid, TEAM_USA))
        {
            return 0;
        }
    }
   
    if(samid == US_SAM_3)
    {
        if(GetPlayerTeam(playerid, TEAM_USA))
        {
            return 0;
        }
    }
   
    if(samid == US_SAM_4)
    {
        if(GetPlayerTeam(playerid, TEAM_USA))
        {
            return 0;
        }
    }
   
    return 1;
}
Reply
#2

u added it in ur server.cfg filterscript lines?
Reply
#3

Debug it.

USe:

pawn Код:
print("Team [TEAMNAME] works");
Also, try adding "SetPlayerTeam(playerid, TEAM);" under each of the OnPlayerRequestClass things, that might work and remove them from OnPlayerSpawn.

Edit: Max, don't post if you don't know what you're on about. This has nothing to do with his "Server.cfg" file as it's not a filterscript.
Reply
#4

Yep, it has the features, just you spawn in LV, not on the team, and the cj skin
Reply
#5

Quote:
Originally Posted by stormchaser206
Посмотреть сообщение
Yep, it has the features, just you spawn in LV, not on the team, and the cj skin
What do you mean?
Reply
#6

PS i wa talking to crazy
Reply
#7

Quote:
Originally Posted by iGetty
Посмотреть сообщение
Debug it.

USe:

pawn Код:
print("Team [TEAMNAME] works");
Also, try adding "SetPlayerTeam(playerid, TEAM);" under each of the OnPlayerRequestClass things, that might work and remove them from OnPlayerSpawn.

Edit: Max, don't post if you don't know what you're on about. This has nothing to do with his "Server.cfg" file as it's not a filterscript.
Still doesnt work

Would this have anything to do with deleting the classes from the gamemode since there on here?
Reply
#8

Check your PM.
Reply
#9

i posted it there now
Reply
#10

on top of the script
pawn Код:
static gTeam[MAX_PLAYERS];
and this u know where
pawn Код:
if(classid == 0)
    {
        GameTextForPlayer(playerid, "~b~Team: USA", 6000, 6);
        SetPlayerColor(playerid,COLOR);
        gTeam[playerid] = TEAM_USA;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)