#include #include #define red 0xFF0000AA #define yellow 0xFFFF00AA #define JAIL_MUSIC_ON 1068 #define JAIL_MUSIC_OFF 1069 #define COLOR_RED 0xAA3333AA #define COLOR_WHITE 0xFFFFFFAA #define COLOR_YELLOW 0xFFFF00AA #define COLOR_GREEN 0x33AA33AA new iAlreadyJailed[MAX_PLAYERS]; static gInJail[MAX_PLAYERS]; public OnPlayerSpawn(playerid) { if(gInJail[playerid] == 1){ SetPlayerInterior(playerid,0); SetPlayerPos(playerid,197.7029,174.8801,1003.0234); } } #pragma tabsize 0 new Menu:Menu; new Menu:Lay; new Menu:Sit; new Menu:Bath; new Menu:Shower; new Menu:Creds; public OnFilterScriptInit() { print("\n--------------------------------------"); print(" /jail By: splitx "); print("--------------------------------------\n"); //objects CreateObject(8947, 1079.155762, -2461.758057, 922.865784, 0.0000, 179.6224, 0.0000); CreateObject(1838, 1085.428345, -2450.930420, 920.311829, 0.0000, 0.0000, 326.2500); CreateObject(1860, 1085.473633, -2450.851807, 921.473206, 0.0000, 0.0000, 0.0000); CreateObject(1700, 1073.953125, -2453.402832, 920.234253, 0.0000, 0.0000, 0.0000); CreateObject(1701, 1076.362915, -2453.438721, 920.248291, 0.0000, 0.0000, 0.0000); CreateObject(1738, 1085.750977, -2456.805420, 920.970764, 0.0000, 0.0000, 270.0000); CreateObject(1778, 1085.336060, -2454.842041, 920.311584, 0.0000, 0.0000, 112.5000); CreateObject(1793, 1079.443481, -2453.502686, 920.267700, 0.0000, 0.0000, 0.0000); CreateObject(1808, 1085.289551, -2471.275146, 920.307983, 0.0000, 0.0000, 202.5000); CreateObject(1809, 1072.547485, -2459.755127, 920.229065, 0.0000, 0.0000, 90.0000); CreateObject(1829, 1082.412476, -2450.662598, 920.758728, 0.0000, 0.0000, 0.0000); CreateObject(1839, 1072.571411, -2461.145996, 920.228638, 0.0000, 0.0000, 180.0000); CreateObject(1840, 1072.450684, -2459.197021, 920.226318, 0.0000, 0.0000, 180.0000); CreateObject(1840, 1072.503418, -2460.193848, 920.226685, 0.0000, 0.0000, 180.0000); CreateObject(2028, 1073.437500, -2472.369873, 920.326111, 0.0000, 0.0000, 157.5000); CreateObject(2097, 1084.182495, -2463.395508, 920.606140, 0.0000, 0.0000, 112.5000); CreateObject(2099, 1073.478271, -2472.568604, 920.233704, 0.0000, 0.0000, 157.5000); CreateObject(2103, 1075.780273, -2471.761719, 921.044312, 0.0000, 0.0000, 168.7500); CreateObject(2130, 1072.779053, -2467.312744, 920.130310, 0.0000, 0.0000, 90.0000); CreateObject(2131, 1072.771851, -2469.399414, 920.229614, 0.0000, 0.0000, 90.0000); CreateObject(2135, 1072.796875, -2465.342773, 920.229797, 0.0000, 0.0000, 90.0000); CreateObject(2149, 1072.554199, -2467.558350, 921.431580, 0.0000, 0.0000, 90.0000); CreateObject(2186, 1085.415283, -2468.841309, 920.306885, 0.0000, 0.0000, 258.7500); CreateObject(2226, 1085.357300, -2469.352295, 921.574463, 0.0000, 0.0000, 236.2501); CreateObject(2312, 1086.244507, -2458.977783, 921.894653, 0.0000, 0.0000, 270.0000); CreateObject(2514, 1085.603027, -2466.179199, 920.314392, 0.0000, 0.0000, 270.0000); CreateObject(2517, 1086.131592, -2465.039795, 920.346130, 0.0000, 0.0000, 90.0000); CreateObject(2526, 1084.712891, -2461.628174, 920.310181, 0.0000, 0.0000, 303.7500); CreateObject(2813, 1083.869751, -2460.565918, 920.303894, 0.0000, 0.0000, 0.0000); CreateObject(2813, 1083.455444, -2460.675293, 920.301147, 0.0000, 0.0000, 303.7500); CreateObject(2813, 1083.727783, -2459.367432, 920.302979, 0.0000, 0.0000, 303.7500); CreateObject(2813, 1083.968872, -2458.065674, 920.304565, 0.0000, 0.0000, 303.7500); CreateObject(2813, 1083.155029, -2458.043945, 920.299194, 0.0000, 0.0000, 303.7500); CreateObject(2813, 1082.910400, -2459.077881, 920.297607, 0.0000, 0.0000, 303.7500); CreateObject(2813, 1083.125122, -2459.281250, 920.299011, 0.0000, 0.0000, 281.2500); CreateObject(2815, 1080.226440, -2461.539063, 920.279358, 0.0000, 0.0000, 90.0000); CreateObject(2816, 1083.357056, -2459.941406, 920.300415, 0.0000, 0.0000, 0.0000); CreateObject(2816, 1083.774658, -2458.616211, 920.303162, 0.0000, 0.0000, 326.2500); CreateObject(2816, 1083.303833, -2459.271973, 920.300049, 0.0000, 0.0000, 236.2501); CreateObject(2820, 1085.731567, -2459.957764, 920.315735, 0.0000, 0.0000, 90.0000); CreateObject(2822, 1072.777344, -2468.250000, 922.700012, 0.0000, 0.0000, 0.0000); CreateObject(2824, 1084.281006, -2459.960693, 920.306030, 0.0000, 0.0000, 0.0000); CreateObject(2824, 1084.019531, -2459.385498, 920.304321, 0.0000, 0.0000, 0.0000); CreateObject(2826, 1083.412476, -2459.574463, 920.300842, 0.0000, 0.0000, 0.0000); CreateObject(2826, 1083.296265, -2458.723633, 920.300049, 0.0000, 0.0000, 0.0000); CreateObject(2827, 1083.596313, -2460.422852, 920.315857, 0.0000, 0.0000, 0.0000); CreateObject(2827, 1083.430420, -2458.351318, 920.314758, 0.0000, 0.0000, 0.0000); CreateObject(2827, 1083.978638, -2458.659912, 920.318359, 0.0000, 0.0000, 0.0000); CreateObject(2828, 1082.413818, -2450.324951, 921.239197, 0.0000, 0.0000, 135.0000); CreateObject(2829, 1072.842285, -2467.062744, 921.280334, 0.0000, 0.0000, 292.5000); CreateObject(2830, 1073.014526, -2465.473633, 921.804810, 0.0000, 0.0000, 0.0000); CreateObject(2833, 1078.114624, -2464.754639, 920.265442, 0.0000, 0.0000, 22.5000); CreateObject(2834, 1075.945801, -2461.702148, 920.251160, 0.0000, 0.0000, 348.7500); CreateObject(2835, 1077.889282, -2450.531250, 920.263123, 0.0000, 0.0000, 270.0000); CreateObject(2836, 1076.057617, -2451.613770, 920.248901, 0.0000, 0.0000, 90.0000); CreateObject(2841, 1073.513672, -2451.657959, 920.233215, 0.0000, 0.0000, 90.0000); CreateObject(2852, 1083.903809, -2458.989502, 920.304138, 0.0000, 0.0000, 0.0000); CreateObject(2853, 1084.268188, -2459.437256, 920.306458, 0.0000, 0.0000, 0.0000); CreateObject(2854, 1084.433228, -2458.581299, 920.307617, 0.0000, 0.0000, 0.0000); CreateObject(2855, 1084.253540, -2458.370605, 920.404480, 0.0000, 0.0000, 0.0000); CreateObject(2863, 1072.802368, -2469.021973, 922.722290, 0.0000, 0.0000, 123.7500); CreateObject(14494, 1083.511108, -2472.091553, 921.880371, 0.0000, 0.0000, 67.5000); CreateObject(14527, 1080.715820, -2465.235107, 928.866760, 0.0000, 0.0000, 0.0000); CreateObject(14532, 1074.511841, -2454.676025, 921.225159, 0.0000, 0.0000, 0.0000); CreateObject(14604, 1076.891113, -2454.165039, 921.238770, 0.0000, 0.0000, 0.0000); CreateObject(14806, 1079.988525, -2454.372803, 921.364502, 0.0000, 0.0000, 180.0000); CreateObject(1755, 1083.161865, -2459.835449, 920.293213, 0.0000, 0.0000, 90.0000); CreateObject(1758, 1083.118286, -2458.532227, 920.294800, 0.0000, 0.0000, 90.0000); CreateObject(1769, 1074.114868, -2460.203369, 920.240784, 0.0000, 0.0000, 270.0000); CreateObject(1819, 1078.079956, -2466.945068, 920.265747, 0.0000, 0.0000, 0.0000); CreateObject(1663, 1077.720825, -2466.985352, 920.723816, 0.0000, 0.0000, 135.0000); CreateObject(1663, 1077.764282, -2465.778076, 920.724060, 0.0000, 0.0000, 45.0000); CreateObject(1663, 1079.166382, -2465.780762, 920.733337, 0.0000, 0.0000, 303.7500); CreateObject(1663, 1078.903809, -2467.407959, 920.731567, 0.0000, 0.0000, 202.5000); CreateObject(2356, 1083.757568, -2469.211914, 920.297974, 0.0000, 0.0000, 292.5000); CreateObject(2605, 1076.099976, -2471.777344, 920.658081, 0.0000, 0.0000, 146.2500); CreateObject(2636, 1076.357788, -2471.499268, 920.898132, 0.0000, 0.0000, 56.2500); CreateObject(8948, 1079.204590, -2473.260986, 924.141235, 0.0000, 0.0000, 90.0000); CreateObject(8948, 1079.173462, -2473.302002, 927.693787, 0.0000, 0.0000, 90.0000); //menu Menu = CreateMenu("Action Menu!",1,20,120,150,40); AddMenuItem(Menu,0,"Lay Actions"); AddMenuItem(Menu,0,"Sit Actions"); AddMenuItem(Menu,0,"Bath Actions"); AddMenuItem(Menu,0,"Shower Actions"); AddMenuItem(Menu,0,"Credits"); Lay = CreateMenu("Lay!",1,20,120,150,40); AddMenuItem(Lay,0,"Lay1"); AddMenuItem(Lay,0,"Lay2"); AddMenuItem(Lay,0,"Lay3"); AddMenuItem(Lay,0,"Back!"); Sit = CreateMenu("Sit!",1,20,120,150,40); AddMenuItem(Sit,0,"Sit1"); AddMenuItem(Sit,0,"Sit2"); AddMenuItem(Sit,0,"Sit3"); AddMenuItem(Sit,0,"Back!"); Bath = CreateMenu("Bath!",1,20,120,150,40); AddMenuItem(Bath,0,"Bath1"); AddMenuItem(Bath,0,"Bath2"); AddMenuItem(Bath,0,"Back!"); Shower = CreateMenu("Shower!",1,20,120,150,40); AddMenuItem(Shower,0,"Shower"); AddMenuItem(Shower,0,"Back!"); Creds = CreateMenu("Credits!",1,20,120,150,40); AddMenuItem(Creds,0,"Made By: Me"); AddMenuItem(Creds,0,"Back!"); return 1; } public OnPlayerCommandText(playerid,cmdtext[]) { new ggiveplayer[MAX_PLAYER_NAME]; new ssendername[MAX_PLAYER_NAME]; new cmd[256]; new string[256]; new ggiveplayerid,idx; cmd = strtok(cmdtext, idx); if(strcmp(cmd, "/jail", true) == 0) { if(IsPlayerAdmin(playerid) == 1) { new dir[256]; dir = strtok(cmdtext, idx); if(!strlen(dir)) { SendClientMessage(playerid, COLOR_WHITE, " Do: : /jail [ID]"); } ggiveplayerid = strval(dir); dir = strtok(cmdtext, idx); if (IsPlayerConnected(ggiveplayerid)) { GetPlayerName(ggiveplayerid, ggiveplayer, sizeof(ggiveplayer)); GetPlayerName(playerid, ssendername, sizeof(ssendername)); ResetPlayerMoney(ggiveplayerid); SetPlayerInterior(ggiveplayerid,3); iAlreadyJailed[ggiveplayerid] = 1; gInJail[ggiveplayerid] = 1; SetPlayerPos(ggiveplayerid,1080.051392, -2472.600830, 921.988281); PlayerPlaySound(ggiveplayerid, JAIL_MUSIC_ON, 1080.051392, -2472.600830, 921.988281); SendClientMessage(ggiveplayerid, COLOR_RED, "You have been jailed"); SetPlayerCheckpoint(playerid, 1074.0284,-2457.9541,921.2393 ,10); } else { format(string, sizeof(string), " %d Not active", ggiveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } } else { SendClientMessage(playerid, COLOR_RED, " Hmmm...."); } return 1; } else if(strcmp(cmd, "/unjail", true) == 0) { if(IsPlayerAdmin(playerid) == 1) { new dir1[256]; dir1 = strtok(cmdtext, idx); if(!strlen(dir1)) { SendClientMessage(playerid, COLOR_WHITE, " Do: : /unjail [ID]"); } ggiveplayerid = strval(dir1); dir1 = strtok(cmdtext, idx); if (IsPlayerConnected(ggiveplayerid)) { GetPlayerName(ggiveplayerid, ggiveplayer, sizeof(ggiveplayer)); GetPlayerName(playerid, ssendername, sizeof(ssendername)); GivePlayerMoney(playerid, 5000); SetPlayerInterior(ggiveplayerid,0); gInJail[ggiveplayerid] = 0; iAlreadyJailed[ggiveplayerid] = 0; SetPlayerPos(ggiveplayerid,2297.1064,2452.0115,10.8203); PlayerPlaySound(ggiveplayerid, JAIL_MUSIC_OFF, 0.0, 0.0, 0.0); SendClientMessage(playerid, COLOR_GREEN, " ?You Are UN jailed"); DisablePlayerCheckpoint(playerid); } else { format(string, sizeof(string), " %d Not Active ", ggiveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } } else { SendClientMessage(playerid, COLOR_RED, " Hmmm.... "); } return 1; } return 0; } strtok(const string[], &index) { new length = strlen(string); while ((index < length) && (string[index] <= ' ')) { index++; } new offset = index; new result[20]; while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return result; } public OnFilterScriptExit() { DestroyMenu(Menu:Menu); DestroyMenu(Menu:Lay); DestroyMenu(Menu:Sit); DestroyMenu(Menu:Bath); DestroyMenu(Menu:Shower); DestroyMenu(Menu:Creds); return 1; } public OnPlayerEnterCheckpoint(playerid) { ShowMenuForPlayer(Menu, playerid); } public OnPlayerSelectedMenuRow(playerid, row) { new Menu:Current = GetPlayerMenu(playerid); if(Current == Menu) { switch(row){ case 0: if(IsPlayerConnected(playerid)) { ShowMenuForPlayer(Lay, playerid); } case 1: if(IsPlayerConnected(playerid)) { ShowMenuForPlayer(Sit, playerid); } case 2: if(IsPlayerConnected(playerid)) { ShowMenuForPlayer(Bath, playerid); } case 3: if(IsPlayerConnected(playerid)) { ShowMenuForPlayer(Shower, playerid); } case 4: if(IsPlayerConnected(playerid)) { ShowMenuForPlayer(Creds, playerid); } } } if(Current == Lay) { switch(row){ case 0: if(GetPlayerMoney(playerid) >= 0) { SetPlayerPos(playerid, 1080.051392, -2472.600830, 921.988281); ApplyAnimation(playerid,"BEACH","bather",4.1,0,1,1,1,1); } case 1: if(GetPlayerMoney(playerid) >= 0) { SetPlayerPos(playerid, 1074.457886, -2451.312012, 921.088928); ApplyAnimation(playerid,"BEACH","bather",4.1,0,1,1,1,1); } case 2: if(GetPlayerMoney(playerid) >= 0) { SetPlayerPos(playerid, 1076.887817, -2451.333740, 921.203430); ApplyAnimation(playerid,"BEACH","bather",4.1,0,1,1,1,1); } case 2: { ShowMenuForPlayer(Menu, playerid); } } } if(Current == Sit) { switch(row){ case 0: if(GetPlayerMoney(playerid) >= 0) { SetPlayerPos(playerid, 1079.859619, -2451.599365, 921.103149); ApplyAnimation(playerid,"CAR","Sit_relaxed",4.1,1,1,1,1,1); } case 1: if(GetPlayerMoney(playerid) >= 0) { SetPlayerPos(playerid, 1083.262329, -2458.024658, 921.007324); ApplyAnimation(playerid,"CAR","Sit_relaxed",4.1,1,1,1,1,1); } case 2: if(GetPlayerMoney(playerid) >= 0) { SetPlayerPos(playerid, 1083.243530, -2459.244629, 920.929199); ApplyAnimation(playerid,"CAR","Sit_relaxed",4.1,1,1,1,1,1); } case 3:ShowMenuForPlayer(Menu, playerid); } } if(Current == Bath) { switch(row){ case 0: if(GetPlayerMoney(playerid) >= 0) { SetPlayerPos(playerid, 1084.953125, -2462.025391, 920.580017); ApplyAnimation(playerid,"BEACH","bather",4.1,0,1,1,1,1); } case 1: if(GetPlayerMoney(playerid) >= 0) { SetPlayerPos(playerid, 1083.965332, -2462.903320, 920.589905); ApplyAnimation(playerid,"BEACH","bather",4.1,0,1,1,1,1); } case 2:ShowMenuForPlayer(Menu, playerid); } } if(Current == Shower) { switch(row){ case 0: if(GetPlayerMoney(playerid) >= 0) { SetPlayerPos(playerid, 1085.213501, -2464.963867, 920.612854); } case 1:ShowMenuForPlayer(Menu, playerid); } } if(Current == Creds) { switch(row){ case 0: if(GetPlayerMoney(playerid) >= 0) { SendClientMessage(playerid,yellow,"Credits To splitx who made this FS"); } case 1:ShowMenuForPlayer(Menu, playerid); } } } public OnPlayerExitedMenu(playerid) { TogglePlayerControllable(playerid, true); }