Help| How to Set Teams for vehicles?
#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


Messages In This Thread
Help| How to Set Teams for vehicles? - by Captain Price - 28.05.2011, 08:46
Re: Help| How to Set Teams for vehicles? - by cs_master - 28.05.2011, 08:57
Re: Help| How to Set Teams for vehicles? - by Wesley221 - 28.05.2011, 09:08
Re: Help| How to Set Teams for vehicles? - by Captain Price - 28.05.2011, 09:17
Re: Help| How to Set Teams for vehicles? - by Wesley221 - 28.05.2011, 09:18
Re: Help| How to Set Teams for vehicles? - by Captain Price - 28.05.2011, 09:28
Re: Help| How to Set Teams for vehicles? - by Wesley221 - 28.05.2011, 10:14
Re: Help| How to Set Teams for vehicles? - by Captain Price - 28.05.2011, 10:17
Re: Help| How to Set Teams for vehicles? - by Wesley221 - 28.05.2011, 10:23
Re: Help| How to Set Teams for vehicles? - by Captain Price - 28.05.2011, 11:02

Forum Jump:


Users browsing this thread: 3 Guest(s)