SA-MP Forums Archive
createobject where the camera is - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: createobject where the camera is (/showthread.php?tid=181022)



createobject where the camera is - thomas.. - 03.10.2010

im trying to make a object create where the camera pos is, pefectly infront of the player, any help?


Re: createobject where the camera is - Georgelopez1 - 03.10.2010

Just Download MTA, remember where you /save for the spawn location, and put the object there.


Re: createobject where the camera is - CrucixTM - 03.10.2010

Quote:
Originally Posted by Georgelopez1
Посмотреть сообщение
Just Download MTA, remember where you /save for the spawn location, and put the object there.
Is that what he asked for? No.

Here pal, maybe this can help you:

pawn Код:
stock Float:GetPosInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
    new Float:a;
    GetPlayerPos(playerid, x, y, a);
    if (IsPlayerInAnyVehicle(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    else GetPlayerFacingAngle(playerid, a);
    x += (distance * floatsin(-a, degrees));
    y += (distance * floatcos(-a, degrees));
    return a;
}
It gets you a location in front of the player(the way he is facing)


Re: createobject where the camera is - thomas.. - 03.10.2010

thanks, the other dude needs to lrn2read