SA-MP Forums Archive
Can anyone give me the code of this command ! +Rep - 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: Can anyone give me the code of this command ! +Rep (/showthread.php?tid=293139)



Can anyone give me the code of this command ! +Rep - SampEver1 - 27.10.2011

Can anyone tell me the code of this command
/Jail ID Time



Re: Can anyone give me the code of this command ! +Rep - Ash. - 27.10.2011

This is dependant on where you want the jail to be. My entire jail system stands at 150 lines, and that is without the #include lines and the commands itself (as it's merely an additional include to my gamemode).

You should request what you want in the "Script Request Thread".


Re: Can anyone give me the code of this command ! +Rep - Salsa - 27.10.2011

Try THis

Quote:

dcmd_jail(playerid,params[])
{
if(AccInfo[playerid][LoggedIn] == 1)
{
if(AccInfo[playerid][Level] >= 3)
{
new Index;
new tmp[256]; tmp = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);
new tmp3[256]; tmp3 = strtok(params,Index);

if(!strlen(params)) return
SendClientMessage(playerid, LIGHTBLUE2, "Usage: /jail [PlayerID] [Minutes] [Reason]") &&
SendClientMessage(playerid, orange, "Function: Will Jailed the specified player");
new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
player1 = strval(tmp);

if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]))
{
if(AccInfo[player1][Jailed] == 0)
{
GetPlayerName(player1, playername, sizeof(playername));
GetPlayerName(playerid, adminname, sizeof(adminname));
new jtime = strval(tmp2);
if(jtime == 0) jtime = 9999;

SendCommandToAdmins(playerid,"Jail");
AccInfo[player1][JailTime] = jtime*1000*60;
SetTimerEx("JailPlayer",5000,0,"d",player1);
SetTimerEx("Jail1",1000,0,"d",player1);
AccInfo[player1][Jailed] = 1;

if(jtime == 9999)
{
if(!strlen(params[strlen(tmp2)+1])) format(string,sizeof(string),"|- Administrator %s has Jailed %s -|",adminname,playername);
else format(string,sizeof(string),"|- Administrator %s has Jailed %s | Reason: %s -|",adminname,playername,params[strlen(tmp)+1]);
}
else
{
if(!strlen(tmp3)) format(string,sizeof(string),"|- Administrator %s has Jailed %s for %d Minutes -|",adminname,playername, jtime);
else format(string,sizeof(string),"|- Administrator %s has Jailed %s for %d Minutes | Reason: %s -|",adminname,playername,jtime,params[strlen(tmp2)+strlen(tmp)+1]);
}
return SendClientMessageToAll(blue,string);
}
else return SendClientMessage(playerid, red, "ERROR: Player is already in jail");
}
else return SendClientMessage(playerid, red, "ERROR: Player is not connected or is the highest level admin");
}
else return ErrorMessages(playerid, 1);
}
else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}




Re: Can anyone give me the code of this command ! +Rep - Ash. - 27.10.2011

Quote:
Originally Posted by Salsa
Посмотреть сообщение
Try THis
I highly doubt that will work. Their variable are most likely to be very different to those used in your command.