Car Spawn
#1

Hey guys. Is it possible that when they spawn they get a car?

like

onplayerspawn

then some sort of command to give the person a car?

i hope there is, this would make me really happy.

Thanks
Reply
#2

Do you want it to make a car or get a random unused car?
Reply
#3

Quote:
Originally Posted by [HiC]TheKiller
Посмотреть сообщение
Do you want it to make a car or get a random unused car?
I want it so it will spawn a brand new car for the person.
Reply
#4

pawn Код:
new Scar[MAX_PLAYERS];//at top with other variables

public OnPlayerSpawn(playerid)
{
    new Float:x,Float:y,Float:z,Float:ang;
    GetPlayerPos(playerid,x,y,z);
    GetPlayerFacingAngle(playerid,ang);
    Scar[playerid] = CreateVehicle(522,x,y,z,ang,-1,-1,-1);//nrg
    PutPlayerInVehicle(playerid,Scar[playerid],0)
    return 1;
}
EDIT: Be carefull if you have interior spawns. If you have interior spawns add a check.
Reply
#5

pawn Код:
public OnPlayerSpawn(playerid)
{
    new
        Float:x,
        Float:y,
        Float:z;
    GetPlayerPos( playerid, x, y, z );
    GetXYInfrontOfPlayer( playerid, x, y, 3.0 );
    CreateVehicle( MODEL_HERE, x, y, z+0.5, -1, -1, -1 );
    return true;
}
pawn Код:
GetXYInfrontOfPlayer(playerid,&Float:x,&Float:y,Float:Distance)
{
        new Float:r;
        if(IsPlayerInAnyVehicle(playerid)==0)GetPlayerFacingAngle(playerid,r);
        else GetVehicleZAngle(GetPlayerVehicleID(playerid),r);
        x += (Distance * floatsin(-r, degrees));
        y += (Distance * floatcos(-r, degrees));
        return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)