enter and exit
#1

I see in many servers that you can enter bussines/pd/hospital/etc. by pressing " y "
how can i do it?
Reply
#2

bump
Reply
#3

you use the OnPlayerKeyStateChange callback!
Reply
#4

what function should i use on that callback ??
please explain more
Reply
#5

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_YES)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, /*Coordinate1*/, /*Coordinate2*/, /*Coordinate3*/)
        {
            //Stuff here
        }
    }
    return 1;
}
Reply
#6

REP+ kyance but i am still not understand , I wanna know how you do it?
Reply
#7

heey!!
Reply
#8

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_YES)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, float:x, float:y, float:z) // gets if the player is close to the point you want him to enter.. if he is.. then if he press KEY_YES he will be teleported on the pos you will set
        {
            SetPlayerPos(playerid,Float:x,Float:y,Float:z);
        }
    }
    return 1;
}
Reply
#9

An example of another thread I posted in: http://forum.sa-mp.com/showpost.php?...07&postcount=2

Replace cmd_enter(playerid, ""); and cmd_exit(playerid, ""); with your code for entering and exiting.
Reply
#10

thanks again
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)