28.11.2015, 22:51
Estou desenvolvendo um GameMode DM e desenvolver um GM й muuito mais fбcil do que desenvolver um sistema Admin [FS], jб que o GM tem mais foco nos comandos/sistemas mais simples...
Este sistema de prisгo й do FS do Gammix, eu apenas alterei algumas coisas:
Eu havia feito um sistema neste mesmo FS. Sistema de contagem de kicks! realmente bom e ъtil e nгo um sistema tosco e ocupador de linhas....
Minha ideia foi fazer a contagem de quantas vezes o player foi preso, tipo como isso:
FAZ A CONTAGEM
SETA A COLUNA 'u_jailedcount' DA TABLE DO PLAYER ESPECIFICADO
Este sistema de prisгo й do FS do Gammix, eu apenas alterei algumas coisas:
PHP код:
CMD:jail(playerid, params[])
{
//check if the player is a admin
//LevelCheck(playerid, 2);
new target, time, reason[128];
if(sscanf(params, "uI(60)S(No reason specified)[128]", target, time, reason)) return SendClientMessage(playerid, COLOR_THISTLE, "USAGE: /jail [player] [*seconds] [*reason]");
if(! IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: The specified player is not conected.");
if(GetPlayerGAdminLevel(playerid) < GetPlayerGAdminLevel(target)) return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You cannot use this command on higher level admin.");
if(time > 5*60 || time < 10) return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: The jail time must be b/w 10 - 360(5 minutes) seconds.");
//if(target == playerid) return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You cannot jail yourself.");
if(gUser[target][u_jailed] == 1) return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: Player is already in jail.");
gUser[target][u_jailed] = 1;
gUser[target][u_jailtime] = time;
JailPlayer(target);
PlayerPlaySound(target, 1057, 0.0, 0.0, 0.0);
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
new string[144];
format(string, sizeof(string), "* %s[%i] has been jailed by admin %s[%i] for %i seconds [Reason: %s]", ReturnPlayerName(target), target, ReturnPlayerName(playerid), playerid, time, reason);
SendClientMessageToAll(COLOR_DODGER_BLUE, string);
format(string, sizeof(string), "~b~~h~~h~~h~Jailed for %i secs", time);
GameTextForPlayer(target, string, 5000, 3);
new key = DB::RetrieveKey(gGlobal[s_usertable], "username", ReturnPlayerName(playerid));
DB::SetIntEntry(gGlobal[s_usertable], key, "jailed", gUser[target][u_jailed]);
DB::SetIntEntry(gGlobal[s_usertable], key, "jailtime", gUser[target][u_jailtime]);
key = DB::RetrieveKey(gGlobal[s_statscount], "username", ReturnPlayerName(playerid));
DB::SetIntEntry(gGlobal[s_statscount], key, "jailcount+", gUser[target][u_jailcount]);
SaveStatsCount(playerid);
return 1;
}
Minha ideia foi fazer a contagem de quantas vezes o player foi preso, tipo como isso:
PHP код:
CMD:jail(playerid, params[])
{
//check if the player is a admin
//LevelCheck(playerid, 2);
new target, time, reason[128];
if(sscanf(params, "uI(60)S(No reason specified)[128]", target, time, reason)) return SendClientMessage(playerid, COLOR_THISTLE, "USAGE: /jail [player] [*seconds] [*reason]");
if(! IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: The specified player is not conected.");
if(GetPlayerGAdminLevel(playerid) < GetPlayerGAdminLevel(target)) return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You cannot use this command on higher level admin.");
if(time > 5*60 || time < 10) return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: The jail time must be b/w 10 - 360(5 minutes) seconds.");
//if(target == playerid) return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You cannot jail yourself.");
if(gUser[target][u_jailed] == 1) return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: Player is already in jail.");
gUser[target][u_jailed] = 1;
gUser[target][u_jailed]++; // FAZ A CONTAGEM
gUser[target][u_jailtime] = time;
JailPlayer(target);
PlayerPlaySound(target, 1057, 0.0, 0.0, 0.0);
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
new string[144];
format(string, sizeof(string), "* %s[%i] has been jailed by admin %s[%i] for %i seconds [Reason: %s]", ReturnPlayerName(target), target, ReturnPlayerName(playerid), playerid, time, reason);
SendClientMessageToAll(COLOR_DODGER_BLUE, string);
format(string, sizeof(string), "~b~~h~~h~~h~Jailed for %i secs", time);
GameTextForPlayer(target, string, 5000, 3);
new key = DB::RetrieveKey(gGlobal[s_usertable], "username", ReturnPlayerName(playerid));
DB::SetIntEntry(gGlobal[s_usertable], key, "jailed", gUser[target][u_jailed]);
DB::SetIntEntry(gGlobal[s_usertable], key, "jailed", gUser[target][u_jailedcount]);
DB::SetIntEntry(gGlobal[s_usertable], key, "jailtime", gUser[target][u_jailtime]);
return 1;
}
Quote:
gUser[target][u_jailed]++; |
Quote:
DB::SetIntEntry(gGlobal[s_usertable], key, "jailed", gUser[target][u_jailedcount]); |