13.04.2014, 01:08
Hey, how do I make this code able to work with Admin and Mod only? I know I can do ''if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pMod] == 1)'' but that won't work, because I also need to be set as mod then, how can I do this in a way which works?
pawn Код:
YCMD:unjail(playerid, params[], help)
{
if(help) return SCM(playerid, COLOR_GREY, "Not supported");
if(PlayerInfo[playerid][pAdmin] >= 1)
{
if(PlayerInfo[playerid][pAjailed] == 1)
{
new id, string[256];
if(sscanf(params, "u", id)) return SCM(playerid, COLOR_GRAD, "USAGE: /unjail [playerid]");
PlayerInfo[id][pAjailTime] = 0;
PlayerInfo[id][pAjailed] = 0;
PlayerInfo[id][pPrisons]-= 1;
SetPlayerInterior(id, 0);
SetPlayerVirtualWorld(id, 0);
SetPlayerPos(id, 448.9938,-1663.6447,25.5938);
TextDrawHideForPlayer(id, Textdraw6969[id]);
format(string, sizeof(string),"[INFO]: Admin %s has unjailed %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(id));
ABroadCast(COLOR_ORANGE,string, 5);
format(string, sizeof(string), "You have unjailed %s.",GetPlayerNameEx(id));
SCM(playerid, COLOR_BLUE, string);
format(string, sizeof(string), "Admin %s has unjailed you.",GetPlayerNameEx(playerid));
SCM(id, COLOR_BLUE, string);
}
else
{
new string[128];
format(string,sizeof(string),"This player is not in Ajail.");
SCM(playerid, COLOR_GRAD1, string);
}
}
else
{
new string[128];
format(string,sizeof(string),"~n~~n~~w~You cannot use this command.");
TextDrawSetString(Textdraw69[playerid],string);
TextDrawShowForPlayer(playerid, Textdraw69[playerid]);
SetTimer("hidetextdraw", 4000, false);
}
return 1;
}