Master_MTA Posted September 28, 2018 Share Posted September 28, 2018 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 Link to comment
N3xT Posted September 28, 2018 Share Posted September 28, 2018 You're trying to check if the player has an internet connection in the local server, right? Link to comment
Master_MTA Posted September 28, 2018 Author Share Posted September 28, 2018 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 Link to comment
N3xT Posted September 28, 2018 Share Posted September 28, 2018 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. Link to comment
Master_MTA Posted September 28, 2018 Author Share Posted September 28, 2018 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+_+ Link to comment
Simple. Posted September 28, 2018 Share Posted September 28, 2018 (edited) 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 September 28, 2018 by Simple. Link to comment
Master_MTA Posted September 28, 2018 Author Share Posted September 28, 2018 35 minutes ago, Simple. said: onPlayerNetworkStatus nope i need to check if the player connected to internet or no Link to comment
NeXuS™ Posted September 28, 2018 Share Posted September 28, 2018 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. Link to comment
Master_MTA Posted September 28, 2018 Author Share Posted September 28, 2018 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 Link to comment
NeXuS™ Posted September 28, 2018 Share Posted September 28, 2018 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. Link to comment
Moderators IIYAMA Posted September 28, 2018 Moderators Share Posted September 28, 2018 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 1 Link to comment
Master_MTA Posted September 28, 2018 Author Share Posted September 28, 2018 (edited) 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 thx dude Edited September 28, 2018 by Master_MTA 1 Link to comment
NeXuS™ Posted September 28, 2018 Share Posted September 28, 2018 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? 1 Link to comment
iMr.WiFi..! Posted September 28, 2018 Share Posted September 28, 2018 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? Link to comment
Master_MTA Posted September 28, 2018 Author Share Posted September 28, 2018 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 Link to comment
NeXuS™ Posted September 28, 2018 Share Posted September 28, 2018 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. Link to comment
Master_MTA Posted September 28, 2018 Author Share Posted September 28, 2018 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 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 .. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now