15.06.2014, 11:08
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?
//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;
}