Team Cars - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Team Cars (
/showthread.php?tid=107262)
Team Cars -
retart441 - 09.11.2009
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.
Re: Team Cars -
retart441 - 09.11.2009
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.
Re: Team Cars -
dice7 - 09.11.2009
Use an array
pawn Код:
new team1car[6];
team1car[0] = CreateVehicle();
team1car[1] = CreateVehicle();
Re: Team Cars -
retart441 - 09.11.2009
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.
Re: Team Cars -
LarzI - 09.11.2009
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
Re: Team Cars -
retart441 - 09.11.2009
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?