01.09.2010, 07:39
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;
}