Fexist n Register/Admin System
#2

PHP код:
CMD:setlevel(playerid,params[])
{
       new 
id,level;
    if(!
IsPlayerAdmin(playerid)) return  SendClientMessage(playerid, -1"Haley: {FF0000}You are not an RCON Administrator!");//send a message that the player is not logged in as RCON
    
if(sscanf(params,"ud",id,level) return SendClientMessage(playerid, -1"Haley: {FF0000}The usage for this command is - /promote [NAME/ID] [LEVEL]");
    if(
level 5) return SendClientMessage(playerid, -1"Haley: Error 404! Your an idiot! You cant promote further than Level 5");
    new 
INI:File INI_Open(UserPath(id));//this is the example used in Kush's tut link above, make it fit in your system, note that i've changed the UserPath(playerid) to UserPath(id) to promote the chosen player not yourself
    
INI_WriteInt(File,"Admin",level); // writes the admin level in the ini file and makes the player admin.
    
INI_Close(File); //closes the ini file
    
return 1;

try this
Reply


Messages In This Thread
Fexist n Register/Admin System - by xLucy - 05.11.2016, 20:32
Re: Fexist n Register/Admin System - by Yaa - 05.11.2016, 21:14

Forum Jump:


Users browsing this thread: 1 Guest(s)