SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 02/12/2011, 05:45 PM   #1
[ITS]StatickShock
Big Clucker
 
[ITS]StatickShock's Avatar
 
Join Date: May 2011
Location: Sicily (Italy)
Posts: 62
Reputation: 2
Default SetPlayerPositionWithVehicle(playerid, x, y, z);

hi all, today I have made a simple include, with this function can set the player position when the player is in the car.
Code:
SetPlayerPositionWithVehicle(playerid, x, y, z);
this is the script:
Code:
#include <a_samp>

SetPlayerPosWithVehicle(playerid, Float:X, Float:Y, Float:Z)
{
	SetPlayerPosEx(playerid,X,Y,Z);
	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	{
		SetVehiclePos(GetPlayerVehicleID(playerid),X,Y,Z);
		LinkVehicleToInterior(GetPlayerVehicleID(playerid),0);
		PutPlayerInVehicle(playerid,GetPlayerVehicleID(playerid),0);
		SetVehicleZAngle(GetPlayerVehicleID(playerid),0.0);
	}
}

SetPlayerPosEx(playerid, Float:X, Float:Y, Float:Z)
{
	SetPlayerPos(playerid,X,Y,Z);
	SetPlayerInterior(playerid,0);
	SetPlayerWorldBounds(playerid, 99999.0, -99999.0, 99999.0, -99999.0);
}

DOWNLOAD:
http://solidfiles.com/d/6fd244e65c/
[ITS]StatickShock is offline   Reply With Quote
Old 02/12/2011, 05:47 PM   #2
System64
Gangsta
 
System64's Avatar
 
Join Date: May 2011
Location: Zadar, Croatia
Posts: 933
Reputation: 143
Default Re: SetPlayerPositionWithVehicle(playerid, x, y, z);

what did I posted in the useful functions thread?
__________________
All my works
I left SA:MP! Maybe once I start scripting again but now I'm based on web programming
Soon, I'll buy domain system32.com.hr but for now you can contact me on LogoOff or on my Youtube channel!
System64 is offline   Reply With Quote
Old 02/12/2011, 05:47 PM   #3
Fool
Gangsta
 
Fool's Avatar
 
Join Date: Jul 2010
Posts: 708
Reputation: 172
Default Re: SetPlayerPositionWithVehicle(playerid, x, y, z);

Useful Snippets
Fool is offline   Reply With Quote
Old 02/12/2011, 06:01 PM   #4
pagie1111
Huge Clucker
 
Join Date: Dec 2008
Posts: 463
Reputation: 20
Default Re: SetPlayerPositionWithVehicle(playerid, x, y, z);

You should make it SetPlayerPosWithVehicle(playerid,Float: p_x,Float: p_y,Float: p_z,Float:veh_a);

What if you don't want the 0.0 facing angle with the car...?
__________________
Have just returned to SA:MP as of 21/07/2015
Will be reviewing one of my old scripts and releasing a new version!
+1 rep

________________________________________________
pagie1111 is offline   Reply With Quote
Old 02/12/2011, 06:12 PM   #5
Dark_Kostas
Gangsta
 
Join Date: Dec 2007
Location: Greece, Athens
Posts: 542
Reputation: 14
Default Re: SetPlayerPositionWithVehicle(playerid, x, y, z);

Are you sure this is working if the player is in a vehicle? Because if you set his position then he can't be the "Driver", so everything after setting his normal position won't work.
__________________
Quote:
Help != Scripting for you.

Give a man a fish he eats for a day, teach a man to fish he eats for a life time.
Dark_Kostas is offline   Reply With Quote
Old 04/12/2011, 09:43 PM   #6
[Nikk]
High-roller
 
[Nikk]'s Avatar
 
Join Date: Jun 2011
Location: Argentina.
Posts: 1,473
Reputation: 63
Default Respuesta: SetPlayerPositionWithVehicle(playerid, x, y, z);

Woow, very nice
__________________


[Nikk] is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Whats the difference between "!IsPlayerAdmin(playerid))" and "IsPlayerAdmin(playerid))" lewismichaelbbc Help Archive 4 21/08/2011 09:42 PM
What's wrong with skins? GetPlayerSkin(playerid) & SetPlayerSkin(playerid, skin) McSquizzy Help Archive 7 16/04/2010 03:27 PM
Help with if(MedicBill[playerid] == 1 && PlayerInfo[playerid][pJailed] == 0 && Keeboo13 Help Archive 0 11/04/2010 06:38 AM
WG40[playerid] = 1; For everyone not only playerid? pawelf94 Help Archive 4 23/12/2009 04:31 PM


All times are GMT. The time now is 03:20 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.