06.10.2018, 15:32
Before we start thanks for ****** for creating YSI and thanks for creators of ZCMD and SSCANF.
First i have problem with my offline set admin command
When i set some one his level i can set him again with the same level
Can Someone help me?
First i have problem with my offline set admin command
Код:
CMD:oadmin(playerid, params[]) { new targetname[24], filestring[79], level; if (PlayerInfo[playerid][pAdmin] < 7) return 0; if(level < 0 || level > 7) return SendClientMessage(playerid, red, "Error: Invailed Admin Level!"); if(sscanf(params, "s[24]d", targetname, level)) return SendClientMessage(playerid, COLOR_WHITE, "Correct Usage: /oadmin [name] [level]"); format(filestring, sizeof(filestring), "/PG/Accounts/%s.ini", targetname); if(!fexist(filestring)) return SendClientMessage(playerid, red, "Error: Incorrect Account!"); else { new INI:File = INI_Open(filestring); INI_SetTag(File, "data"); INI_WriteInt(File, "Admin", level); INI_Close(File); new done[128]; format(done, sizeof(done), "You have set %s admin level to %d", targetname, level); SendClientMessage(playerid, COLOR_YELLOW, done); } return 1; }
Can Someone help me?