Ajail - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Ajail (
/showthread.php?tid=455756)
Ajail -
lramos15 - 03.08.2013
I was wondering how I could do a /ajail [Player ID/Name] [Time(in minutes)] [Reason] command
Re: Ajail -
PrinceKumar - 03.08.2013
Create a jail timer and use it in ur jail cmd, for player/name n reason , as i know with including sscanf create a sscanf format n include playerid, time and reason in it. For mor information visit here:
https://sampforum.blast.hk/showthread.php?pid=2144299#pid2144299
Re: Ajail -
lramos15 - 04.08.2013
Thanks for the tutorial but it seems out of date/ incorrect does anyone else mind helping me
Re: Ajail -
lramos15 - 05.08.2013
Can someone please help me out
Re: Ajail -
George_Fratelli - 05.08.2013
pawn Код:
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;
}
You'll need this stock
pawn Код:
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;
}
Add these to your pInfo enum.
pawn Код:
pWeapons[13],
pAmmo[13],
pJailed,
bool:pEquipped[13],
It's not tested.
On your login make sure it checks if the player is jailed. Then it'll send them back to jail.