27.07.2016, 22:51
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.
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.
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; }