03.08.2013, 02:20
I was wondering how I could do a /ajail [Player ID/Name] [Time(in minutes)] [Reason] command
CMD:ajail(playerid, params[])
{
if(IsPlayerAdmin(playerid) || pInfo[playerid][pAdmin] >= 1)
{
new time,reason[64], string[200], adminname[MAX_PLAYER_NAME], pname[MAX_PLAYER_NAME], target;
GetPlayerName(target, pname, sizeof(pname));
GetPlayerName(playerid, adminname, sizeof(adminname));
if(sscanf(params,"dds",target,time,reason))
return SendClientMessage(playerid, -1,"Usage:/ajail [playerid][time][reason]");
if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Note: That ID is invalid");
if(time <= 0) return SendClientMessage(playerid, -1,"The jail time must be over 0!");
format(string, 200, "* %s has jailed %s for %d minutes. Reason:%s", adminname, pname, time, reason);
SCMTA(-1, string);
pInfo[target][pJailed] = 1;
SetPlayerPos(target,0.0,0.0,0.0);
SetPlayerVirtualWorld(target, 999999);
ClearWeapons(playerid);
TogglePlayerControllable(playerid, 1);
}
else
{
SendClientMessage(playerid, -1, "You're not authorized to do this command");
return 1;
}
return 1;
}
stock ClearWeapons(playerid)
{
ResetPlayerWeapons(playerid);
foreach(Player, i)
{
pInfo[playerid][pWeapons][i] = 0;
pInfo[playerid][pAmmo][i] = 0;
pInfo[playerid][pEquipped][i] = false;
}
return 1;
}
pWeapons[13],
pAmmo[13],
pJailed,
bool:pEquipped[13],