GunShop enter/exit
#1

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;
}
Reply
#2

https://sampwiki.blast.hk/wiki/SetPlayerFacingAngle
Reply
#3

Thank you bro i have it in my command but i deleted it so im bot for real thank you so much
Reply
#4

It work for entering in object but for leaving it dont work
Reply
#5

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
Reply
#6

oh thank you for help i know now
Reply
#7

i fixed it i just use to set facing ange to west because it is in east so it fixed thank you
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)