Jail Command - Saving + shown
#1

Greetings,
i'm trying to create a /jail command with the prefix /jail playername secconds reason,
The player should be jailed in a random cell (3 existing), His weapons should be reset, and his health should be unlimited to prevent him being killed, also if a player leaves the server, the remaining secconds he should spend in the jail cell should be saved in the database, i already created the database column.

Code:
CMD:jail(playerid, params[])
{
	new id, aname[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], Reason[120], secconds[120], string[128];
	if(pData[playerid][Admin] < 1) return SendClientMessage(playerid, COLOR_WHITE, "[Error]: You are not authorized to use this command.");
	if(sscanf(params,"uds[128]",id, Reason)) return SendClientMessage(playerid,-1,"[Admin]: /jail [ID | Name] [secconds] [Reason]");
	if(pData[playerid][Admin] < pData[id][Admin]) return SendClientMessage(playerid, COLOR_WHITE, "[Error]:You are not authorized to use this command on a higher level administrator.");
	if(id == playerid) return SendClientMessage(playerid, COLOR_WHITE,"[Error]:You can not perform this command on yourself.");
    else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"[Error]:This player is not connected.");
	return 1;
}
So basically when a player gets jailed i would like to display the time left in jail at the top of the screen in the center, i have no idea on how to do this, so i would really really appreciate it if someone could help me with this.
Reply


Messages In This Thread
Jail Command - Saving + shown - by yvoms - 27.07.2016, 22:51
Re: Jail Command - Saving + shown - by Shinja - 27.07.2016, 23:21
Re: Jail Command - Saving + shown - by yvoms - 27.07.2016, 23:34
Re: Jail Command - Saving + shown - by AndySedeyn - 27.07.2016, 23:34
Re: Jail Command - Saving + shown - by yvoms - 28.07.2016, 08:07
Re: Jail Command - Saving + shown - by AndySedeyn - 28.07.2016, 09:06
Re: Jail Command - Saving + shown - by yvoms - 28.07.2016, 09:11
Re: Jail Command - Saving + shown - by AndySedeyn - 28.07.2016, 09:15
Re: Jail Command - Saving + shown - by yvoms - 28.07.2016, 09:30

Forum Jump:


Users browsing this thread: 1 Guest(s)