Mechanism question
#1

Hello, I want to create a /invite and /join function.
The criteria must be:
- Once the inviter or the invited person disconnects from the server, the invite is not valid anymore (to prevent someone else with the same player ID with the disconnected invited person being able to /join instead.

I am confused on which/how enum/variable to use, perhaps both to make it work? Optional: please show me the basic structure.
Reply
#2

First of all, you should understand what an enum is. https://sampforum.blast.hk/showthread.php?tid=318307 this thread will explain it well to you.

Basic structure?
  1. Create an array (MAX_PLAYERS in size, if you will be running server with less than 256 players, you could use "char") - for each player it will contain inviter id
  2. On /invite assign inviter id to invited key
  3. OnPlayerDisconnect set the player key to INVALID_PLAYER_ID
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)