SA-MP Forums Archive
Look at... - 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)
+--- Thread: Look at... (/showthread.php?tid=387755)



Look at... - ZeQualX - 26.10.2012

Hi everyone im working on my own GM and i realize that i need so bad any function that makes the player loot to a certain point, like:

pawn Код:
SetPlayerAngleToPoint(playerid, x, y, z);
So the character's facing angle will be in the direction of the given point (x,y,z) if anyone knows about a function like this i would really appreciate it so much, thanks.


Re: Look at... - MechaTech - 26.10.2012

Yes, if you have declared where x, y ,z are.


Re: Look at... - [TC]XxJuggaloxX - 26.10.2012

What exactly are you asking here for? You need a command? Include? Filterscript?

If you need a command use this and edit it to what you need

pawn Код:
CMD:myangle(playerid, params[])
{
    new myString[128], Float:a;
    GetPlayerFacingAngle(playerid, a);

    format(myString, sizeof(myString), "Your angle is: %0.2f", a);
    SendClientMessageEx(playerid, 0xFFFFFFFF, myString);

    new myString2[128], Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);

    format(myString2, sizeof(myString), "Your position is: %f, %f, %f", x, y, z);
    SendClientMessageEx(playerid, 0xFFFFFFFF, myString2);
    return 1;
}



Re: Look at... - verlaj - 26.10.2012

I am not sure if you want this but.

If(IsplayerInRangeOfpoint(playerid, 7.0, x ,y ,z);
{
SetPlayerFacingAngle(postion of the object)
SendClientMessage(if you want)
}