Team Cars
#1

Well my Game Mode is almost ready to be released. The only thing standing in between me and that is Team cars.

I've searched for this, but I couldn't really understand what exactly I had to do.

My team are defined as,
Код:
new gTeam[MAX_PLAYERS];
Just use numbers like 1.

I would rather someone just explain what I have to do, rather then post the code, cause I wanna learn how to.

I need cars so that when a member of the other team tries to get in they get kicked out. And get a message.
Reply
#2

Wow thanks man, just a quick question. Could the Variable team1car, make more the one car? And if there were like 6 cars per team would I have to put like.
Код:
new team1car1;
new team1car2;
??

Edit: NVM goonna test a enum and see if it works.
Reply
#3

Use an array
pawn Код:
new team1car[6];
team1car[0] = CreateVehicle();
team1car[1] = CreateVehicle();
Reply
#4

Quote:
Originally Posted by dice7
Use an array
pawn Код:
new team1car[6];
team1car[0] = CreateVehicle();
team1car[1] = CreateVehicle();
Alright thanks I'll test that to.
Reply
#5

remember that you should use a for loop if you want to check if player enters any team1car if you made the variable as an array
Reply
#6

Here is what I ended up doing.

pawn Код:
enum Teamcars
{
    t11,
    t12,
    t13,
    t14,
    t15,
    t16,
}
new Cars[Teamcars];
pawn Код:
Cars[t11] = CreateVehicle(463,-168.0218,1079.2097,19.2757,359.2158,0,0,120);
    Cars[t12] = CreateVehicle(463,-165.4124,1078.8523,19.2632,5.6784,0,0,120);
    Cars[t13] = CreateVehicle(463,-164.5489,1070.1666,19.2825,5.6784,0,0,120);
    Cars[t14] = CreateVehicle(463,-166.7310,1069.9669,19.2808,2.9687,0,0,120);
    Cars[t15] = CreateVehicle(463,-174.7683,1068.1425,19.2830,271.6882,0,0,120);
    Cars[t16] = CreateVehicle(463,-174.6816,1070.5337,19.2828,269.2234,0,0,120);
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
      return 1;
    }
    return 1;
}
I have no clue how to make it check the car was one of the team ones?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)