Saving team
#1

Hello, i wanna know if it's possible to save and load on MySQL the team selected by the player.

Example: I choose USA and when i relog i'll auto-spawn as USA Team (matching the correct classid), how i can do it?
Reply
#2

It's certainly possible. Create a variable that'll hold player's teams and save it in your MySQL database, then load it every time a player logs in and set their team to the variable you've created. As for classid, you could make it so that if a player spawns with a certain classid, it sets their team variable to a certain team.
Reply
#3

Save the team id and skin id as an integer in the database on PlayerDisconnect and then load it when the player connects.

Then
use setspawninfo on onplayerrequest class and set the team and skin id then use Spawnplayer(playerid).
Not that SetSpawnInfo doesn't set the team correctly to use SetPlayerTeam on onplayerspawn
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)