[HELP]I want to know how to do register with permission
#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


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)