Spawn player in a vehicle
#1

Hey so im kind of stuck here, I want the player on their first spawn to spawn on a bike, But i've got no idea how, Also once they choose a team id like it to remove the vehicle, Could anyone point me in the right direction? I've had a look around can't really find much. Thanks
Reply
#2

putplayerinvehicle, srry cant really put codes etc here cuz am on mah mobile
Reply
#3

Quote:
Originally Posted by niels44
Посмотреть сообщение
putplayerinvehicle, srry cant really put codes etc here cuz am on mah mobile
Thanks, But one question.. Wouldn't i need to create the vehicle first?
Reply
#4

Yes
Reply
#5

Thanks but i got a little problem here..

In my server you spawn trapped in a sphere, To get in game you must choose a team by typing the command..
When they spawn (not in a team) i want them to spawn on a bike, But when they select a team i want the bike to be destroyed.. Would the script look a little like this?

pawn Код:
public OnGameModeInit()
{  
CreateVehicle(522,2324, 1283, 98, 1, 146, 146, 60);

public OnPlayerSpawn()
{
PutPlayerInVehcile(playerid,526,0);


// Loop to check if players team = 0 if it is <= to 1 then it will destroy the vehicle?
for (pTeam0; i<=1; i++)
{
    new currentveh;
        currentveh = GetPlayerVehicleID(playerid);
        DestroyVehicle(currentveh);
}
Reply
#6

Your loop should be:
pawn Код:
if(GetPlayerTeam(playerid) < 2)
{
    DestroyVehicle(GetPlayerVehicleID(playerid));
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)