Master_MTA

about connection to internet

Recommended Posts

hello their i just wanna know is there any way to check if the player connected to internet or no

it's doesn't matter if he was in local server or else

i just wanna to check if he have internet connection or not

i know i can do it with fetchRemote but it's take time to configuration  so i need any way else faster 

Share this post


Link to post

You're trying to check if the player has an internet connection in the local server, right?

Share this post


Link to post
40 minutes ago, N3xT said:

You're trying to check if the player has an internet connection in the local server, right?

yup i guess i can do it with getPlayerIP

but this way will not work correctly because the player maybe change his default ip adress

127.0.0.1

 

Share this post


Link to post

I have another way but I'm not sure if it's going to work perfectly or not

Try to get the player country from his IP, if you find his country then he's connected, anything else means he's disconnected.

Share this post


Link to post
2 minutes ago, N3xT said:

anything else means he's disconnected

thx i will check it

5 minutes ago, N3xT said:

I have another way but I'm not sure if it's going to work perfectly or not

 

that is not work because getplayerip function doesn't get the global ip of user in local server it's get his local ip  

any other idea+_+

Share this post


Link to post
9 hours ago, Master_MTA said:

hello their i just wanna know is there any way to check if the player connected to internet or no

it's doesn't matter if he was in local server or else

i just wanna to check if he have internet connection or not

i know i can do it with fetchRemote but it's take time to configuration  so i need any way else faster 

I'm not sure exactly what you want, but maybe that's what you want

onPlayerNetworkStatus

 

Edited by Simple.

Share this post


Link to post
35 minutes ago, Simple. said:

onPlayerNetworkStatus

nope

i need to check if the player connected to internet or no

Share this post


Link to post

I don't get what you are trying to achieve. On a local server, you'll be the only player connected to the server. If you open the ports for it, the player has to have an internet connection to join your server.

Share this post


Link to post
23 minutes ago, NeXuS™ said:

to join your server.

that's not what am talking about i need something that make me know if user have connected to internet or no is there any way i will create resource depends on this if the user have internet connection then load resource else don't load it that's what am talking about 

Share this post


Link to post

A player cannot join your server if he has no internet connection, unless you are hosting a local server and that player is connected to your internet.

Share this post


Link to post

In case of a local-server. JavaScript + browser might do the trick as well:

https://wiki.multitheftauto.com/wiki/ExecuteBrowserJavascript

https://stackoverflow.com/questions/189430/detect-the-internet-connection-is-offline

if (navigator.onLine == true) {
	console.log("This might work");
}

(no guarantees for this browser)

 

https://wiki.multitheftauto.com/wiki/Resource_Web_Access

!important

 

 

  • Thanks 1

Share this post


Link to post
1 hour ago, NeXuS™ said:

internet

look u didn't understand me so i will explain what am gonna do

first of all am gonna create dxlib editor for my own lib good

so this is resource must be work on 1 pc only just enter the serial which u get it when u bought the dxlib editor from me good

so the idea i have a database on my vps i will make the resource when it start for the first time to ask the user to enter the serial but before that

i need to check if the user have internet connection or not because if callRemote return false that's mean my website is shutdown in this case i will make dxlib editor free for all users

so i need first to check  if the user is connected to internet or not to avoid returning callRemote false while my website is lunched u got it?

22 minutes ago, IIYAMA said:

(no guarantees for this browser)

 

that's will be enough thx

i don't know how this idea didn't come to my mind :D

thx dude

Edited by Master_MTA
  • Like 1

Share this post


Link to post

Or you can just use fetchRemote and use the responseInfo/success part to check if his serial is in the database. I'd reconsider this resource, as this means you have to have an internet connection to be able to use the script. Are you planning to give them a compiled script, or a source code?

  • Thanks 1

Share this post


Link to post
12 hours ago, Master_MTA said:

i know i can do it with fetchRemote but it's take time to configuration  so i need any way else faster 

 

Just now, NeXuS™ said:

Or you can just use fetchRemote and use the responseInfo/success part to check if his serial is in the database. I'd reconsider this resource, as this means you have to have an internet connection to be able to use the script. Are you planning to give them a compiled script, or a source code?

 

Share this post


Link to post
1 minute ago, NeXuS™ said:

ompiled script

compiled script

2 minutes ago, NeXuS™ said:

etchRemote and use the responseInfo/succes

yeah that was my idea but it's take a while to fetchRemote  & it's not stable some times it's returns false while u have internet connection any way thx for ur replay i didn't seen it thx

@iMr.WiFi..!

thx all

12 hours ago, Master_MTA said:

i know i can do it with fetchRemote but it's take time to configuration

 

Share this post


Link to post

Easy way. As you have a compiled script, this means you can add a line into it.

local givenSerial = -- The player's serial who bought the script.

function resourceLoad()
	if givenSerial == getPlayerSerial(localPlayer) then
		-- Loading functions
	end
end
addEventHandler("onClientResourceStart", resourceRoot, resourceLoad)

This means you'll have to get their serial, when they make the purchase, and then compile the resource this way.

Share this post


Link to post
1 minute ago, NeXuS™ said:

serial

am not talking about user serial am talking about serial that i made it from chars and numbers and give it to user to enter it to edit box and every thing after that is easy callRemote,check with php etc..

i will sell this resource for more 1 user so it's hard to me to edit script for every user and compile it :D

i will make every think automatically buying the script from website and creating serial for user when he pay after paypal success etc

thx dude ..    

Share this post


Link to post

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

  • Recently Browsing   0 members

    No registered users viewing this page.