System::connectToServer
Client-Side Function
JavaScript Syntax
Required Params
- ip: string
- port: number
- sessionData: string (Optional)
Return value
- void
Syntax
mp.system.connectToServer(ip, port, sessionData);
Example
mp.system.connectToServer("127.0.0.1", 22005, "playerAuthToken");
Notes
If sessionData is provided, it will be available in:
mp.storage.sessionData
after connection completes.
See also
- mp.game.system.ceil
- mp.game.system.cos
- mp.game.system.floor
- mp.game.system.pow
- mp.game.system.round
- mp.game.system.settimera
- mp.game.system.settimerb
- mp.game.system.shiftLeft
- mp.game.system.shiftRight
- mp.game.system.sin
- mp.game.system.sqrt
- mp.game.system.startNewScriptWithArgs
- mp.game.system.startNewScript
- mp.game.system.startNewStreamedScriptWithArgs
- mp.game.system.startNewStreamedScript
- mp.game.system.toFloat
- mp.game.system.vdist2
- mp.game.system.vdist
- mp.game.system.vmag2
- mp.game.system.vmag
- mp.game.system.wait
- mp.system.notify
- mp.system.isFullscreen
- mp.system.isFocused
- mp.system.setConnectableServers
- mp.system.connectToServer