Get in Player Vehicle - 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)
+--- Thread: Get in Player Vehicle (
/showthread.php?tid=497838)
Get in Player Vehicle -
AwokenNeoX - 28.02.2014
I want to add a Command /giv playerid (getinvehicle)
If I type this vehicle I get in a vehicle of the Player.
But I dont now how to script it can someone help me please :/
Re: Get in Player Vehicle -
Smileys - 28.02.2014
so you mean you want to get into the vehicle of the specified playerid?
pawn Код:
CMD:giv( playerid, params[ ] )
{
new targetid;
if( sscanf( params, "u", targetid ) ) return SendClientMessage( playerid, -1, "Usage: /giv [playerid]" );
if( targetid == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, "Invalid playerid!" );
if( !IsPlayerInAnyVehicle( targetid ) ) return SendClientMessage( playerid, -1, "This player has no vehicle!" );
RemovePlayerFromVehicle( targetid );
PutPlayerInVehicle( playerid, GetPlayerVehicleID( targetid ), 0 );
return 1;
}