#include <a_samp>#include <sscanf2>#include <zcmd>#include <IsPlayerLAdmin>#include <fixchars>#undef MAX_PLAYERS#define MAX_PLAYERS 27#define COLOR_ULTRARED 0xFF0606FF#define COLOR_YELLOW 0xFFFF00AA#define COLOR_ORANGE 0xFF9900AA#define COLOR_blue 0x375FFFFF#define hiba 0xFF0606FFnew bool:bezarva[MAX_PLAYERS];new Text:JailTextDraw[MAX_PLAYERS];new bortontimer[MAX_PLAYERS];new textdrawtimer[MAX_PLAYERS];CMD:bezar(playerid, params[]){ new rabID, rabNAME[24], time, indok[128], msg[128], Float:rabpos[3]; if(IsPlayerLAdmin(playerid) == 0) return SendClientMessage(playerid, hiba, \"HIBA: Nem vagy rendõr!\"); if(sscanf(params, \"uis[128]\", rabID, time, indok)) return SendClientMessage(playerid, COLOR_YELLOW, \"Használat: /bezár [id] [perc] [indok]\"); if(rabID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_ULTRARED, \"HIBA: Rossz ID!\"); if(bezarva[rabID] == true) { SendClientMessage(playerid, hiba, \"A játékos már be van zárva!\"); return 1; } GetPlayerName(rabID, rabNAME, 24); GetPlayerPos(rabID, rabpos[0], rabpos[1], rabpos[2]); SetPlayerPos(rabID, 2857.3625,1736.4978,10.8203); bortontimer[rabID] = SetTimerEx(\"jailtime\", time*60000, false, \"i\", rabID); format(msg, sizeof(msg), \"%s megkezdte %d perces börtönbüntetését. {FFFF00}[indok: %s.]\", rabNAME, time, indok); SendClientMessageToAll(COLOR_blue, msg); bezarva[rabID] = true; SetPVarInt(playerid, \"lecsukva\", 1); Visszaszamlalo(rabID, JailTextDraw[rabID], time*60); JailTextDraw[rabID] = TextDrawCreate(327.000000, 377.000000, \"X\"); TextDrawAlignment(JailTextDraw[rabID], 2); TextDrawBackgroundColor(JailTextDraw[rabID], 255); TextDrawFont(JailTextDraw[rabID], 2); TextDrawLetterSize(JailTextDraw[rabID], 0.620000, 3.200000); TextDrawColor(JailTextDraw[rabID], -1); TextDrawSetOutline(JailTextDraw[rabID], 0); TextDrawSetProportional(JailTextDraw[rabID], 1); TextDrawSetShadow(JailTextDraw[rabID], 1); return 1;}forward jailtime(playerid); //börtön idõ-számlálópublic jailtime(playerid){ SetPlayerPos(playerid, 2843.7068,1938.8298,10.8203); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); SendClientMessage(playerid, COLOR_ORANGE, \"{99FF00}Letöltötted a büntetésed.\"); bezarva[playerid] = false; TextDrawDestroy(JailTextDraw[playerid]); SetPVarInt(playerid, \"lecsukva\", 0); return 1;}forward Visszaszamlalo(playerid, Text:textid[], masodperc); //textdraw visszaszámlálópublic Visszaszamlalo(playerid, Text:textid[], masodperc){ if(masodperc == 0) { TextDrawHideForPlayer(playerid, textid[playerid]); } else { new timestring[32]; format(timestring, sizeof(timestring), \"%i mp a szabadulásig...\", masodperc); TextDrawSetString(textid[playerid], timestring); TextDrawShowForPlayer(playerid, textid[playerid]); masodperc--; textdrawtimer[playerid] = SetTimerEx(\"Visszaszamlalo\", 1000, false, \"ddd\", playerid, textid[playerid], masodperc); } return 1;}
#include <a_samp>#include <sscanf2>#include <zcmd>#include <IsPlayerLAdmin>#include <fixchars>#undef MAX_PLAYERS #define MAX_PLAYERS 27#define COLOR_ULTRARED 0xFF0606FF#define COLOR_YELLOW 0xFFFF00AA#define COLOR_ORANGE 0xFF9900AA#define COLOR_blue 0x375FFFFF#define hiba 0xFF0606FFnew bool:bezarva[MAX_PLAYERS];new Text:JailTextDraw[MAX_PLAYERS];new bortontimer[MAX_PLAYERS];new textdrawtimer[MAX_PLAYERS];CMD:bezar(playerid, params[]){ new rabID, rabNAME[24], time, indok[128], msg[128], Float:rabpos[3]; if(IsPlayerLAdmin(playerid) == 0) return SendClientMessage(playerid, hiba, \"HIBA: Nem vagy rendõr!\"); if(sscanf(params, \"uis[128]\", rabID, time, indok)) return SendClientMessage(playerid, COLOR_YELLOW, \"Használat: /bezár [id] [perc] [indok]\"); if(rabID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_ULTRARED, \"HIBA: Rossz ID!\"); if(bezarva[rabID] == true) { SendClientMessage(playerid, hiba, \"A játékos már be van zárva!\"); return 1; } GetPlayerName(rabID, rabNAME, 24); GetPlayerPos(rabID, rabpos[0], rabpos[1], rabpos[2]); SetPlayerPos(rabID, 2857.3625,1736.4978,10.8203); bortontimer[rabID] = SetTimerEx(\"jailtime\", time*60000, false, \"i\", rabID); format(msg, sizeof(msg), \"%s megkezdte %d perces börtönbüntetését. {FFFF00}[indok: %s.]\", rabNAME, time, indok); SendClientMessageToAll(COLOR_blue, msg); bezarva[rabID] = true; SetPVarInt(playerid, \"lecsukva\", 1); JailTextDraw[rabID] = TextDrawCreate(327.000000, 377.000000, \"X\"); TextDrawAlignment(JailTextDraw[rabID], 2); TextDrawBackgroundColor(JailTextDraw[rabID], 255); TextDrawFont(JailTextDraw[rabID], 2); TextDrawLetterSize(JailTextDraw[rabID], 0.620000, 3.200000); TextDrawColor(JailTextDraw[rabID], -1); TextDrawSetOutline(JailTextDraw[rabID], 0); TextDrawSetProportional(JailTextDraw[rabID], 1); TextDrawSetShadow(JailTextDraw[rabID], 1); Visszaszamlalo(rabID, JailTextDraw[rabID], time*60); return 1;}forward jailtime(playerid); //börtön idõ-számlálópublic jailtime(playerid){ SetPlayerPos(playerid, 2843.7068,1938.8298,10.8203); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); SendClientMessage(playerid, COLOR_ORANGE, \"{99FF00}Letöltötted a büntetésed.\"); bezarva[playerid] = false; TextDrawDestroy(JailTextDraw[playerid]); SetPVarInt(playerid, \"lecsukva\", 0); return 1;}forward Visszaszamlalo(playerid, Text:textid[], masodperc); //textdraw visszaszámlálópublic Visszaszamlalo(playerid, Text:textid[], masodperc){ if(masodperc == 0) { TextDrawHideForPlayer(playerid, textid[playerid]); } else { new timestring[32]; format(timestring, sizeof(timestring), \"%i mp a szabadulásig...\", masodperc); TextDrawSetString(textid[playerid], timestring); TextDrawShowForPlayer(playerid, textid[playerid]); masodperc--; textdrawtimer[playerid] = SetTimerEx(\"Visszaszamlalo\", 1000, false, \"ddd\", playerid, textid[playerid], masodperc); } return 1;}