[Help]PutPlayerInVehicle
#2

Alright let me explain this

First we need a command to explain it better

pawn Код:
new car; //on top of script
if(strcmp(cmdtext, "/car", true,4) == 0)
    {
    return 1;
    }
This is an empty command . Now we make some Floats
pawn Код:
if(strcmp(cmdtext, "/car", true,4) == 0)
    {
    new Float:X,Float:Y,Float:Z,Float:A;
    return 1;
    }
Now we will use the floats
pawn Код:
if(strcmp(cmdtext, "/car", true,4) == 0)
    {
    new Float:X,Float:Y,Float:Z,Float:A;
    GetPlayerPos(playerid,X,Y,Z);
    GetPlayerFacingAngle(playerid,A);
    Car = CreateVehicle(X,Y,Z,A,1,1);
 
    return 1;
    }
Now that we have created a vehicle and a command , now we can use the function
pawn Код:
if(strcmp(cmdtext, "/car", true,4) == 0)
    {
    new Float:X,Float:Y,Float:Z,Float:A;
    GetPlayerPos(playerid,X,Y,Z);
    GetPlayerFacingAngle(playerid,A);
    Car = CreateVehicle(411,X,Y,Z,A,1,1);
    PutPlayerInVehicle(playerid,Car,0);
 
    return 1;
    }
This will put the player in the vehicle spawned as soon as it spawns .. I hope this explains it .. Ask if this doesnt explain
Reply


Messages In This Thread
[Help]PutPlayerInVehicle - by Tigerbeast11 - 16.10.2009, 16:56
Re: [Help]PutPlayerInVehicle - by Peter_Corneile - 16.10.2009, 17:53
Re: [Help]PutPlayerInVehicle - by dice7 - 16.10.2009, 18:09
Re: [Help]PutPlayerInVehicle - by Peter_Corneile - 16.10.2009, 18:28
Re: [Help]PutPlayerInVehicle - by Tigerbeast11 - 16.10.2009, 19:22
Re: [Help]PutPlayerInVehicle - by Peter_Corneile - 16.10.2009, 19:35
Re: [Help]PutPlayerInVehicle - by Tinsler - 19.05.2011, 20:42

Forum Jump:


Users browsing this thread: 1 Guest(s)