GunShop enter/exit - 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: GunShop enter/exit (
/showthread.php?tid=662041)
GunShop enter/exit -
Deken - 22.12.2018
hello i have one question when i enter or leave gunshop my player stand like when you turn on right but i want t it to stand straight to look at the road no at wall
pawn Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_SECONDARY_ATTACK)
{
if(IsPlayerInRangeOfPoint(playerid,3.0, 1368.2349,-1279.7242,13.5469))
{
SetPlayerInterior(playerid, 1);
SetPlayerPos(playerid,285.2896,-41.4183,1001.5156);
SetCameraBehindPlayer(playerid);
SendClientMessage(playerid,-1,""CRVENA"[BD:RP]"BELA"Dobrodosli u gunshop!");
}
else if(IsPlayerInRangeOfPoint(playerid,2.0,286.148986,-40.644397,1001.515625))
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid, 1368.4775,-1279.7662,13.5469);
SetCameraBehindPlayer(playerid);
SendClientMessage(playerid,-1,""CRVENA"[BD:RP]"BELA"Dovidjenja prijatan dan!");
}
}
return 1;
}
Re: GunShop enter/exit -
Nyzenic - 22.12.2018
https://sampwiki.blast.hk/wiki/SetPlayerFacingAngle
Re: GunShop enter/exit -
Deken - 22.12.2018
Thank you bro i have it in my command but i deleted it so im bot for real thank you so much
Re: GunShop enter/exit -
Deken - 22.12.2018
It work for entering in object but for leaving it dont work
Re: GunShop enter/exit -
Nyzenic - 22.12.2018
You need to find the correct angle that's facing the road.
https://sampwiki.blast.hk/wiki/Client_Commands
You can use /rs in-game while standing at the spot and facing the correct angle.
The coordinates and the angle value will be stored in rawpositions.txt in your GTA San Andreas User Files folder.
Example:
Grab the angle and put another SetPlayerFacingAngle under the leavebuilding code.
example
Code:
SetPlayerFacingAngle(playerid, 262.000); // 262.000 is the angle i got from my rawpositions.txt
Re: GunShop enter/exit -
Deken - 22.12.2018
oh thank you for help i know now
Re: GunShop enter/exit -
Deken - 22.12.2018
i fixed it i just use to set facing ange to west because it is in east so it fixed thank you