Member
Join Date: Jan 2022
Location: Palestine
|
02-01-2022
, 12:27
Re: Requst Edite SMA
|
#3
|
Quote:
Originally Posted by CrazY.
To be honest this is quite boring to do and will take some time as well, not sure if you'll find someone with the will to help. It's actually quite simple tough, all you've to do is find all words that contain nemesis, then copy and replace it with imposter. Same for sniper, but you would copy and replace survivor instead. This will be a lot "easier" if you're using a nice and spicy text editor, as sublime text, where you can replace and keep the case sensitivity of the word you're replacing.
As for the Sniper vs Imposter, you could copy and replace plague mode, but will need a few tweaks
You still have the option to wait for someone, it's your decision.
|
i understand you sir , and u completly right , but i have idea may it help you , why not make it as outside plugin , like [imposter.sma] and i have amxx of a that plugin so i can decompile it just to see how the system of the sma codes and how u will make the sma , and about how to active the mod on the game , u can add a command which open menu to choose the players , like "/imp" on chat or "amx_imp" on console [ command for admin immunity access only] , and then will open menu tp choose the player which i want make him .
here the decompile code [ imposter.amxx ]
PHP Code:
#pragma semicolon 1 #pragma ctrlchar '\'
new __dhud_color; new __dhud_x; new __dhud_y; new __dhud_effect; new __dhud_fxtime; new __dhud_holdtime; new __dhud_fadeintime; new __dhud_fadeouttime; new __dhud_reliable; new Float:impostor_ambiance_repeat = 126.000/*1123811328*/; new Float:s_vs_impostors_ambiance_repeat = 112.000/*1121976320*/; new impostor_start_sound[34] = { 114, 111, 122, 95, 101, 115, 99, 97, 112, 101, 47, 114, 111, 122, 95, 115, 116, 97, 114, 116, 95, 105, 109, 112, 111, 115, 116, 101, 114, 46, 119, 97, 118, 0 } new impostor_ambiance_sound[27] = { 114, 111, 122, 95, 101, 115, 99, 97, 112, 101, 47, 114, 111, 122, 95, 97, 109, 111, 110, 103, 117, 115, 46, 109, 112, 51, 0 } new s_vs_impostors_start_sound[45] = { 114, 111, 122, 95, 101, 115, 99, 97, 112, 101, 47, 114, 111, 122, 95, 115, 116, 97, 114, 116, 95, 115, 110, 105, 112, 101, 114, 95, 118, 115, 95, 105, 109, 112, 111, 115, 116, 101, 114, 115, 46, 119, 97, 118, 0 } new s_vs_impostors_ambiance_sound[46] = { 114, 111, 122, 95, 101, 115, 99, 97, 112, 101, 47, 114, 111, 122, 95, 97, 109, 98, 105, 101, 110, 99, 101, 95, 115, 110, 105, 112, 101, 114, 115, 95, 105, 109, 112, 111, 115, 116, 101, 114, 115, 46, 109, 112, 51, 0 } new a[7] = { 115, 111, 117, 110, 100, 47, 0 } new cvar_impostors_ratio; new cvar_repsawn_time; new cvar_snipers_vs_impostors_ratio; new g_iStartSoundMp3; new g_iAmbianceSoundMp3; new g_iStartSoundMp32; new g_iAmbianceSoundMp32; new g_Smoke; new g_Lightning; new m_spriteTexture; new msgScreenFade; new g_iMenuPosition[33]; new g_iImpostorMode; new g_iSnipersVsImpostors; new g_iRoundEnd; new g_iTime;
Float:operator*(Float:,_:)(Float:oper1, oper2) { return oper1 * float(oper2); }
public __fatal_ham_error(Ham:id, HamError:err, String:reason[]) { !!! Removed Phi if (func != -1 && callfunc_begin_i(func, -1) == 1) { callfunc_push_int(id); callfunc_push_int(err); callfunc_push_str(reason, false); if (callfunc_end() == 1) { fail = 0; } } if (fail) { set_fail_state(reason); } return 0; }
set_dhudmessage(red, green, blue, Float:x, Float:y, effects, Float:fxtime, Float:holdtime, Float:fadeintime, Float:fadeouttime, bool:reliable) { __dhud_color = clamp(red, 0, 255) << 16 + clamp(green, 0, 255) << 8 + clamp(blue, 0, 255); __dhud_x = x; __dhud_y = y; __dhud_effect = effects; __dhud_fxtime = fxtime; __dhud_holdtime = holdtime; __dhud_fadeintime = fadeintime; __dhud_fadeouttime = fadeouttime; __dhud_reliable = reliable; return 1; }
show_dhudmessage(index, String:message[]) { !!! Removed Phi new buffer[128]; new numArguments = numargs(); if (numArguments == 2) { send_dhudMessage(index, message); } else { if (index || numArguments == 3) { vformat(buffer, 127, message, 3); send_dhudMessage(index, buffer); } new playersList[32]; new numPlayers = 0; get_players(playersList, numPlayers, "ch", ""); if (!numPlayers) { return 0; } new Array:handleArrayML = ArrayCreate(1, 32); new i = 2; new j = 0; while (i < numArguments) { if (getarg(i, 0) == -1) { do { j++; new var2 = getarg(i + 1, j); buffer[j] = var2; } while (var2); j = 0; if (GetLangTransKey(buffer) != -1) { i++; ArrayPushCell(handleArrayML, i); i++; } i++; } i++; } new size = ArraySize(handleArrayML); if (!size) { vformat(buffer, 127, message, 3); send_dhudMessage(index, buffer); } else { new i = 0; new j = 0; while (i < numPlayers) { index = playersList[i]; j = 0; while (j < size) { setarg(ArrayGetCell(handleArrayML, j), 0, index); j++; } vformat(buffer, 127, message, 3); send_dhudMessage(index, buffer); i++; } } ArrayDestroy(handleArrayML); } return 1; }
send_dhudMessage(index, String:message[]) { new var2; if (__dhud_reliable) { new var1; if (index) { var1 = 1; } else { var1 = 2; }
/ * ERROR! Unable to cast object of type 'Lysis.DSentinel' to type 'Lysis.DReturn'. * / function "send_dhudMessage" send_dhudMessage(index, String:message[])
public plugin_precache() { new szText[64]; copy(szText, 63, "roz_escape/roz_start_imposter.wav"); if (equal(szText[strlen(szText) - 4], ".mp3", 0)) { g_iStartSoundMp3 = 1; format(szText, 63, "%s%s", a, szText); precache_generic(szText); } else { precache_sound(impostor_start_sound); } copy(szText, 63, "roz_escape/roz_amongus.mp3"); if (equal(szText[strlen(szText) - 4], ".mp3", 0)) { g_iAmbianceSoundMp3 = 1; format(szText, 63, "%s%s", a, szText); precache_generic(szText); } else { precache_sound(impostor_ambiance_sound); } copy(szText, 63, "roz_escape/roz_start_sniper_vs_imposters.wav"); if (equal(szText[strlen(szText) - 4], ".mp3", 0)) { g_iStartSoundMp32 = 1; format(szText, 63, "%s%s", a, szText); precache_generic(szText); } else { precache_sound(s_vs_impostors_start_sound); } copy(szText, 63, "roz_escape/roz_ambience_snipers_imposters.mp3"); if (equal(szText[strlen(szText) - 4], ".mp3", 0)) { g_iAmbianceSoundMp32 = 1; format(szText, 63, "%s%s", a, szText); precache_generic(szText); } else { precache_sound(s_vs_impostors_ambiance_sound); } g_Smoke = precache_model("sprites/steam1.spr"); g_Lightning = precache_model("sprites/lgtning.spr"); m_spriteTexture = precache_model("sprites/dot.spr"); return 0; }
public plugin_natives() { register_native("zp_is_impostor_round", "native_is_impostor_round", 1); register_native("zp_is_svi_round", "native_is_svi_round", 1); return 0; }
public native_is_impostor_round() { return g_iImpostorMode; }
public native_is_svi_round() { return g_iSnipersVsImpostors; }
public plugin_init() { register_plugin("Impostor mode", "0.0.1", ".NovA."); cvar_impostors_ratio = register_cvar("roz_impostor_ratio", "0.3", 0, 0.000); cvar_repsawn_time = register_cvar("roz_auto_respawn_time", "60", 0, 0.000); cvar_snipers_vs_impostors_ratio = register_cvar("roz_snipers_vs_impostors_ratio", "0.3", 0, 0.000); msgScreenFade = get_user_msgid("ScreenFade"); register_event("HLTV", "event_new_round", "a", "1=0", "2=0"); register_logevent("logevent_round_end", 2, "1=Round_End"); RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage", 0); RegisterHam(Ham_Killed, "player", "fw_PlayerKilled", 0); RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_awp", "Fw_WeaponPrimaryAttack", 1); register_clcmd("say /imp", "cmd_impostor", -1, "", -1); return 0; }
public event_new_round() { remove_task(696969, 0); remove_task(787878, 0); g_iImpostorMode = 0; g_iSnipersVsImpostors = 0; g_iRoundEnd = 0; return 0; }
public logevent_round_end() { remove_task(696969, 0); remove_task(787878, 0); g_iRoundEnd = 1; return 0; }
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type) { !!! Removed Phi if (attacker != victim && !var4 <= 32 & 1 <= var4 && !g_iSnipersVsImpostors) { return 1; } if (zp_get_user_survivor(attacker) && get_user_weapon(attacker, 0, 0) == 18) { ExecuteHamB(Ham_Killed, victim, attacker, 2); return 2; } if (zp_get_user_impostor(attacker) && zp_get_user_survivor(victim)) { if (g_iSnipersVsImpostors == 1) { ExecuteHamB(Ham_Killed, victim, attacker, 2); return 2; } } return 1; }
public fw_PlayerKilled(victim, attacker, shouldgib) { !!! Removed Phi if (attacker != victim && !var4 <= 32 & 1 <= var4) { var2 = 1; } else { var2 = 0; } selfkill = var2; if (!selfkill) { if (zp_get_user_survivor(attacker) && get_user_weapon(attacker, 0, 0) == 18 && zp_get_user_impostor(victim)) { SetHamParamInteger(3, 2); static coord[3]; static origin[3]; get_user_origin(victim, origin, 0); message_begin(4, 23, origin, 0); write_byte(10); write_coord(origin[0][0]); write_coord(origin[1][0]); write_coord(origin[2][0] - 26); message_end(); coord[0] = origin[0][0] + 150; coord[1] = origin[1][0] + 150; coord[2] = origin[2][0] + 800; message_begin(0, 23, 92, 0); write_byte(0); write_coord(coord[0][0]); write_coord(coord[1][0]); write_coord(coord[2][0]); write_coord(origin[0][0]); write_coord(origin[1][0]); write_coord(origin[2][0]); write_short(g_Lightning); write_byte(1); write_byte(5); write_byte(2); write_byte(20); write_byte(30); write_byte(200); write_byte(200); write_byte(200); write_byte(200); write_byte(200); message_end(); message_begin(4, 23, origin, 0); write_byte(9); write_coord(origin[0][0]); write_coord(origin[1][0]); write_coord(origin[2][0]); message_end(); message_begin(0, 23, origin, 0); write_byte(5); write_coord(origin[0][0]); write_coord(origin[1][0]); write_coord(origin[2][0]); write_short(g_Smoke); write_byte(10); write_byte(10); message_end(); } if (task_exists(787878, 0)) { set_task(0.100, "do_respawn", victim, "", 0, "", 0); } } return 0; }
public do_respawn(id) { !!! Removed Phi if (g_iRoundEnd) { return 0; } new survivor = 0; if (zp_get_user_survivor(id)) { survivor = 1; } ExecuteHam(Ham_CS_RoundRespawn, id); if (survivor) { zp_make_user_survivor(id, ""); } else { make_user_impostor(id); } return 0; }
public Fw_WeaponPrimaryAttack(ent) { new id = get_pdata_cbase(ent, 41, 4, 5); if (!zp_get_user_survivor(id)) { return 1; } static vec2[3]; static vec1[3]; get_user_origin(id, vec1, 1); get_user_origin(id, vec2, 3); message_begin(0, 23, 92, 0); write_byte(0); write_coord(vec1[0][0]); write_coord(vec1[1][0]); write_coord(vec1[2][0]); write_coord(vec2[0][0]); write_coord(vec2[1][0]); write_coord(vec2[2][0]); write_short(m_spriteTexture); write_byte(1); write_byte(5); write_byte(2); write_byte(10); write_byte(0); write_byte(255); write_byte(255); write_byte(255); write_byte(200); write_byte(150); message_end(); return 1; }
public cmd_impostor(id) { if (!get_user_flags(id, 0) & 1) { return 0; } new menu = menu_create("\rImposter Menu", "handler_impostor", 0); menu_additem(menu, "Start Imposter Mode", "", 0, -1); menu_additem(menu, "Turn Specific Player Into Imposter", "", 0, -1); menu_additem(menu, "Start Snipers (RATIO) vs Imposters", "", 0, -1); menu_additem(menu, "Start Snipers Vs Imposters (Half) (Auto Respawn)", "", 0, -1); menu_additem(menu, "Start Snipers Vs Imposters (Half) (Normal)", "", 0, -1); menu_additem(menu, "\dTurn Specific Player Into Sniper (soon)", "", 0, -1); menu_display(id, menu, 0); return 0; }
public handler_impostor(id, menu, item) { !!! Removed Phi if (item == -3) { menu_destroy(menu); return 0; } if (item) { if (item == 1) { g_iMenuPosition[id] = 0; players_menu(id, 0); } if (item == 2) { if (zp_allowed_impostor_mode()) { if (ratio >= num || !ratio) { ratio = 1; } new i = 0; new randomid = 0; while (i < ratio) { randomid = players[random(num)][0][0]; while (zp_get_user_survivor(randomid)) { randomid = players[random(num)][0][0]; } zp_make_user_survivor(randomid, 0); i++; } num--; while (0 <= num) { i = players[num][0][0]; if (!(zp_get_user_survivor(i))) { make_user_impostor(i); } num--; } if (g_iStartSoundMp32) { client_cmd(0, "mp3 play %s%s", a, s_vs_impostors_start_sound); } else { client_cmd(0, "spk %s", s_vs_impostors_start_sound); } if (g_iAmbianceSoundMp32) { client_cmd(0, "mp3 play %s%s", a, s_vs_impostors_ambiance_sound); } else { client_cmd(0, "spk %s", s_vs_impostors_ambiance_sound); } set_hudmessage(255, 255, 0, -1.000, 0.100, 0, 6.000, 3.000, 0.100, 0.200, 4); show_hudmessage(0, "Snipers VS Imposters Mode !"); set_task(s_vs_impostors_ambiance_repeat, "repeat_ambiance2", 696969, "", 0, "", 0); static szName[32]; get_user_name(id, szName, 31); client_print(0, 3, "ADMIN %s - Has started mode snipers vs imposters (Ratio)", szName); } } if (item == 3) { if (zp_allowed_impostor_mode()) { if (ratio >= num || !ratio) { ratio = 1; } new i = 0; new randomid = 0; while (i < ratio) { randomid = players[random(num)][0][0]; while (zp_get_user_impostor(randomid)) { randomid = players[random(num)][0][0]; } make_user_impostor(randomid); i++; } num--; while (0 <= num) { i = players[num][0][0]; if (!(zp_get_user_impostor(i))) { zp_make_user_survivor(i, 0); } num--; } if (g_iStartSoundMp32) { client_cmd(0, "mp3 play %s%s", a, s_vs_impostors_start_sound); } else { client_cmd(0, "spk %s", s_vs_impostors_start_sound); } if (g_iAmbianceSoundMp32) { client_cmd(0, "mp3 play %s%s", a, s_vs_impostors_ambiance_sound); } else { client_cmd(0, "spk %s", s_vs_impostors_ambiance_sound); } set_hudmessage(255, 255, 0, -1.000, 0.100, 0, 6.000, 3.000, 0.100, 0.200, 4); show_hudmessage(0, "Snipers VS Imposters Mode !"); set_task(s_vs_impostors_ambiance_repeat, "repeat_ambiance2", 696969, "", 0, "", 0); static szName[32]; get_user_name(id, szName, 31); client_print(0, 3, "ADMIN %s - Has started mode snipers vs imposters", szName); g_iTime = get_pcvar_num(cvar_repsawn_time); if (g_iTime) { set_task(1.000, "auto_respawn", 787878, "", 0, "a", g_iTime); } } } if (item == 4) { if (zp_allowed_impostor_mode()) { if (ratio >= num || !ratio) { ratio = 1; } new i = 0; new randomid = 0; while (i < ratio) { randomid = players[random(num)][0][0]; while (zp_get_user_impostor(randomid)) { randomid = players[random(num)][0][0]; } make_user_impostor(randomid); i++; } num--; while (0 <= num) { i = players[num][0][0]; if (!(zp_get_user_impostor(i))) { zp_make_user_survivor(i, 0); } num--; } if (g_iStartSoundMp32) { client_cmd(0, "mp3 play %s%s", a, s_vs_impostors_start_sound); } else { client_cmd(0, "spk %s", s_vs_impostors_start_sound); } if (g_iAmbianceSoundMp32) { client_cmd(0, "mp3 play %s%s", a, s_vs_impostors_ambiance_sound); } else { client_cmd(0, "spk %s", s_vs_impostors_ambiance_sound); } set_hudmessage(255, 255, 0, -1.000, 0.100, 0, 6.000, 3.000, 0.100, 0.200, 4); show_hudmessage(0, "Snipers VS Imposters Mode !"); set_task(s_vs_impostors_ambiance_repeat, "repeat_ambiance2", 696969, "", 0, "", 0); static szName[32]; get_user_name(id, szName, 31); client_print(0, 3, "ADMIN %s - Has started mode snipers vs imposters", szName); } } } else { if (zp_allowed_impostor_mode()) { if (ratio >= num || !ratio) { ratio = 1; } new i = 0; new randomid = 0; while (i < ratio) { randomid = players[random(num)][0][0]; while (zp_get_user_impostor(randomid)) { randomid = players[random(num)][0][0]; } make_user_impostor(randomid); i++; } start_sounds(); static szName[32]; get_user_name(id, szName, 31); client_print(0, 3, "ADMIN %s - Has Started Imposter Mode", szName); } } menu_destroy(menu); return 0; }
public auto_respawn() { g_iTime += -1; set_dhudmessage(199, 51, 1, -1.000, 0.170, 0, 0.000, 1.100, 0.000, 0.000, false); show_dhudmessage(0, "Auto respawn ends in %02d", g_iTime); return 0; }
public repeat_ambiance2() { if (!g_iSnipersVsImpostors) { return 0; } if (g_iAmbianceSoundMp3) { client_cmd(0, "mp3 play %s%s", a, s_vs_impostors_ambiance_sound); } else { emit_sound(0, 0, "roz_escape/roz_ambience_snipers_imposters.mp3", 1.000, 0.800, 0, 100); } set_task(s_vs_impostors_ambiance_repeat, "repeat_ambiance2", 696969, "", 0, "", 0); return 0; }
players_menu(id, position) { new menu = menu_create("\rTurn Specific Player Into Imposter", "handler_pimpostor", 0); new num = 0; new i = 0; static szName[32]; static user_id[2]; static players[32]; get_players("", num, "ac", ""); num--; while (0 <= num) { new var2 = players; i = var2[num][0][0]; new var1; if (zp_get_user_impostor(i)) { var1 = var2; } else { user_id[0] = i; new var3 = user_id[1]; var3 = 0; get_user_name(i, szName, 31); menu_additem(menu, szName, user_id, 0, -1); var1 = var3; } num--; } menu_display(id, menu, position); return 0; }
public handler_pimpostor(id, menu, item) { !!! Removed Phi if (item == -3 || g_iSnipersVsImpostors) { menu_destroy(menu); return 0; } new i = 0; player_menu_info(id, i, i, g_iMenuPosition[id]); static user_id[2]; new var2 = Heap_4; var2[0] = 7576; menu_item_getinfo(menu, item, i, user_id, 1, var2, 0, i); i = user_id[0][0]; if (zp_allowed_nemesis(i)) { make_user_impostor(i); if (!g_iImpostorMode) { start_sounds(); } static szName2[32]; static szName[32]; get_user_name(id, szName, 31); get_user_name(i, szName2, 31); client_print(0, 3, "ADMIN %s - %s Turned into Imposter", szName, szName2); players_menu(id, g_iMenuPosition[id][0][0]); } menu_destroy(menu); return 0; }
public handler_psniper(id, menu, item) { !!! Removed Phi if (item == -3 || g_iSnipersVsImpostors) { menu_destroy(menu); return 0; } new i = 0; player_menu_info(id, i, i, g_iMenuPosition[id]); static user_id[2]; new var2 = Heap_4; var2[0] = 7576; menu_item_getinfo(menu, item, i, user_id, 1, var2, 0, i); i = user_id[0][0]; menu_destroy(menu); return 0; }
make_user_impostor(id) { zp_make_user_nemesis(id, 0, ""); message_begin(8, msgScreenFade, 7984, id); write_short(2); write_short(0); write_short(0); write_byte(0); write_byte(0); write_byte(0); write_byte(255); message_end(); return 0; }
start_sounds() { g_iImpostorMode = 1; if (g_iStartSoundMp3) { client_cmd(0, "mp3 play %s%s", a, impostor_start_sound); } else { client_cmd(0, "spk %s", impostor_start_sound); } if (g_iAmbianceSoundMp3) { client_cmd(0, "mp3 play %s%s", a, impostor_ambiance_sound); } else { client_cmd(0, "spk %s", impostor_ambiance_sound); } set_hudmessage(255, 255, 0, -1.000, 0.170, 0, 6.000, 5.000, 0.100, 0.200, 4); show_hudmessage(0, "Imposter Mode !"); set_task(impostor_ambiance_repeat, "repeat_ambiance", 696969, "", 0, "", 0); return 0; }
public repeat_ambiance() { if (!g_iImpostorMode) { return 0; } if (g_iAmbianceSoundMp3) { client_cmd(0, "mp3 play %s%s", a, impostor_ambiance_sound); } else { emit_sound(0, 0, "roz_escape/roz_amongus.mp3", 1.000, 0.800, 0, 100); } set_task(impostor_ambiance_repeat, "repeat_ambiance", 696969, "", 0, "", 0); return 0; }
Last edited by mohanad_2022; 02-01-2022 at 12:28.
|
|