SOLVED - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SOLVED (
/showthread.php?tid=446416)
SOLVED -
_Khaled_ - 25.06.2013
PROBLEM SOLVED.
I admit I posted it before searching/trying in the problem enough.
Please any admin remove this topic.
Sorry for forums spam.
Re : Weird Y_INI giving admin level to everyone. -
morocco - 25.06.2013
pawn Код:
if(strcmp(cmd, "/makeadmin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 0) // <<==== after make yourself admin change this !! to ( >= 10 or what do u want ;) )
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{7DAEFF}USAGE: /makeadmin [playerid/PartOfName] [level(1-10)]{7DAEFF}");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strvalEx(tmp);
if(IsPlayerConnected(para1))
if(level > 10 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "You can't go higher than 7 or lower than 0."); return 1; }
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pAdmin] = level;
printf("Info: %s has promoted %s to a level %d admin.", sendername, giveplayer, level);
format(string, sizeof(string), "You have been promoted/demoted to a level %d admin by %s.", level, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "You have promoted/demoted %s to a level %d admin.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
}
return 1;
}
Re: Weird Y_INI giving admin level to everyone. -
Smokkr - 25.06.2013
You didn't say to the server that the default level should be 0. Add this:
pawn Код:
new PlayerInfo[playerid][pAdmin] = 0;
Re: SOLVED -
_Khaled_ - 25.06.2013
Thanks guys, I really appreciate that.