Help| How to Set Teams for vehicles?
#1

Ok.
Like some of you know in the last 24 I was asking for help in my new script.
now i have another problem! that not in Errors and Warnings!
i have some cars in the script. and the cars is owned by factions! and i want to set a team of cars that JUST the factions that own the team of the cars can enter them.
Those the cars:
pawn Код:
AddStaticVehicle(411,2253.9971,-1699.3213,13.4770,266.5998,0,0);// Sudden Death (faction)
    AddStaticVehicle(424,2254.8110,-1695.9163,13.5258,263.5016,0,0);// Sudden Death (faction)
    AddStaticVehicle(487,2241.7720,-1707.6130,23.0380,267.0402,0,0);// Sudden Death (faction)
    AddStaticVehicle(463,2486.1377,-1953.2212,12.9675,357.1926,155,155);// Judas (faction)
    AddStaticVehicle(463,2489.1641,-1954.0009,12.9606,352.1725,155,155);// Judas (faction)
    AddStaticVehicle(463,2482.6016,-1953.5052,12.9651,356.4863,155,155);// Judas (faction)
    AddStaticVehicle(463,2492.2593,-1953.1180,12.9644,0.5535,155,155);// Judas (faction)
    AddStaticVehicle(463,2495.7893,-1953.6471,12.9637,355.2355,155,155);// Judas (faction)
    AddStaticVehicle(536,2045.2780,-1731.0930,13.2846,0.8217,175,175);// Ballas (faction
    AddStaticVehicle(509,2045.1404,-1708.1598,13.0648,274.8324,175,175);// Ballas (faction
    AddStaticVehicle(467,2038.2916,-1704.0177,13.2889,180.3633,175,175);// Ballas (faction
    AddStaticVehicle(404,2037.9335,-1729.7744,13.2794,180.1528,175,175);// Ballas (faction
Its currectly never mine how to join a faction and where it saved right?
anyway i want to do that the vehicles of Judas will be able to drive just to Judas members!
and the varible of the Player faction is:
pawn Код:
new faction[playerid]; // in the top of the script
faction[playerid] = 0; // To set the faction of player (0 Unfactioned, 1 Sudden Death, 2 Judas, 3 Ballas, Maybe more)
if(faction[playerid] == 1) return SendClientMessage(playerid, red, "אתה בקבוצה סאדן דאס"); // Translate from hebrew: You are in Sudden Death
dini_IntSet(playerfile, "Faction", faction[playerid]); // To put the faction in a file
faction[playerid] = dini_Int(playerfile, "Faction"); // To give the player his faction after connecting
Ok now you know my basics of my question. so.... How to make teams to cars? and just the Factions that own the car can enter them? pls HELP
Reply
#2

i dont understand what r u say? go here and read hardly CLICK HERE
Reply
#3

Not sure if you mean this, but if you are not in Judas team, you get kicked out of the judas cars.

pawn Код:
// Top of script
new SuddenDeathCar[500]; // Change the 500 with the amount of the cars you got
new JudasCar[500]; // Same for those
new BallasCar[500]; // Same for those

// OnGameModeInit
SuddenDeathCar[0] = AddStaticVehicle(411,2253.9971,-1699.3213,13.4770,266.5998,0,0);// Sudden Death (faction)
SuddenDeathCar[1] = AddStaticVehicle(424,2254.8110,-1695.9163,13.5258,263.5016,0,0);// Sudden Death (faction)
SuddenDeathCar[2] = // And so on..

JudasCar[0] = AddStaticVehicle(463,2486.1377,-1953.2212,12.9675,357.1926,155,155);// Judas (faction)
JudasCar[1] = AddStaticVehicle(463,2489.1641,-1954.0009,12.9606,352.1725,155,155);// Judas (faction)
JudasCar[2] = // And so on..

BallasCar[0] = AddStaticVehicle(509,2045.1404,-1708.1598,13.0648,274.8324,175,175);// Ballas (faction
BallasCar[1] = AddStaticVehicle(467,2038.2916,-1704.0177,13.2889,180.3633,175,175);// Ballas (faction
BallasCar[2] = // And so on..  

// OnPlayerStateChange
// NOTE: Change the gTeam[playerid] to your own teams, i don't know them
if(newstate == PLAYER_STATE_DRIVER)
{
    new Vehicle = GetPlayerVehicleID(playerid);
    for(new j=0; j < 50; j++)
    {
        if(Vehicle == SuddenDeathCar[j])
        {
            if(gTeam[playerid] == SuddenDeath)
            {
                return 1;
            } else {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, orange, "Sorry, this car is not for you");
                return 1;
            }
        }
    }
}

if(newstate == PLAYER_STATE_DRIVER)
{
    new Vehicle = GetPlayerVehicleID(playerid);
    for(new j=0; j < 50; j++)
    {
        if(Vehicle == JudasCar[j])
        {
            if(gTeam[playerid] == Judas)
            {
                return 1;
            } else {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, orange, "Sorry, this car is not for you");
                return 1;
            }
        }
    }
}

if(newstate == PLAYER_STATE_DRIVER)
{
    new Vehicle = GetPlayerVehicleID(playerid);
    for(new j=0; j < 50; j++)
    {
        if(Vehicle == BallasCar[j])
        {
            if(gTeam[playerid] == Ballas)
            {
                return 1;
            } else {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, orange, "Sorry, this car is not for you");
                return 1;
            }
        }
    }
}
Reply
#4

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
Not sure if you mean this, but if you are not in Judas team, you get kicked out of the judas cars.

pawn Код:
// Top of script
new SuddenDeathCar[500]; // Change the 500 with the amount of the cars you got
new JudasCar[500]; // Same for those
new BallasCar[500]; // Same for those

// OnGameModeInit
SuddenDeathCar[0] = AddStaticVehicle(411,2253.9971,-1699.3213,13.4770,266.5998,0,0);// Sudden Death (faction)
SuddenDeathCar[1] = AddStaticVehicle(424,2254.8110,-1695.9163,13.5258,263.5016,0,0);// Sudden Death (faction)
SuddenDeathCar[2] = // And so on..

JudasCar[0] = AddStaticVehicle(463,2486.1377,-1953.2212,12.9675,357.1926,155,155);// Judas (faction)
JudasCar[1] = AddStaticVehicle(463,2489.1641,-1954.0009,12.9606,352.1725,155,155);// Judas (faction)
JudasCar[2] = // And so on..

BallasCar[0] = AddStaticVehicle(509,2045.1404,-1708.1598,13.0648,274.8324,175,175);// Ballas (faction
BallasCar[1] = AddStaticVehicle(467,2038.2916,-1704.0177,13.2889,180.3633,175,175);// Ballas (faction
BallasCar[2] = // And so on..  

// OnPlayerStateChange
// NOTE: Change the gTeam[playerid] to your own teams, i don't know them
if(newstate == PLAYER_STATE_DRIVER)
{
    new Vehicle = GetPlayerVehicleID(playerid);
    for(new j=0; j < 50; j++)
    {
        if(Vehicle == SuddenDeathCar[j])
        {
            if(gTeam[playerid] == SuddenDeath)
            {
                return 1;
            } else {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, orange, "Sorry, this car is not for you");
                return 1;
            }
        }
    }
}

if(newstate == PLAYER_STATE_DRIVER)
{
    new Vehicle = GetPlayerVehicleID(playerid);
    for(new j=0; j < 50; j++)
    {
        if(Vehicle == JudasCar[j])
        {
            if(gTeam[playerid] == Judas)
            {
                return 1;
            } else {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, orange, "Sorry, this car is not for you");
                return 1;
            }
        }
    }
}

if(newstate == PLAYER_STATE_DRIVER)
{
    new Vehicle = GetPlayerVehicleID(playerid);
    for(new j=0; j < 50; j++)
    {
        if(Vehicle == BallasCar[j])
        {
            if(gTeam[playerid] == Ballas)
            {
                return 1;
            } else {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, orange, "Sorry, this car is not for you");
                return 1;
            }
        }
    }
}
Yes. This is what i want. thank you and i can change gTeam to faction[playerid] right?
Reply
#5

gTeam[playerid] == Factionname here
Reply
#6

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
gTeam[playerid] == Factionname here
Yes i know. but i created a new varible. like gTeam that call faction[MAX_PLAYERS];
so im using faction[playerid] == 1 and not gTeam == TeamName becouse it's kind of RP/DM server.... and faction people can kill each other....
Reply
#7

Then you can change it to faction[playerid] == 1

Im using gTeam, so yeah
Reply
#8

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
Then you can change it to faction[playerid] == 1

Im using gTeam, so yeah
dude, not working...
Reply
#9

Well, whats the problem? I can't do anything without the error/code
Reply
#10

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
Well, whats the problem? I can't do anything without the error/code
Its just its not working no errors but not working like this was never scripted....
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)