Vehicle TP
#9

Quote:
Originally Posted by oktokt1
Посмотреть сообщение
I want to do CreateVehicle Be4 That cmd and a new Vehicle pos will be GetPlayerPos Then SetVehiclePos I think it will be with New X Y Z it's back to GetPlayerPos then PutPlayerInVehicle.

I want to know how to +Rep u guys u helped me alot
Without using zcmd/sscanf, I don't know how to put parameters! Apologize.
I misunderstood what you wanted.

Take a look :
PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp(cmdtext"/tp"true) == 0// If the player type /tp than we executes thos following lines
    
{
        new 
Float:xFloat:yFloat:zFloat:Angle;
        
/* 4 variables : x, y, z, angle for create the vehicle at player's coordinate - 1 variable for the vehicle's model*/
        
        
GetPlayerPos(playeridxyz);
        
/* We stock the position in differents variables (x, y, z) */
        
GetPlayerFacingAngle(playeridAngle);
         
/* We stock the facing angle in the variable Angle*/
        
new vehicleid CreateVehicle(411xyzAngle, -1, -11000);
        
/* Replace 411 by the vehicle's model you want | -1 is a random color | Primary and secondary color
        CreateVehicle(modelOfTheVehicle, Coordinate x, Coordinate y, Coordinate z, rotation of the vehicle, Primary color (-1 is random), Secondary color (-1 is random), respawn delay (in ms));
        Link can be fin here : https://sampwiki.blast.hk/wiki/Vehicle_M...4.76242222
        We create the vehicle at the player's coordinate */
        
        
PutPlayerInVehicle(playeridvehicleid0);
        
/*We put the player in the vehicle at the seat 0. Why? Seat 0 = driver
        0 - Driver
        1 - Front passenger
        2 - Back-left passenger
        3 - Back-right passenger
        4+ - Passenger seats (coach etc.)*/
        
SendClientMessage(playeridCOLOR_GREEN"You have spawned an vehicle!"); // We send a basic message to say the player has been teleported
        
return 1;
    }
    return 
0;

I hope this new one is the good. Try to understand the script and not only C/C.

For +Rep someone, click on the star at the left bottom on a message.
Reply


Messages In This Thread
Vehicle TP - by oktokt1 - 05.05.2016, 23:03
Re: Vehicle TP - by Dayrion - 05.05.2016, 23:32
Re: Vehicle TP - by oktokt1 - 06.05.2016, 07:40
Re: Vehicle TP - by Sew_Sumi - 06.05.2016, 08:19
Re: Vehicle TP - by Dayrion - 06.05.2016, 09:19
Re: Vehicle TP - by Sew_Sumi - 06.05.2016, 11:50
Re: Vehicle TP - by Dayrion - 06.05.2016, 12:05
Re: Vehicle TP - by oktokt1 - 06.05.2016, 13:33
Re: Vehicle TP - by Dayrion - 06.05.2016, 14:18
Re: Vehicle TP - by Sew_Sumi - 06.05.2016, 14:24

Forum Jump:


Users browsing this thread: 1 Guest(s)