/setadmin not work
#1

if I login to rcon and make me /setadmin, this just only sendClientMessage but not write at my playername.ini I use this code
Quote:

CMDetadmin(playerid, params[], help)
{
#pragma unused help
if(PlayerInfo[playerid][pAdmin] < 7 && !IsPlayerAdmin(playerid)) return SCM(playerid, COLOR_RED, "You need to be RCON Admin to use this!");
new
string[128],pplayerid,level;
if(sscanf(params, "ui", pplayerid,level)) return SCM(playerid, COLOR_RED, "Usage: /setadmin [Player ID/Player Name] [Admin Level]");
if(level > 7 || level <= -1) return SCM(playerid,COLOR_RED,"Max level is 7" "and" "Lower is 0");
if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has given you admin level"COL_WHITE" %d",GetName(playerid),level);
SCM(pplayerid,-1,string);
format(string,sizeof(string),""COL_RED"Player "COL_WHITE"%s "COL_RED"now have admin level"COL_WHITE" %d",GetName(pplayerid),level);
SCM(playerid,-1,string);
PlayerInfo[pplayerid][pAdmin] = level;
return 1;
} //Aka GiDan Admin FS

Reply
#2

Dude there isn't code for write something in your file "playername.ini"! How you want to write it? By itself?
Reply
#3

I mean this can auto write
Reply
#4

fixed
Reply
#5

next time fix the identation and tell others how you fixed it if anyone else ever faces this
Reply
#6

I edit from
Quote:

CMDetadmin(playerid, params[], help)
{
#pragma unused help
if(PlayerInfo[playerid][pAdmin] < 7 && !IsPlayerAdmin(playerid)) return SCM(playerid, COLOR_RED, "You need to be RCON Admin to use this!");
new
string[128],pplayerid,level;
if(sscanf(params, "ui", pplayerid,level)) return SCM(playerid, COLOR_RED, "Usage: /setadmin [Player ID/Player Name] [Admin Level]");
if(level > 7 || level <= -1) return SCM(playerid,COLOR_RED,"Max level is 7" "and" "Lower is 0");
if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has given you admin level"COL_WHITE" %d",GetName(playerid),level);
SCM(pplayerid,-1,string);
format(string,sizeof(string),""COL_RED"Player "COL_WHITE"%s "COL_RED"now have admin level"COL_WHITE" %d",GetName(pplayerid),level);
SCM(playerid,-1,string);
PlayerInfo[pplayerid][pAdmin] = level;
return 1;

to
Quote:

CMDetadmin(playerid, params[], help)
{
#pragma unused help
if(PlayerInfo[playerid][pAdmin] < 7 && !IsPlayerAdmin(playerid)) return SCM(playerid, COLOR_RED, "You need to be RCON Admin to use this!");
new
string[128],pplayerid,level;
if(sscanf(params, "ui", pplayerid,level)) return SCM(playerid, COLOR_RED, "Usage: /setadmin [Player ID/Player Name] [Admin Level]");
if(level > 7 || level <= -1) return SCM(playerid,COLOR_RED,"Max level is 7" "and" "Lower is 0");
if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has given you admin level"COL_WHITE" %d",GetName(playerid),level);
SCM(pplayerid,-1,string);
format(string,sizeof(string),""COL_RED"Player "COL_WHITE"%s "COL_RED"now have admin level"COL_WHITE" %d",GetName(pplayerid),level);
SCM(playerid,-1,string);
PlayerInfo[pplayerid][pAdmin] = level;
SaveStats(targetid);
return 1;

thanks for helping guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)