[HELP] Vehicle Spawn - 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: [HELP] Vehicle Spawn (
/showthread.php?tid=208214)
[HELP] Vehicle Spawn - Larsey123IsMe - 08.01.2011
Why dosent the vehicle spawn and put the player in the vehicle?
pawn Код:
if(listitem == 0) // Andromada
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid, A);
CreateVehicle(592, X,Y,X,A, -1, -1, -1);
PutPlayerInVehicle(playerid, vehicleid, 0);
return 1;
}
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
new currentveh;
currentveh = GetPlayerVehicleID(playerid);
DestroyVehicle(currentveh);
return 1;
}
Re: [HELP] Vehicle Spawn -
famas.[FTW] - 08.01.2011
Quote:
Originally Posted by Larsey123IsMe
Why dosent the vehicle spawn and put the player in the vehicle?
pawn Код:
if(listitem == 0) // Andromada { new vehicleid; vehicleid = GetPlayerVehicleID(playerid); new Float:X, Float:Y, Float:Z, Float:A; GetPlayerPos(playerid, X,Y,Z); GetPlayerFacingAngle(playerid, A); CreateVehicle(592, X,Y,X,A, -1, -1, -1); PutPlayerInVehicle(playerid, vehicleid, 0); return 1; }
|
You should be putting 'vehicleid' on the CreateVehicle line:
pawn Код:
if(listitem == 0) // Andromada
{
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid, A);
new vehicleid = CreateVehicle(592, X,Y,Z,A, -1, -1, -1);
PutPlayerInVehicle(playerid, vehicleid, 0);
return 1;
}
Re: [HELP] Vehicle Spawn - Larsey123IsMe - 08.01.2011
Thank You, Mate