/ajail command - 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 command (
/showthread.php?tid=312438)
/ajail command -
Polomikey - 21.01.2012
I use ZCMD to script commands in my gamemode
But the problem is I don't know how to script an /ajail cmd
Can someone help me?
I also want an /oban (Offlineban) command to make the offline banned player
and a /ojail (Offline-Jail) to make the player get jailed while offline.
Re: /ajail command -
milanosie - 21.01.2012
Ajail..
Use SetPlayerPos for the other player
then use timer
On the timer calback SetPlayerPost to for example the city hall
Re: /ajail command -
Polomikey - 21.01.2012
Don't understand
Re: /ajail command -
[ABK]Antonio - 21.01.2012
For offline ban...I'm going use ZCMD, sscanf2, and dini for an example
pawn Код:
CMD:offlineban(playerid, params[])
{
if(pInfo[playerid][Level] >= 3) //this would be your admin variables instead of mine same with the level you want
{
new name[MAX_PLAYER_NAME], reason[64];
if(sscanf(params, "s[24]S('No Reason')[64]", name, reason)) return SendClientMessage(playerid, 0xCC0000AA, "USAGE: /offlineban <playername> <OPTIONAL:reason>");
new file[32];
format(file, sizeof(file), "WHEREMYFILES/ARE/%s.ini", Name(playerid));
if(dini_Exists(file)) //We check if the file exists so we can modify it
{
if(dini_Int(file, "Banned") == 0)
{
dini_IntSet(file, "Banned", 1);
new str[128];
format(str,sizeof(str), "%s(%d) has offline banned %s for %s.", Name(playerid), playerid, name, reason);
SendClientMessageToAll(0x00CCCCAA, str);
dini_Set(file, "BanReason", reason);
}
else return SendClientMessage(playerid, 0xCC0000AA, "This player is already banned!");
}
else return SendClientMessage(playerid, 0xCC0000AA, "This player isn't registered!"); //If their file doesn't exist, send an error message
}
}
CMD:oban(playerid, params[]) return cmd_offlineban(playerid, params);
You'll need this to use the above code.
pawn Код:
stock Name(playerid)
{
new daname[MAX_PLAYER_NAME];
GetPlayerName(playerid, daname, sizeof(daname));
return daname;
}
Then you'd do something like this...
pawn Код:
public OnPlayerConnect(playerid)
{
new file[32];
format(file, sizeof(file), "WHEREMYFILES/ARE/%s.ini", Name(playerid));
if(dini_Exists(file))
{
if(dini_Int(file, "Banned") == 1)
{
new str[128];
format(str,sizeof(str), "You were banned while you were offline for %s.", dini_Get(file, "BanReason"));
SendClientMessage(playerid, 0xCC0000AA, str);
format(str,sizeof(str), "%s - offline banned for %s", Name(playerid), dini_Get(file, "BanReason"))
BanEx(playerid, str);
}
}
}