17.04.2012, 21:23
I don't know much about ZCMD, but i guess it's not such a big difference between them two.
This is how the command would look like: [you must have sscanf for it to work].
EDIT: Forgot the return -.- .
This is how the command would look like: [you must have sscanf for it to work].
Код:
CMD:makeadmin(playerid,params[],help)
{
new aLvl,pID,name[MAX_PLAYER_NAME],pString[64];
if(uData[playerid][aLevel] != 6) return SendMsg(playerid,red,"You are not authorized to use this command !");//Ignore this, you may have a completely different admin system.
if(help) return SendMsg(playerid,white,"Makes the targeted player an admin.");
if(sscanf(params,"ud",pID,aLvl)) return SendMsg(playerid,yellow,"Use: /makeadmin <name/id> <admin level>");
if(aLvl < 0 || aLvl > 7) return SendMsg(playerid,white,"The admin level must be between 0 and 7.");
if(!IsPlayerConnected(pID)) return SendMsg(playerid,white,"This player is not connected.");
GetPlayerName(pID,name,sizeof(name));
format(pString,sizeof(pString),"/Users/%s.ini",name);
new INI:uFile = INI_Open(pString));
INI_WriteInt(uFile,"AdminLevel",aLvl);
INI_Close(uFile);
return 1;
}

