IncomingConnection
Server-Side Event
JavaScript |
---|
This event is triggered when an player establishes a connection with the server before loading the resources.
JavaScript Syntax
Parameters
- ip: String - player's IP
- serial: String - player's serial
- rgscName: String - player's social club username.
- rgscId: String - player's social club ID.
- gameType: String - game types:
- steam
- rgsc
- egs
Example
const rgscIdBlackList = [123]; mp.events.add('incomingConnection', (ip, serial, rgscName, rgscId, gameType) => { // This event checks whether the specified social club ID (123) or social club username includes (kemperrr), therefore, cancels connection on match. return rgscIdBlackList.includes(rgscId) || rgscName.includes('kemperrr'); });