12.12.2014, 15:32
First, use this y_ini register system;
https://sampforum.blast.hk/showthread.php?tid=273088
Then for /setrank
Taken from my own gamemode, tested and works.
https://sampforum.blast.hk/showthread.php?tid=273088
Then for /setrank
pawn Код:
CMD:setrank(playerid, params[])
{
new lvl, player, string[128]; // Local variable
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 5) // Checks if the player is a RCON admin or level 5 admin or more
{
if(sscanf(params,"ui", player, lvl)) return SendClientMessage(playerid, GREY, "Usage: /setadmin [id] [level]");
if(lvl > 6) return SendClientMessage(playerid, RED, "MAX. Admin level is 6!");// Checks if you put a level above 6 (You can change it to your own)
if(!IsPlayerConnected(player)) return SendClientMessage(playerid, RED, "Invalid player id!");
else
{
format(string,sizeof(string),"You have set "COL_LIGHTGREEN"%s (%d)"COL_WHITE" admin level to "COL_LIGHTGREEN"%d", GetName(player), player, lvl); // Sends message to player
SendClientMessage(playerid, WHITE, string);
format(string,sizeof(string),"Admin "COL_LIGHTGREEN"%s (%d)"COL_WHITE" has set your admin level to "COL_LIGHTGREEN"%d", GetName(playerid), playerid, lvl);
SendClientMessage(player, WHITE, string);
PlayerInfo[player][pAdmin] = lvl; // Adds the level to player status
}
}
else // If the player is neither a RCON admin or level 4, then he will get this message
{
SendClientMessage(playerid, RED, "You're not a level 4 admin");
}
return 1;
}