04.12.2012, 10:24
how to create a script that every player spawn directly into the car
public OnPlayerSpawn(playerid)
{
PutPlayerInVehicle(playerid,vehicleid,0); // Put a vehicle id if you know
return 1;
}
public OnPlayerSpawn(playerid)
{
new Float:x,Float:y,Float:z,Float:a,veh;
GetPlayerPos(playerid,x,y,z); GetPlayerFacingAngle(playerid, a);
veh = CreateVehicle(model, x,y,z,a,-1,-1,1000); // Put a vehicle model in model E.G: Nrg: 522. Hydra: 520
PutPlayerInVehicle(playerid, veh, 0);
return 1;
}
// Global Variable;
new
gVehicle[ MAX_PLAYERS ]
;
public OnPlayerSpawn( playerid )
{
gVehicle[ playerid ] = CreateVehicle( 411, 0.0, 0.0, 0.0, 0.0, 0, 0, 60 ); // 411 - infernus. Change the vehicle/colours etc.
PutPlayerInVehicle( playerid, gVehicle[ playerid ], 0 );
SetVehiclePos( gVehicle[ playerid ], x, y, z ); // Change it to where he/she will spawn!
SetVehicleZAngle( gVehicle[ playerid ], angle ); // Same for this too!
return 1;
}