Car Spawn
#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


Messages In This Thread
Car Spawn - by fie - 01.09.2010, 07:28
Re: Car Spawn - by [HiC]TheKiller - 01.09.2010, 07:31
Re: Car Spawn - by fie - 01.09.2010, 07:33
Re: Car Spawn - by iggy1 - 01.09.2010, 07:38
Re: Car Spawn - by LarzI - 01.09.2010, 07:39

Forum Jump:


Users browsing this thread: 1 Guest(s)