Admin Save help
#1

Alright, well when I do /makeadmin it all is well, until server is restarted, so is there away to make it like this?

dUserSetINT(PlayerName(playerid)).("score",GetPlay erScore(playerid));
SetPlayerMoney(playerid,dUserINT(PlayerName(player id)).("money"));

But with Admin. So it save the players Admin level on disconnect and loads on login.
Reply
#2

Quote:
Originally Posted by L30
Alright, well when I do /makeadmin it all is well, until server is restarted, so is there away to make it like this?

dUserSetINT(PlayerName(playerid)).("score",GetPlay erScore(playerid));
SetPlayerMoney(playerid,dUserINT(PlayerName(player id)).("money"));

But with Admin. So it save the players Admin level on disconnect and loads on login.
Yeah, make a save function.

pawn Код:
stock SaveMe(playerid)
{
  // Add all your stuff to save here including:
  dUserSetINT(PlayerName(playerid)).("Admin",PlayerInfo[playerid][pAdmin]);
}
k then add that to OnPlayerDisconnect and it will save all their shit on exit.

Also, on your register command I'm assuming you are creating "Admin" in the file.

So after you've saved the player, log them in with their stuff next time with a similar function.

pawn Код:
stock Login(playerid)
{
  PlayerInfo[playerid][pAdmin] = (dUserINT(pNick(playerid)).("Admin"));
  // Rest of their stuff here.
}
and add that to the login command.

Obviously you will have to change it all to fit your script, that's just an example.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)