[SOLVED] Vehicles in array - then in if(){
#1

Hello.
I'm using this code:
Код:
enum CARS_DATA
{
  MODELID,
  Float:X,
  Float:Y,
  Float:Z,
  Float:A,
  C1,
  C2
};
new CopCars[][CARS_DATA] =
{
  {523,-215.9483,984.5226,18.9468,271.7301,0,0},
  {523,-215.9859,987.1728,19.0048,270.5827,0,0},
  {598,-228.1274,991.1447,19.2631,269.0867,0,1},
  {599,-228.6810,996.4469,19.7480,268.6263,0,1},
  {598,-214.6644,973.0877,19.0327,271.4312,0,1}
};
Then this in OnGameModeInIt()

Код:
for(new a=0; a< sizeof CopCars; a++)
{
	CreateVehicle
  (
    CopCars[a][MODELID],
    CopCars[a][X],
    CopCars[a][Y],
    CopCars[a][Z],
    CopCars[a][A],
    CopCars[a][C1],
    CopCars[a][C2],
    1000
  );
}
And How can i use CopCars in if?
For example, if player try to use the vehicle, and his pInfo[playerid][Job] is not 1, he gets removed from the vehicle. I'm trying to use this:
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
	new CarID = GetPlayerVehicleID(playerid);
	if(newstate == PLAYER_STATE_DRIVER) {

	  if(CarID == CopCars) {
	  if(pInfo[playerid][Darbas] == 1) {
	  } else {
	  RemovePlayerFromVehicle(playerid);
	  }
	  }
	  }
	return 1;
}
But i Get:
Код:
C:\Documents and Settings\Simas\Desktop\RL\gamemodes\RL0.1.pwn(206) : error 033: array must be indexed (variable "CopCars")
Line 206:
Код:
	  if(CarID == CopCars) {
What's wrong? :/
Reply


Messages In This Thread
[SOLVED] Vehicles in array - then in if(){ - by kLx - 24.07.2009, 10:34
Re: Vehicles in array - then in if(){ - by woot - 24.07.2009, 10:41
Re: Vehicles in array - then in if(){ - by Weirdosport - 24.07.2009, 10:42
Re: Vehicles in array - then in if(){ - by yezizhu - 24.07.2009, 10:44
Re: Vehicles in array - then in if(){ - by Weirdosport - 24.07.2009, 10:48
Re: Vehicles in array - then in if(){ - by kLx - 24.07.2009, 10:57

Forum Jump:


Users browsing this thread: 1 Guest(s)