28.07.2009, 21:49
if you want to add cars to an interior from the startup of your script:
The command you asked for:
The Addition of:
will detect the car the player is in at the time.
boeile's version can only allow THAT car to be TP'ed into the arena with the player.
Not sure if it works...... but you could try
EDIT: Tested, works
Код:
forward LinkCars(); //put here all your car defines:Example new Car1; //then put them on the specified car " Car1 = AddStaticVehcile(....... OnGameModeInit(); { //all your stuff here then this LinkCars(); return 1; } public LinkCars() { //here put the links EXAPMPLE: LinkVehicleToInterior(Car1, 15); return 1; }
Код:
if(!strcmp(cmdtext,"/teleport4",true)) { if(IsPlayerInAnyVehicle(playerid)) { if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new Car; Car = GetPlayerVehicleID(playerid); LinkVehicleToInterior(Car,15); SetVehiclePos(GetPlayerVehicleID(playerid), -1394.20, 987.62, 1023.96); SetPlayerInterior(playerid, 15); } else { SendClientMessage(playerid, COLOR_RED, "ERROR: You need to be the driver!"); SetPlayerInterior(playerid, 15); return 1; } } else { SetPlayerPos(playerid, -1394.20, 987.62, 1023.96); } return 1; }
Код:
new Car; Car = GetPlayerVehicleId(playerid);
boeile's version can only allow THAT car to be TP'ed into the arena with the player.
Not sure if it works...... but you could try
EDIT: Tested, works