[HELP]I want to know how to do register with permission
#1

I want to know how to do register with permission, player must have permission to register his account, if he dont have permission he cant register his account, anyone help me?
Reply
#2

permission from who?
permission through what?
Reply
#3

Quote:
Originally Posted by HeLiOn_PrImE
Посмотреть сообщение
permission from who?
permission through what?
Look....When someone joins the server, he need to register, but I want to have to get permission first, and then register..Permission from Administrator with some command for example /regperm [ID/Name_Surname]
Reply
#4

You need set up UCP or something. Or you can use MySQL aswell, if player connect, sethim to spectating mode. For start scripting you need up to player variable like new Permission[MAX_PLAYERS];. And add to OnPlayerConnect function if[playerid][Permission] == 1 when show register dialog else Kick player.
Reply
#5

its not that hard if you have a system already ?

a small example
pawn Код:
//variables
new AlloweToReg[MAX_PLAYERS];

public OnPlayerRegsiter(playerid)//what ever your register system is
{
    if(AlloweToReg[playerid]==0) return RequestPermission(playerid);
    //else continue the registration...
    return 1;
}

stock RequestPermission(playerid)// function for the permision
{
    new count =0;
    AlloweToReg[playerid]=0;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPLayerAdmin(i))
        {  
            new Str(40);foramt(Str,sizeof str,"Player: %s (%d) requires permission to register!",GetPlayerName(playerid),playerid);
            SendClientMessage(i,-1,STR);
            count++;
        }
    }
    if(count==0) return SendClientMessage(playerid,-1,"No Admins Only At The Moment!");
}

//the admin cmd to allow the registration
//Using ZCMD and sscanf
COMMAND:allowregister(playerid, params[])
{
    new targetid;if(sscanf(params,"i", targetid)) return SendClientMessage(playerid, -1, "Usage: /AllowRegister [Playerid]");
    AlloweToReg[playerid]=1;
    return 1;
}
Reply
#6

Thanks!

DONE
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)