Login before playing?
#1

Hello guys, I been wondering how I can create that? I had that with my old fs Ladmin, but i'm currently creating my own GM with my own admin system.

Here's my enum

Код HTML:
enum PlayerInfo
{
   Logged,
   Level,
   Duty,
   pGD,
   pTS,
   pVip,
   pCop,
}
Reply
#2

Try something like:

OnPlayerConnect - PlayerInfo[playerid][Logged] = 0;

Login Stuff - PlayerInfo[playerid][Logged]= 1;

OnPlayerDisconnect - PlayerInfo[playerid][Logged] = 0;

Something along those lines, then you can use if(PlayerInfo[playerid][Logged]== 0) << Not logged in
then
if(PlayerInfo[playerid][Logged] == 1) << Is loggedin.

Something like that
Reply
#3

What do you exactly want? like if the player's not logged in he can't spawn? or what?
Reply
#4

Yeah exactly, no spawn before he's logged in, fix it for me and ill +1 on u.
Reply
#5

you can add player spawning after a dialog where player has logged in, or if you are using Spawn button like this:
Код:
public OnPlayerRequestSpawn(playerid)
{
    if(!pLogged[playerid]) // your variable for logged players
    {
        SendClientMessage(playerid,COLOR_GREEN,"You are not logged.");
        return 0;
    }
    else
   {
        //SetPlayerPos... and the rest
   }
    return 1;
}
Reply
#6

Testing it out right now, if it works, ill rep you.
Reply
#7

@Dominik123,

It works, thanks!
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)