madmin command help - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: madmin command help (
/showthread.php?tid=212500)
madmin command help -
[MKD]Max - 17.01.2011
Код:
dcmd_madmin(playerid, params[])
{
new givePlayer, str[128], PlayerFile[100], pName[24];
if(Player[playerid][admin] < 5){
format(PlayerFile, sizeof(PlayerFile), "maxadmin/users/%s.ini", pName);
dini_IntSet(PlayerFile, "Level", 1);
return SendClientMessage(playerid, COLOR_RED, "You Dont Have Right To Use This Command");
}
new id, level;
if(sscanf(params, "u", id))
{
SendClientMessage(playerid, COLOR_RED, "USAGE: /madmin [playerid]");
return 1;
}
else if (id == INVALID_PLAYER_ID)
{
SendClientMessage(playerid, COLOR_RED, "Player not found");
return 1;
}
else
{
Player[playerid][admin] = level;
SendClientMessage(givePlayer, COLOR_GREEN, "An administrator has given you administrator rights.");
format(str, sizeof(str), "You have give %s(%d) administrator rights.", pName, playerid);
SendClientMessage(playerid, COLOR_GREEN, str);
}
return 1;
}
hello guys when i go in server and try this command it work its make me 1 but when i go to server logs i find my name still as 5
![Cry](images/smilies/cry.gif)
help
Re: madmin command help -
blackwave - 17.01.2011
No comments:
pawn Код:
dcmd_madmin(playerid, params[])
{
new givePlayer, str[128], PlayerFile[100], pName[24];
new lvl;
if(Player[playerid][admin] < 5){
return SendClientMessage(playerid, COLOR_RED, "You Dont Have Right To Use This Command");
}
new id, level;
if(sscanf(params, "ui", id, lvl))
{
SendClientMessage(playerid, COLOR_RED, "USAGE: /madmin [playerid][lvl]");
return 1;
}
else if (id == INVALID_PLAYER_ID)
{
SendClientMessage(playerid, COLOR_RED, "Player not found");
return 1;
}
else
{
Player[playerid][admin] = lvl;
SendClientMessage(givePlayer, COLOR_GREEN, "An administrator has given you level administrator rights.");
format(str, sizeof(str), "You have give %s(%d) (level = %i) administrator rights.", pName, playerid,lvl);
SendClientMessage(playerid, COLOR_GREEN, str);
format(PlayerFile, sizeof(PlayerFile), "maxadmin/users/%s.ini", pName);
dini_IntSet(PlayerFile, "Level", 1);
}
return 1;
}