#include <YSI\y_hooks>
#include "includes/commands/adminCommands/setadmin.pwn"
#include <YSI\y_hooks> CMD:setadmin(playerid, params[]) { new playerID, parameter, adminastring[128]; if(!IsPlayerAdmin(playerid)) return SendErrorMessage(playerid, "Nincs jogosultsбgod a parancs hasznбlatбhoz."); if(PlayerInfo[playerid][pAdmin] < 4) return SendErrorMessage(playerid, "Nincs jogosultsбgod a parancs hasznбlatбhoz."); else if(sscanf(params, "ui", playerID, parameter)) { SendUsageMessage(playerid, "/setadmin [jбtйkos ID VAGY nйv] [szint]"); SendServerMessage(playerid, "1 = 1*Admin, 2 = 2*Admin, 3 = 3*Admin, 4 = 4*Admin"); return 1; } else if(parameter < 0 || parameter > 5) return SendErrorMessage(playerid, "Helytelen paramйterek."); else if(!IsPlayerConnected(playerID)) return SendErrorMessage(playerid, "A megadott jбtйkos nem elйrhető."); else { format(adminastring, sizeof(adminastring), "AdmCmd: (%s) megvбltoztatta (%s) admin szintjйt (%i)-re.", ReturnName(playerid), ReturnName(playerID), parameter); SendClientMessageToAllEx(COLOR_RED, adminastring); format(adminastring, sizeof(adminastring), "Admin szinted megvбltozott. Mostantуl a szinted (%i) (%s)-бttal.", parameter, ReturnName(playerid)); SendClientMessage(playerID, COLOR_GREEN, adminastring); PlayerInfo[playerID][pAdmin] = parameter; SaveCharacter(playerid); } return 1; }
For i dont have idea why all command's work just police (faction), and admin commands dont work's, where is the permission.
|
CMD:setadmin(playerid, params[])
{
new playerID, parameter, adminastring[128];
if(!IsPlayerAdmin(playerid)) return SendErrorMessage(playerid, "Nincs jogosultsбgod a parancs hasznбlatбhoz.");
if(PlayerInfo[playerid][pAdmin] < 4) return SendErrorMessage(playerid, "Nincs jogosultsбgod a parancs hasznбlatбhoz.");
if(sscanf(params, "ui", playerID, parameter))
{
SendUsageMessage(playerid, "/setadmin [jбtйkos ID VAGY nйv] [szint]");
SendServerMessage(playerid, "1 = 1*Admin, 2 = 2*Admin, 3 = 3*Admin, 4 = 4*Admin");
return 1;
}
if(parameter < 0 || parameter > 5) return SendErrorMessage(playerid, "Helytelen paramйterek.");
if(!IsPlayerConnected(playerID)) return SendErrorMessage(playerid, "A megadott jбtйkos nem elйrhető.");
format(adminastring, sizeof(adminastring), "AdmCmd: (%s) megvбltoztatta (%s) admin szintjйt (%i)-re.", ReturnName(playerid), ReturnName(playerID), parameter);
SendClientMessageToAllEx(COLOR_RED, adminastring);
format(adminastring, sizeof(adminastring), "Admin szinted megvбltozott. Mostantуl a szinted (%i) (%s)-бttal.", parameter, ReturnName(playerid));
SendClientMessage(playerID, COLOR_GREEN, adminastring);
PlayerInfo[playerID][pAdmin] = parameter;
SaveCharacter(playerid);
return 1;
}