IsPlayerInAnyVehicle? - 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: IsPlayerInAnyVehicle? (
/showthread.php?tid=92154)
IsPlayerInAnyVehicle? -
Goobiiify - 18.08.2009
Hello, I need some help again, I want to teleport to Los Santos Airport but if you sit inside a car, the car will not be teleported, So how do you do if you want to car to be teleported to, Give a exemple. Newbie :]
//Al
Re: IsPlayerInAnyVehicle? -
.::: Ecko :::. - 18.08.2009
With SetVehiclePos
https://sampwiki.blast.hk/wiki/SetVehiclePos
Ecko
Re: IsPlayerInAnyVehicle? -
Goobiiify - 18.08.2009
Quote:
Originally Posted by .::: [E
|
Yeah, I tried that but I got a error then "error 017: undefined symbol "vehicleid"
How can I fix that?
Re: IsPlayerInAnyVehicle? -
Lewwy - 18.08.2009
pawn Код:
new vehicleid = GetPlayerVehicleID(playerid);
Re: IsPlayerInAnyVehicle? -
Goobiiify - 18.08.2009
Quote:
Originally Posted by [XG
Lj ]
pawn Код:
new vehicleid = GetPlayerVehicleID(playerid);
|
I did something simulate that before but that did not working, tough I'll see how it's working with your exemple..
I'm on good way ;P
Re: IsPlayerInAnyVehicle? -
.::: Ecko :::. - 18.08.2009
Quote:
Originally Posted by Al_Fathead
Quote:
Originally Posted by [XG
Lj ]
pawn Код:
new vehicleid = GetPlayerVehicleID(playerid);
|
I did something simulate that before but that did not working, tough I'll see how it's working with your exemple..
I'm on good way ;P
|
It should work,what are the errors?
Ecko
Re: IsPlayerInAnyVehicle? -
Goobiiify - 18.08.2009
Quote:
Originally Posted by .::: [E
Ecko :::. ]
Quote:
Originally Posted by Al_Fathead
Quote:
Originally Posted by [XG
Lj ]
pawn Код:
new vehicleid = GetPlayerVehicleID(playerid);
|
I did something simulate that before but that did not working, tough I'll see how it's working with your exemple..
I'm on good way ;P
|
It should work,what are the errors?
Ecko
|
Aight, I forgot to do = before, Now it works, Thanks everyone :]
Re: IsPlayerInAnyVehicle? -
LuxurioN™ - 18.08.2009
use Command... (Not tested!)
Код:
if(strcmp(cmd, "/command", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new LVehicleID;
LVehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(LVehicleID,PosX,PosY,PosZ);
LinkVehicleToInterior(LVehicleID, InteriorID);
SetPlayerFacingAngle(playerid,Angle);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid,InteriorID);
} else {
SendClientMessage(playerid,RED,"ERROR: You not in Vehicle!");
}
return 1;
}
Re: IsPlayerInAnyVehicle? -
dice7 - 18.08.2009
Use
pawn Код:
if(GetPlayerState == PLAYER_STATE_DRIVER)
so only the driver will be able to teleport the vehicle and not the passangers
Re: IsPlayerInAnyVehicle? -
Goobiiify - 18.08.2009
Quote:
Originally Posted by dice7
Use
pawn Код:
if(GetPlayerState == PLAYER_STATE_DRIVER)
so only the driver will be able to teleport the vehicle and not the passangers
|
Not needed, Tested without that and you can't teleport as Passanger