19.11.2009, 05:12
if(strcmp(cmd, "/ajail", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "[Usage:] /ajail [playerid/partofname] [minutes]");
return 1;
}
new playa;
new money;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
money = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
format(string, sizeof(string), "[Info:] You jailed %s", GetPlayerNameEx(playa));
SendClientMessage(playerid, COLOR_ADMINCMD, string);
format(string, sizeof(string), "[Info:] You have been jailed by %s for %d minutes", GetPlayerNameEx(playerid),money);
SendClientMessage(playa, COLOR_WHITE, string);
format(string, sizeof(string), "[INFO] %s has been jailed by %s !", GetPlayerNameEx(playa), GetPlayerNameEx(playerid));
SendClientMessageToAll(COLOR_WHITE, string);
SetPlayerVirtualWorld(playa,2);
SetPlayerInterior(playa,6);
SetPlayerPos(playa, 264.5743,77.5118,1001.0391);
SafeResetPlayerWeapons(playa);
WantedPoints[playa] = 0;
ResetPlayerWantedLevelEx(playa);
PlayerInfo[playa][pJailed] = 1;
PlayerInfo[playa][pJailTime] = money*60;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not authorized to use that command");
}
}
return 1;
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "[Usage:] /ajail [playerid/partofname] [minutes]");
return 1;
}
new playa;
new money;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
money = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
format(string, sizeof(string), "[Info:] You jailed %s", GetPlayerNameEx(playa));
SendClientMessage(playerid, COLOR_ADMINCMD, string);
format(string, sizeof(string), "[Info:] You have been jailed by %s for %d minutes", GetPlayerNameEx(playerid),money);
SendClientMessage(playa, COLOR_WHITE, string);
format(string, sizeof(string), "[INFO] %s has been jailed by %s !", GetPlayerNameEx(playa), GetPlayerNameEx(playerid));
SendClientMessageToAll(COLOR_WHITE, string);
SetPlayerVirtualWorld(playa,2);
SetPlayerInterior(playa,6);
SetPlayerPos(playa, 264.5743,77.5118,1001.0391);
SafeResetPlayerWeapons(playa);
WantedPoints[playa] = 0;
ResetPlayerWantedLevelEx(playa);
PlayerInfo[playa][pJailed] = 1;
PlayerInfo[playa][pJailTime] = money*60;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not authorized to use that command");
}
}
return 1;