Hello i want /enter and /exit used whit [ F Or Enter ] For enter to house or biz
#1

Hello i want /enter and /exit used whit [ F Or Enter ] For enter to house or biz
Pls Helpme (
Reply
#2

Look this.

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

i cant find :\ pls find for me or help me to find this
Reply
#4

PHP Code:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if((
newkeys KEY_SECONDARY_ATTACK) && !(oldkeys KEY_SECONDARY_ATTACK)) // this if statement will called when a player presses F or Enter key 
    
{
        if(
IsPlayerInRangeOfPoint(playerid,2,X,Y,Z// this would help you to get if player is near biz icon (x y z are your biz icon cordinates
        
// in here it will do actions you want if player is in that range
            
SetPlayerPos(playerid,x,y,z); 
            
SetPlayerInterior(playerid,interior id);
        }
    }
    return 
1;

i hope you understand

Read
OnPlayerKeyStateChange
keys
for more and better info
Reply
#5

Are this code used for public server ? Enter or F are used to enter vehicle.
What happens if some vehicle is close to house icon ?
..maybe you can get some ideas from the ManualGearbox script, it was for download in this forum, there was used Y and N to shift gears...
Reply
#6

Quote:
Originally Posted by VeryTallMidget
View Post
Are this code used for public server ? Enter or F are used to enter vehicle.
What happens if some vehicle is close to house icon ?
..maybe you can get some ideas from the ManualGearbox script, it was for download in this forum, there was used Y and N to shift gears...
it wont be so annoying just it will be annoying when you wanted to enter a vehicle near a point not entering the interior

and also you can check if any vehicle is more near and it wont enter the icon but its useless players can just push car a little way to enter it dont take it so importent
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)