Sign in to follow this  
Kubko

Serverside player vehicle check (not entering)

Recommended Posts

Posted (edited)

Hey, today I have been trying to add check whether player already sits in the vehicle (not entering). The closest one method that was close to fit my needs was this:

if(player.vehicle && player.seat)

This worked for all the seats, but for obvious reason seat 0 was determinated as player woudln't be sitting in the vehicle. So what's the way to make all seats work correctly? Thank you very much!

Edited by Kubko

Share this post


Link to post
Share on other sites

Check if player.seat is null or undefined. Other way around it would be to use if (player.seat +2) as javascript returns false if you check an int and it is 0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.