Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.

  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Party System 1.0


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
Brak odpowiedzi do tego tematu

#1 Adminek AMXX.PL

    Admin :)

  • Bot

Reputacja: 156
Profesjonalista

  • Postów:7177
  • Lokalizacja:AMXX.PL
Offline

Napisano 12.02.2016 02:58

<div>First, sorry if my English is bad, but did not speak good English and am using Google Translate,<br /><br />Well, today I bring My First Plugin<br /><br />This Plugin I think because I needed in my Zombie Server<br /><br />This Plugin serves good Zombie Mode <br /><br />Well I show how Zombie <br /><br />For the Zombie Mode, it has 2 way to work,<br /><br />1. Earn AmmoPacks By Combos<br />2. Earn experience Combos<br /><br />Well here Showing How-To Zombie, Winning AmmoPacks<br /><br />Zombie and winning AmmoPacks By way Combos<br /><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">Code:</div>
<hr /><code style="margin:0px" dir="ltr" style="text-align:left">#include &lt;amxmodx&gt;<br />#include &lt;colorchat&gt;<br />#include &lt;hamsandwich&gt;<br />#include &lt;zombieapocalypse&gt;<br /><br />#define PLUGIN &quot;PJF Party&quot;<br />#define VERSION &quot;1.0&quot;<br />#define AUTHOR &quot;[R]ak&quot;<br /><br />// Use #define TAG &quot;Example: MYSERVER&quot;<br />#define TAG&nbsp; &nbsp; &quot;Pedro_Josef |&quot;<br />#define ID_HUD&nbsp; &nbsp; (taskid - TASK_HUD)<br />#define TASK_COMBO 5546<br />#define TASK_COMBOP 5546<br /><br />enum (+= 77) <br />{<br />&nbsp; &nbsp; TASK_HUD = 777,<br />&nbsp; &nbsp; TASK_ACEPT<br />}<br /><br />enum <br />{<br />&nbsp; &nbsp; NONE = -1,<br />&nbsp; &nbsp; Master,<br />&nbsp; &nbsp; Start_Amount<br />}<br /><br />enum _:pdata <br />{<br />&nbsp; &nbsp; In_Party,<br />&nbsp; &nbsp; Position,<br />&nbsp; &nbsp; Amount_In_Party,<br />&nbsp; &nbsp; Block_Party,<br />&nbsp; &nbsp; UserName[32]<br />}<br /><br />enum _:DataCallBack<br />{<br />&nbsp; &nbsp; MASTER,<br />&nbsp; &nbsp; USER<br />}<br /><br />new g_PartyData[33][pdata], Array:Party_Ids[33], g_maxplayers, g_MenuCallback[DataCallBack], g_MsgSayText<br /><br />new cvar_time_acept, cvar_max_players, cvar_allow_bots<br /><br />new g_combo[33], g_damage[33], g_Hits[33] // Combos Agregados<br />new g_combop[33], g_damagep[33], g_Hitsp[33] // Combos Party Agregados<br />new g_type, g_enabled, g_recieved, bool:g_showrecieved, g_hudmsg1, g_hudmsg2 // Bullet Dmg, Mysing Combo<br /><br />public plugin_init() <br />{<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; register_plugin(PLUGIN, VERSION, AUTHOR)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; // Event<br />&nbsp; &nbsp; register_event(&quot;Damage&quot;, &quot;on_damage&quot;, &quot;b&quot;, &quot;2!0&quot;, &quot;3=0&quot;, &quot;4!0&quot;)<br />&nbsp; &nbsp; register_event(&quot;HLTV&quot;, &quot;on_new_round&quot;, &quot;a&quot;, &quot;1=0&quot;, &quot;2=0&quot;)<br />&nbsp; &nbsp; register_event(&quot;HLTV&quot;,&quot;event_newround&quot;, &quot;a&quot;,&quot;1=0&quot;, &quot;2=0&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; g_type = register_cvar(&quot;amx_bulletdamage&quot;,&quot;1&quot;)<br />&nbsp; &nbsp; g_recieved = register_cvar(&quot;amx_bulletdamage_recieved&quot;,&quot;1&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; register_clcmd(&quot;say /party&quot;, &quot;cmdParty&quot;)<br />&nbsp; &nbsp; register_clcmd(&quot;say_team&quot;, &quot;cmdSayTeam&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; RegisterHam(Ham_TakeDamage, &quot;player&quot;, &quot;fw_TakeDamage&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; cvar_time_acept = register_cvar(&quot;party_time_acept&quot;,&quot;15&quot;)<br />&nbsp; &nbsp; cvar_max_players = register_cvar(&quot;party_max_players&quot;,&quot;5&quot;)<br />&nbsp; &nbsp; cvar_allow_bots = register_cvar(&quot;party_allow_bots&quot;,&quot;1&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; g_hudmsg1 = CreateHudSyncObj()<br />&nbsp; &nbsp; g_hudmsg2= CreateHudSyncObj()<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; g_maxplayers = get_maxplayers()<br />&nbsp; &nbsp; g_MsgSayText = get_user_msgid(&quot;SayText&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; g_MenuCallback[MASTER] = menu_makecallback(&quot;check_master&quot;)<br />&nbsp; &nbsp; g_MenuCallback[USER] = menu_makecallback(&quot;check_user&quot;)<br />}<br /><br />public event_newround()<br />{<br />&nbsp; &nbsp; for(new player = 0; player &lt;= 32; player++) <br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; g_combo[player] = g_combop[player] = 1<br />&nbsp; &nbsp; &nbsp; &nbsp; g_damage[player] = g_damagep[player] = 0<br />&nbsp; &nbsp; &nbsp; &nbsp; g_Hits[player] = g_Hitsp[player] = 0<br />&nbsp; &nbsp; }<br />}<br /><br />public plugin_cfg()<br />&nbsp; &nbsp; for(new i = 1; i &lt;= g_maxplayers; i++)<br />&nbsp; &nbsp; &nbsp; &nbsp; Party_Ids[i] = ArrayCreate(1, 1)<br /><br />public client_connect(id)<br />{<br />&nbsp; &nbsp; g_combo[id] = g_combop[id] = 1<br />&nbsp; &nbsp; g_damage[id] = g_damagep[id] = 0<br />&nbsp; &nbsp; g_Hits[id] = g_Hitsp[id] = 0<br />}<br />public client_disconnect(id) <br />{&nbsp; &nbsp; <br />&nbsp; &nbsp; if(g_PartyData[id][In_Party])<br />&nbsp; &nbsp; &nbsp; &nbsp; g_PartyData[id][Position] ? g_PartyData[id][Amount_In_Party] == 2 ? destoy_party(id) : remove_party_user(id) : destoy_party(id)<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; g_PartyData[id][UserName][0] = 0<br />&nbsp; &nbsp; g_PartyData[id][Block_Party] = false<br />}<br /><br />// Ham Take Damage Forward<br />public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)<br />{<br />&nbsp; &nbsp; // Attacker is human...<br />&nbsp; &nbsp; if (!zp_get_user_zombie(attacker))<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; if(!g_PartyData[attacker][In_Party]) // Combos Sin Party<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Combos Agregados<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; g_damage[attacker] += floatround(damage)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; g_Hits[attacker]++<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while(g_damage[attacker]&gt;=(power(g_combo[attacker], 1)*330))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; g_combo[attacker]++<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; remove_task(attacker+TASK_COMBO)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_task(0.1, &quot;task_combo&quot;, attacker+TASK_COMBO)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_task(4.0, &quot;reset_combo&quot;, attacker+TASK_COMBO)&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; else // Combos Del Party<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; new Players[32], user<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get_party_index(attacker, Players)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for(new i; i &lt; g_PartyData[attacker][Amount_In_Party]; i++)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; user = Players[i]<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; g_damagep[user] += floatround(damage) / g_PartyData[user][Amount_In_Party]<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; g_Hitsp[user]++<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while(g_damagep[user]&gt;=(power(g_combop[user], 1)*430))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; g_combop[user]++<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; remove_task(user+TASK_COMBOP)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_task(0.1, &quot;task_party_combo&quot;, user+TASK_COMBOP)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_task(4.0, &quot;reset_party_combo&quot;, user+TASK_COMBOP)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }<br />}<br /><br />public on_new_round()<br />{<br />&nbsp; &nbsp; g_enabled = get_pcvar_num(g_type)<br />&nbsp; &nbsp; if(get_pcvar_num(g_recieved)) g_showrecieved = true&nbsp; &nbsp; <br />}<br /><br />public on_damage(id)<br />{<br />&nbsp; &nbsp; if(g_enabled)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; static damage; damage = read_data(2)<br />&nbsp; &nbsp; &nbsp; &nbsp; if(g_showrecieved &amp;&amp; zp_get_user_zombie(id)) <br />&nbsp; &nbsp; &nbsp; &nbsp; {&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_hudmessage(255, 0, 0, 0.3, 0.0, 2, 0.1, 4.0, 0.1, 0.1, -1)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShowSyncHudMsg(id, g_hudmsg2, &quot;[Daño]= %i^n&quot;, damage)&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; }<br />}<br /><br />public task_combo(attacker)<br />{<br />&nbsp; &nbsp; attacker -= TASK_COMBO<br />&nbsp; &nbsp; static flags<br />&nbsp; &nbsp; flags = get_user_flags(attacker)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(g_combo[attacker]&gt;0)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; set_hudmessage(0, 200, 200, 0.0, 0.5, 1, 0.1, 4.0, 0.01, 0.01, -1)<br />&nbsp; &nbsp; &nbsp; &nbsp; ShowSyncHudMsg(attacker, g_hudmsg1, &quot;[Normal Combos]^nDamage: %d^n%d | %d^nTotal de Combos: %d^nTu Ganas: %d AmmoPacks&quot;, <br />&nbsp; &nbsp; &nbsp; &nbsp; g_damage[attacker], g_damage[attacker], (power(g_combo[attacker], 1)*330), g_combo[attacker], g_combo[attacker] * 1+((flags &amp; ADMIN_LEVEL_D ? 7: flags &amp; ADMIN_LEVEL_A ? 5: flags &amp; ADMIN_LEVEL_B ? 3 : 0)))<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />}<br /><br />public task_party_combo(i)<br />{<br />&nbsp; &nbsp; i -= TASK_COMBOP<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; static flags<br />&nbsp; &nbsp; flags = get_user_flags(i)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(g_combop[i]&gt;0 &amp;&amp; !zp_get_user_zombie(i) &amp;&amp; is_user_alive(i))<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; if(g_PartyData[i][In_Party])<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_hudmessage(0, 200, 200, 0.0, 0.5, 1, 0.1, 4.0, 0.01, 0.01, -1)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShowSyncHudMsg(i, g_hudmsg1, &quot;[PJF Party]^nDamage: %d^n%d | %d^nTotal de Combos: %d^nTu Ganas: %d AmmoPacks&quot;, <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; g_damagep[i], g_damagep[i], (power(g_combop[i], 4)*430), g_combop[i], g_combop[i] * 4+((flags &amp; ADMIN_LEVEL_D ? 7: flags &amp; ADMIN_LEVEL_A ? 5: flags &amp; ADMIN_LEVEL_B ? 3 : 0)))<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }<br />}<br /><br />public reset_combo(id)<br />{<br />&nbsp; &nbsp; id -= TASK_COMBO<br />&nbsp; &nbsp; static flags<br />&nbsp; &nbsp; flags = get_user_flags(id)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; static ganancia; ganancia = g_combo[id] * 1+((flags &amp; ADMIN_LEVEL_D ? 7: flags &amp; ADMIN_LEVEL_A ? 5: flags &amp; ADMIN_LEVEL_B ? 3 : 0))<br />&nbsp; &nbsp; if (g_combo[id]&gt;0)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; set_hudmessage(120, 120, 120, -1.0, 0.25, 0, 0.1, 4.0, 0.01, 0.01, -1)<br />&nbsp; &nbsp; &nbsp; &nbsp; ShowSyncHudMsg(id, g_hudmsg1, &quot;^n^n^n^n Combo Terminado (%d)^nGanancia: %d AmmoPacks&quot;, g_combo[id], ganancia)<br />&nbsp; &nbsp; &nbsp; &nbsp; ColorChat(id, TEAM_COLOR, &quot;^x04[PJF Party]^x01 Combo Total:^x04 %d^x01 | Damage Total:^x04 %d^x01 | Hits Echos:^x04 %d^x01 | Ganancia:^x04 %d&quot;, g_combo[id], g_damage[id], g_Hits[id], ganancia)<br />&nbsp; &nbsp; &nbsp; &nbsp; zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + ganancia)<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; g_damage[id] = 0<br />&nbsp; &nbsp; g_Hits[id] = 0<br />&nbsp; &nbsp; g_combo[id] = 0<br />}<br />public reset_party_combo(i)<br />{<br />&nbsp; &nbsp; i -= TASK_COMBOP<br />&nbsp; &nbsp; static flags<br />&nbsp; &nbsp; flags = get_user_flags(i)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; static gananciap; gananciap = g_combop[i] * 4+((flags &amp; ADMIN_LEVEL_D ? 7: flags &amp; ADMIN_LEVEL_A ? 5: flags &amp; ADMIN_LEVEL_B ? 3 : 0))<br />&nbsp; &nbsp; if(g_PartyData[i][In_Party])<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; if(!zp_get_user_zombie(i))<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_hudmessage(120, 120, 120, -1.0, 0.25, 0, 0.1, 4.0, 0.01, 0.01, -1)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShowSyncHudMsg(i, g_hudmsg1, &quot;^n^n^n^n Combo Party Terminado (%d)^nGanancia: %d AmmoPacks&quot;, g_combop[i], gananciap)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ColorChat(i, TEAM_COLOR, &quot;^x04[PJF Party]^x01 Combo party Total:^x04 %d^x01 | Damage Total:^x04 %d^x01 | Hits Echos:^x04 %d^x01 | Ganancia:^x04 %d&quot;, g_combop[i], g_damagep[i], g_Hitsp[i], gananciap)<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; zp_set_user_ammo_packs(i, zp_get_user_ammo_packs(i) + gananciap)<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; g_damagep[i] = 0<br />&nbsp; &nbsp; g_Hitsp[i] = 0<br />&nbsp; &nbsp; g_combop[i] = 0<br />}<br /><br />public cmdParty(id) <br />{<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(g_PartyData[id][In_Party])<br />&nbsp; &nbsp; &nbsp; &nbsp; show_party_info_menu(id)<br />&nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; show_party_menu(id)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; return PLUGIN_HANDLED<br />}<br /><br />public show_party_menu(id) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new iMenu = menu_create(&quot;[PJF Party] - rMenu Party:&quot;,&quot;party_menu&quot;), BlockParty[50]<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_additem(iMenu, &quot;yCrear Party&quot;, &quot;0&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; formatex(BlockParty, charsmax(BlockParty), &quot;yBloquear Invitaciones De Party: w%s&quot;,g_PartyData[id][Block_Party] ? &quot;Si&quot; : &quot;No&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_additem(iMenu, BlockParty, &quot;1&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_setprop(iMenu, MPROP_EXITNAME, &quot;Salir&quot;)<br />&nbsp; &nbsp; menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_display(id, iMenu, 0)<br />}<br /><br />public show_party_info_menu(id) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new iMenu = menu_create(&quot;[PJF Party] - rMenu Party:&quot;,&quot;party_info_menu&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_additem(iMenu, &quot;Agregar Integrante&quot;, .callback = g_MenuCallback[MASTER])<br />&nbsp; &nbsp; menu_additem(iMenu, &quot;Expulsar Integrande&quot;, .callback = g_MenuCallback[MASTER])<br />&nbsp; &nbsp; menu_additem(iMenu, &quot;Destruir Party&quot;, .callback = g_MenuCallback[MASTER])<br />&nbsp; &nbsp; menu_additem(iMenu, &quot;Salir del Party&quot;, .callback = g_MenuCallback[USER])<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_setprop(iMenu, MPROP_EXITNAME, &quot;Salir&quot;)<br />&nbsp; &nbsp; menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_display(id, iMenu)<br />}<br /><br />public show_party_add_menu(id) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new iMenu = menu_create(g_PartyData[id][In_Party] ? &quot;rAgregar Integrante:&quot; : &quot;rCrear Party:&quot;, &quot;party_create_menu&quot;), Poss[3], Name[32]<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; for(new i = 1; i &lt;= g_maxplayers; i++) {<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; if(!is_available_to_party(i) || id == i)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; get_user_name(i, Name, charsmax(Name))<br />&nbsp; &nbsp; &nbsp; &nbsp; num_to_str(i, Poss, charsmax(Poss))<br />&nbsp; &nbsp; &nbsp; &nbsp; menu_additem(iMenu, Name, Poss)<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_setprop(iMenu, MPROP_EXITNAME, &quot;Salir&quot;)<br />&nbsp; &nbsp; menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_display(id, iMenu)<br />}<br /><br />public show_party_kick_menu(id) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new iMenu = menu_create(&quot;rKick Party Menu:&quot;,&quot;party_kick_menu&quot;), Players[32], Poss[3], user<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; get_party_index(id, Players)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; for(new i; i &lt; g_PartyData[id][Amount_In_Party]; i++) {<br />&nbsp; &nbsp; &nbsp; &nbsp; user = Players[i]<br />&nbsp; &nbsp; &nbsp; &nbsp; num_to_str(user, Poss, charsmax(Poss))<br />&nbsp; &nbsp; &nbsp; &nbsp; menu_additem(iMenu, g_PartyData[user][UserName], Poss)<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_setprop(iMenu, MPROP_EXITNAME, &quot;Salir&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_display(id, iMenu)<br />}<br /><br />public show_party_invite_menu(id2, MasterId) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new MenuTitle[128], iMenu, Str_MasterId[3]<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; set_player_party_name(MasterId)<br />&nbsp; &nbsp; set_player_party_name(id2)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; client_print(MasterId, print_chat, &quot;%s Solicitud enviada a %s&quot;, TAG, g_PartyData[id2][UserName])<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; formatex(MenuTitle, charsmax(MenuTitle), &quot;%s te mando una invitacion para %s Party&quot;, g_PartyData[MasterId][UserName], g_PartyData[MasterId][In_Party] ? &quot;unirte al&quot; : &quot;crear un&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new UserTaskArgs[3]<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; UserTaskArgs[0] = iMenu = menu_create( MenuTitle , &quot;party_invite_menu&quot;)<br />&nbsp; &nbsp; UserTaskArgs[1] = MasterId<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; num_to_str(MasterId, Str_MasterId, charsmax(Str_MasterId))<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_additem( iMenu , &quot;Aceptar&quot;, Str_MasterId)<br />&nbsp; &nbsp; menu_additem( iMenu , &quot;Rechazar&quot;, Str_MasterId)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(is_user_bot(id2) &amp;&amp; get_pcvar_num(cvar_allow_bots)) {<br />&nbsp; &nbsp; &nbsp; &nbsp; party_invite_menu(id2, iMenu, 0)<br />&nbsp; &nbsp; &nbsp; &nbsp; return<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_setprop(iMenu, MPROP_EXIT, MEXIT_NEVER)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_display(id2, iMenu)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; remove_task_acept(id2)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; set_task(get_pcvar_float(cvar_time_acept), &quot;Time_Acept&quot;, id2+TASK_ACEPT, UserTaskArgs, 2)<br />}<br />&nbsp; &nbsp; <br /><br />public party_menu(id, menu, item) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(item == MENU_EXIT) {<br />&nbsp; &nbsp; &nbsp; &nbsp; menu_destroy(menu)<br />&nbsp; &nbsp; &nbsp; &nbsp; return<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(item) {<br />&nbsp; &nbsp; &nbsp; &nbsp; g_PartyData[id][Block_Party] = g_PartyData[id][Block_Party] ? false : true<br />&nbsp; &nbsp; &nbsp; &nbsp; show_party_menu(id)<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; show_party_add_menu(id)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_destroy(menu)<br />&nbsp; &nbsp; <br />}<br /><br />public party_create_menu(id, menu, item) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(item == MENU_EXIT) {<br />&nbsp; &nbsp; &nbsp; &nbsp; menu_destroy(menu)<br />&nbsp; &nbsp; &nbsp; &nbsp; return<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new iKey[6], iAccess, iCallback, id2<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_item_getinfo(menu, item, iAccess, iKey, charsmax(iKey), _, _, iCallback)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; id2 = str_to_num(iKey)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(!is_available_to_party(id2))<br />&nbsp; &nbsp; &nbsp; &nbsp; return<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; show_party_invite_menu(id2, id)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_destroy(menu)<br />}<br /><br />public party_invite_menu(id, menu, item) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(item == MENU_EXIT) {<br />&nbsp; &nbsp; &nbsp; &nbsp; menu_destroy(menu)<br />&nbsp; &nbsp; &nbsp; &nbsp; remove_task_acept(id)<br />&nbsp; &nbsp; &nbsp; &nbsp; return<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new iKey[6], iAccess, iCallback, id_master<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_item_getinfo(menu, item, iAccess, iKey, charsmax(iKey), _, _, iCallback)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; id_master = str_to_num(iKey)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; switch(item) {<br />&nbsp; &nbsp; &nbsp; &nbsp; case 0: {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(!g_PartyData[id_master][In_Party]) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; create_party(id_master, id)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_task_party_hud(id_master)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_task_party_hud(id)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(g_PartyData[id_master][Amount_In_Party] == get_pcvar_num(cvar_max_players)) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; client_print(id, print_chat, &quot;%s Ya se alcanzo el numero maximo de integrantes en la party&quot;, TAG)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; client_print(id_master, print_chat, &quot;%s Ya alcanzaste el numero maximo de integrantes en la party&quot;, TAG)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; remove_task_acept(id)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; menu_destroy(menu)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; add_party_user(id_master, id)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_task_party_hud(id)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; client_print(id_master, print_chat, &quot;%s %s fue agregado al Party&quot;, TAG, g_PartyData[id][UserName])<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; case 1: client_print(id_master, print_chat, &quot;%s %s cancelo la invitacion de Party&quot;, TAG, g_PartyData[id][UserName])<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; remove_task_acept(id)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_destroy(menu)<br />}<br /><br />public party_kick_menu(id, menu, item) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(item == MENU_EXIT) {<br />&nbsp; &nbsp; &nbsp; &nbsp; menu_destroy(menu)<br />&nbsp; &nbsp; &nbsp; &nbsp; return<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new iKey[6], iAccess, iCallback, id2<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_item_getinfo(menu, item, iAccess, iKey, charsmax(iKey), _, _, iCallback)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; id2 = str_to_num(iKey)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(is_user_connected(id2))<br />&nbsp; &nbsp; &nbsp; &nbsp; g_PartyData[id][Amount_In_Party] == 2 ? destoy_party(id) : remove_party_user(id2)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_destroy(menu)<br />}<br /><br />public party_info_menu(id, menu,item) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(item == MENU_EXIT) {<br />&nbsp; &nbsp; &nbsp; &nbsp; menu_destroy(menu)<br />&nbsp; &nbsp; &nbsp; &nbsp; return<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; switch(item) {<br />&nbsp; &nbsp; &nbsp; &nbsp; case 0: {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(g_PartyData[id][Amount_In_Party] &lt; get_pcvar_num(cvar_max_players))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; show_party_add_menu(id)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; client_print(id, print_chat, &quot;%s Ya alcanzaste el numero maximo de integrantes en la party&quot;, TAG)<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; case 1: show_party_kick_menu(id)<br />&nbsp; &nbsp; &nbsp; &nbsp; case 2: destoy_party(id)<br />&nbsp; &nbsp; &nbsp; &nbsp; case 3: remove_party_user(id)<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_destroy(menu)<br />}<br /><br />public PartyHud(taskid) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; static id<br />&nbsp; &nbsp; id = ID_HUD<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(!is_user_connected(id)) {<br />&nbsp; &nbsp; &nbsp; &nbsp; remove_task(taskid)<br />&nbsp; &nbsp; &nbsp; &nbsp; return<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; static CountParty, PartyMsg[256], Players[32], id2<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; CountParty = 0<br />&nbsp; &nbsp; PartyMsg[0] = 0<br /><br />&nbsp; &nbsp; get_party_index(id, Players)<br />&nbsp; &nbsp; for(new i; i &lt; g_PartyData[id][Amount_In_Party]; i++) {<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; id2 = Players[i]<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; if(CountParty)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; add(PartyMsg, charsmax(PartyMsg), &quot;^n&quot;)<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; format(PartyMsg, charsmax(PartyMsg), &quot;%s%s&quot;, strlen(PartyMsg) ? PartyMsg : &quot;^t^t^t[PJF Party] PARTY^n&quot;, g_PartyData[id2][UserName])<br />&nbsp; &nbsp; &nbsp; &nbsp; CountParty++<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; set_hudmessage(255, 255, 255, 0.6, 0.7, 0, 6.0, 1.0);<br />&nbsp; &nbsp; show_hudmessage(id, PartyMsg)<br />}<br /><br />public Time_Acept(UserTaskArgs[], taskid) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; taskid -= TASK_ACEPT;<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(!g_PartyData[taskid][In_Party]) {<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; client_print(UserTaskArgs[1], print_chat, &quot;%s %s cancelo la invitacion de party&quot;, TAG, g_PartyData[taskid][UserName])<br />&nbsp; &nbsp; &nbsp; &nbsp; menu_destroy(UserTaskArgs[0])<br />&nbsp; &nbsp; &nbsp; &nbsp; show_menu(taskid, 0, &quot;^n&quot;, 1)<br />&nbsp; &nbsp; }<br />}<br /><br />stock create_party(master, guest) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; set_party_member(master, master)<br />&nbsp; &nbsp; set_party_member(master, guest)<br />&nbsp; &nbsp; set_party_member(guest, master)<br />&nbsp; &nbsp; set_party_member(guest, guest)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; set_party_vars(master, Start_Amount)<br />&nbsp; &nbsp; set_party_vars(guest, ++g_PartyData[master][Amount_In_Party])<br />}<br /><br />stock add_party_user(master, guest) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new Players[32], member, amount = g_PartyData[master][Amount_In_Party]<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; get_party_index(master, Players)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; for(new i; i &lt; amount; i++) {<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; member = Players[i]<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; set_party_member(guest, member)<br />&nbsp; &nbsp; &nbsp; &nbsp; set_party_member(member, guest)<br />&nbsp; &nbsp; &nbsp; &nbsp; g_PartyData[member][Amount_In_Party]++<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; set_party_member(guest, guest)<br />&nbsp; &nbsp; set_party_vars(guest, amount+1)&nbsp; &nbsp; <br />}<br /><br />stock set_party_member(id, id2)<br />&nbsp; &nbsp; ArrayPushCell(Party_Ids[id], id2)<br /><br />stock set_party_vars(id, amount) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; g_PartyData[id][In_Party] = true<br />&nbsp; &nbsp; g_PartyData[id][Position] = amount-1<br />&nbsp; &nbsp; g_PartyData[id][Amount_In_Party] = amount<br />&nbsp; &nbsp; <br />}<br /><br />stock destoy_party(id) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new Players[32], id2, Amount = g_PartyData[id][Amount_In_Party]<br />&nbsp; &nbsp; get_party_index(id, Players)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; for(new i; i &lt; Amount; i++) {<br />&nbsp; &nbsp; &nbsp; &nbsp; id2 = Players[i]<br />&nbsp; &nbsp; &nbsp; &nbsp; clear_party_user(id2)<br />&nbsp; &nbsp; &nbsp; &nbsp; client_print(id2, print_chat, &quot;%s La party fue destruida&quot;, TAG)<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; }<br />}<br /><br />stock remove_party_user(user) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new Players[32], id, Amount = g_PartyData[user][Amount_In_Party]<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; get_party_index(user, Players)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; clear_party_user(user)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; for(new i; i &lt; Amount; i++) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; id = Players[i]<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; if(id != user) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ArrayClear(Party_Ids[id])<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for(new z; z &lt; Amount; z++)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(Players[z] != user)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_party_member(id, Players[z])<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; g_PartyData[id][Position] = i<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; g_PartyData[id][Amount_In_Party] = Amount-1<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; client_print(id, print_chat, &quot;%s %s salio del party&quot;, TAG, g_PartyData[user][UserName])<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }<br />}<br /><br />stock clear_party_user(id) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; ArrayClear(Party_Ids[id])<br />&nbsp; &nbsp; g_PartyData[id][In_Party] = false<br />&nbsp; &nbsp; g_PartyData[id][Position] = NONE<br />&nbsp; &nbsp; g_PartyData[id][Amount_In_Party] = NONE<br />&nbsp; &nbsp; remove_task_party_hud(id)<br />&nbsp; &nbsp; <br />}<br /><br />stock set_task_party_hud(id)<br />&nbsp; &nbsp; set_task(1.0, &quot;PartyHud&quot;, id+TASK_HUD, _, _, &quot;b&quot;)<br />&nbsp; &nbsp; <br />stock remove_task_party_hud(id)<br />&nbsp; &nbsp; remove_task(id+TASK_HUD)<br /><br />stock remove_task_acept(id)<br />&nbsp; &nbsp; if(task_exists(id+TASK_ACEPT))<br />&nbsp; &nbsp; &nbsp; &nbsp; remove_task(id+TASK_ACEPT)<br />&nbsp; &nbsp; <br /><br />stock set_player_party_name(id) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(g_PartyData[id][UserName][0])<br />&nbsp; &nbsp; &nbsp; &nbsp; return 0<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; get_user_name(id, g_PartyData[id][UserName], charsmax(g_PartyData[][UserName]))<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; return 1<br />}<br /><br />stock is_available_to_party(id) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(!is_user_connected(id) || g_PartyData[id][In_Party] || g_PartyData[id][Block_Party])<br />&nbsp; &nbsp; &nbsp; &nbsp; return false<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; return true<br />}&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <br />stock get_party_index(id, players[]) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; for(new i; i &lt; g_PartyData[id][Amount_In_Party]; i++)<br />&nbsp; &nbsp; &nbsp; &nbsp; players[i] = ArrayGetCell(Party_Ids[id], i)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; return players[0] ? 1 : 0<br />}<br /><br />public check_master(id)<br />&nbsp; &nbsp; return g_PartyData[id][Position] ? ITEM_DISABLED : ITEM_ENABLED<br />&nbsp; &nbsp; <br />public check_user(id)<br />&nbsp; &nbsp; return g_PartyData[id][Position] ? ITEM_ENABLED : ITEM_DISABLED<br /><br />public cmdSayTeam(id) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; static Text[192]<br />&nbsp; &nbsp; read_args(Text, charsmax(Text))<br />&nbsp; &nbsp; remove_quotes(Text)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; replace_all(Text, charsmax(Text), &quot;%&quot;, &quot;&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(!ValidMessage(Text) || !g_PartyData[id][In_Party]) {<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; client_print(id, print_chat,&quot;%s Tu Mensaje es invalido o no te encuentras en un Party&quot;, TAG)<br />&nbsp; &nbsp; &nbsp; &nbsp; return PLUGIN_HANDLED;<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; static Message[192], Players[32], id2, Amount <br />&nbsp; &nbsp; Amount = g_PartyData[id][Amount_In_Party]<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; get_party_index(id, Players)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; formatex(Message, charsmax(Message), &quot;^x04%s ^x03%s^x01 : %s&quot;, TAG, g_PartyData[id][UserName], Text)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; for(new i; i &lt; Amount; i++) {<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; id2 = Players[i]<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; message_begin(MSG_ONE_UNRELIABLE, g_MsgSayText, _, id2)<br />&nbsp; &nbsp; &nbsp; &nbsp; write_byte(id)<br />&nbsp; &nbsp; &nbsp; &nbsp; write_string(Message)<br />&nbsp; &nbsp; &nbsp; &nbsp; message_end()<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; return PLUGIN_HANDLED;<br />}<br /><br />ValidMessage(text[]) {<br />&nbsp; &nbsp; static len, i<br />&nbsp; &nbsp; len = strlen(text)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(!len)<br />&nbsp; &nbsp; &nbsp; &nbsp; return false<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; for(i = 0; i &lt; len; i++) {<br />&nbsp; &nbsp; &nbsp; &nbsp; if( text[i] != ' ' ) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return true<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }<br /><br />&nbsp; &nbsp; return false<br />}</code><hr />
</div><br />Zombie mode and gaining experience for Combos<br /><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">Code:</div>
<hr /><code style="margin:0px" dir="ltr" style="text-align:left">#include &lt;amxmodx&gt;<br />#include &lt;colorchat&gt;<br />#include &lt;hamsandwich&gt;<br />#include &lt;zombieapocalypse&gt;<br /><br />#define PLUGIN &quot;PJF Party&quot;<br />#define VERSION &quot;1.0&quot;<br />#define AUTHOR &quot;[R]ak&quot;<br /><br />// Use #define TAG &quot;Example: MYSERVER&quot;<br />#define TAG&nbsp; &nbsp; &quot;Pedro_Josef |&quot;<br />#define ID_HUD&nbsp; &nbsp; (taskid - TASK_HUD)<br />#define TASK_COMBO 5546<br />#define TASK_COMBOP 5546<br /><br />enum (+= 77) <br />{<br />&nbsp; &nbsp; TASK_HUD = 777,<br />&nbsp; &nbsp; TASK_ACEPT<br />}<br /><br />enum <br />{<br />&nbsp; &nbsp; NONE = -1,<br />&nbsp; &nbsp; Master,<br />&nbsp; &nbsp; Start_Amount<br />}<br /><br />enum _:pdata <br />{<br />&nbsp; &nbsp; In_Party,<br />&nbsp; &nbsp; Position,<br />&nbsp; &nbsp; Amount_In_Party,<br />&nbsp; &nbsp; Block_Party,<br />&nbsp; &nbsp; UserName[32]<br />}<br /><br />enum _:DataCallBack<br />{<br />&nbsp; &nbsp; MASTER,<br />&nbsp; &nbsp; USER<br />}<br /><br />new g_PartyData[33][pdata], Array:Party_Ids[33], g_maxplayers, g_MenuCallback[DataCallBack], g_MsgSayText<br /><br />new cvar_time_acept, cvar_max_players, cvar_allow_bots<br /><br />new g_combo[33], g_damage[33], g_Hits[33] // Combos Agregados<br />new g_combop[33], g_damagep[33], g_Hitsp[33] // Combos Party Agregados<br />new g_type, g_enabled, g_recieved, bool:g_showrecieved, g_hudmsg1, g_hudmsg2 // Bullet Dmg, Mysing Combo<br /><br />public plugin_init() <br />{<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; register_plugin(PLUGIN, VERSION, AUTHOR)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; // Event<br />&nbsp; &nbsp; register_event(&quot;Damage&quot;, &quot;on_damage&quot;, &quot;b&quot;, &quot;2!0&quot;, &quot;3=0&quot;, &quot;4!0&quot;)<br />&nbsp; &nbsp; register_event(&quot;HLTV&quot;, &quot;on_new_round&quot;, &quot;a&quot;, &quot;1=0&quot;, &quot;2=0&quot;)<br />&nbsp; &nbsp; register_event(&quot;HLTV&quot;,&quot;event_newround&quot;, &quot;a&quot;,&quot;1=0&quot;, &quot;2=0&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; g_type = register_cvar(&quot;amx_bulletdamage&quot;,&quot;1&quot;)<br />&nbsp; &nbsp; g_recieved = register_cvar(&quot;amx_bulletdamage_recieved&quot;,&quot;1&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; register_clcmd(&quot;say /party&quot;, &quot;cmdParty&quot;)<br />&nbsp; &nbsp; register_clcmd(&quot;say_team&quot;, &quot;cmdSayTeam&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; RegisterHam(Ham_TakeDamage, &quot;player&quot;, &quot;fw_TakeDamage&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; cvar_time_acept = register_cvar(&quot;party_time_acept&quot;,&quot;15&quot;)<br />&nbsp; &nbsp; cvar_max_players = register_cvar(&quot;party_max_players&quot;,&quot;5&quot;)<br />&nbsp; &nbsp; cvar_allow_bots = register_cvar(&quot;party_allow_bots&quot;,&quot;1&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; g_hudmsg1 = CreateHudSyncObj()<br />&nbsp; &nbsp; g_hudmsg2= CreateHudSyncObj()<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; g_maxplayers = get_maxplayers()<br />&nbsp; &nbsp; g_MsgSayText = get_user_msgid(&quot;SayText&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; g_MenuCallback[MASTER] = menu_makecallback(&quot;check_master&quot;)<br />&nbsp; &nbsp; g_MenuCallback[USER] = menu_makecallback(&quot;check_user&quot;)<br />}<br /><br />public event_newround()<br />{<br />&nbsp; &nbsp; for(new player = 0; player &lt;= 32; player++) <br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; g_combo[player] = g_combop[player] = 1<br />&nbsp; &nbsp; &nbsp; &nbsp; g_damage[player] = g_damagep[player] = 0<br />&nbsp; &nbsp; &nbsp; &nbsp; g_Hits[player] = g_Hitsp[player] = 0<br />&nbsp; &nbsp; }<br />}<br /><br />public plugin_cfg()<br />&nbsp; &nbsp; for(new i = 1; i &lt;= g_maxplayers; i++)<br />&nbsp; &nbsp; &nbsp; &nbsp; Party_Ids[i] = ArrayCreate(1, 1)<br /><br />public client_connect(id)<br />{<br />&nbsp; &nbsp; g_combo[id] = g_combop[id] = 1<br />&nbsp; &nbsp; g_damage[id] = g_damagep[id] = 0<br />&nbsp; &nbsp; g_Hits[id] = g_Hitsp[id] = 0<br />}<br />public client_disconnect(id) <br />{&nbsp; &nbsp; <br />&nbsp; &nbsp; if(g_PartyData[id][In_Party])<br />&nbsp; &nbsp; &nbsp; &nbsp; g_PartyData[id][Position] ? g_PartyData[id][Amount_In_Party] == 2 ? destoy_party(id) : remove_party_user(id) : destoy_party(id)<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; g_PartyData[id][UserName][0] = 0<br />&nbsp; &nbsp; g_PartyData[id][Block_Party] = false<br />}<br /><br />// Ham Take Damage Forward<br />public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)<br />{<br />&nbsp; &nbsp; // Attacker is human...<br />&nbsp; &nbsp; if (!zp_get_user_zombie(attacker))<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; if(!g_PartyData[attacker][In_Party]) // Combos Sin Party<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Combos Agregados<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; g_damage[attacker] += floatround(damage)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; g_Hits[attacker]++<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while(g_damage[attacker]&gt;=(power(g_combo[attacker], 1)*330))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; g_combo[attacker]++<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; remove_task(attacker+TASK_COMBO)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_task(0.1, &quot;task_combo&quot;, attacker+TASK_COMBO)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_task(4.0, &quot;reset_combo&quot;, attacker+TASK_COMBO)&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; else // Combos Del Party<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; new Players[32], user<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get_party_index(attacker, Players)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for(new i; i &lt; g_PartyData[attacker][Amount_In_Party]; i++)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; user = Players[i]<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; g_damagep[user] += floatround(damage) / g_PartyData[user][Amount_In_Party]<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; g_Hitsp[user]++<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while(g_damagep[user]&gt;=(power(g_combop[user], 1)*430))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; g_combop[user]++<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; remove_task(user+TASK_COMBOP)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_task(0.1, &quot;task_party_combo&quot;, user+TASK_COMBOP)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_task(4.0, &quot;reset_party_combo&quot;, user+TASK_COMBOP)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }<br />}<br /><br />public on_new_round()<br />{<br />&nbsp; &nbsp; g_enabled = get_pcvar_num(g_type)<br />&nbsp; &nbsp; if(get_pcvar_num(g_recieved)) g_showrecieved = true&nbsp; &nbsp; <br />}<br /><br />public on_damage(id)<br />{<br />&nbsp; &nbsp; if(g_enabled)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; static damage; damage = read_data(2)<br />&nbsp; &nbsp; &nbsp; &nbsp; if(g_showrecieved &amp;&amp; zp_get_user_zombie(id)) <br />&nbsp; &nbsp; &nbsp; &nbsp; {&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_hudmessage(255, 0, 0, 0.3, 0.0, 2, 0.1, 4.0, 0.1, 0.1, -1)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShowSyncHudMsg(id, g_hudmsg2, &quot;[Daño]= %i^n&quot;, damage)&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; }<br />}<br /><br />public task_combo(attacker)<br />{<br />&nbsp; &nbsp; attacker -= TASK_COMBO<br />&nbsp; &nbsp; static flags<br />&nbsp; &nbsp; flags = get_user_flags(attacker)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(g_combo[attacker]&gt;0)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; set_hudmessage(0, 200, 200, 0.0, 0.5, 1, 0.1, 4.0, 0.01, 0.01, -1)<br />&nbsp; &nbsp; &nbsp; &nbsp; ShowSyncHudMsg(attacker, g_hudmsg1, &quot;[Normal Combos]^nDamage: %d^n%d | %d^nTotal de Combos: %d^nTu Ganas: %d AmmoPacks&quot;, <br />&nbsp; &nbsp; &nbsp; &nbsp; g_damage[attacker], g_damage[attacker], (power(g_combo[attacker], 1)*330), g_combo[attacker], g_combo[attacker] * 1+((flags &amp; ADMIN_LEVEL_D ? 7: flags &amp; ADMIN_LEVEL_A ? 5: flags &amp; ADMIN_LEVEL_B ? 3 : 0)))<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />}<br /><br />public task_party_combo(i)<br />{<br />&nbsp; &nbsp; i -= TASK_COMBOP<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; static flags<br />&nbsp; &nbsp; flags = get_user_flags(i)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(g_combop[i]&gt;0 &amp;&amp; !zp_get_user_zombie(i) &amp;&amp; is_user_alive(i))<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; if(g_PartyData[i][In_Party])<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_hudmessage(0, 200, 200, 0.0, 0.5, 1, 0.1, 4.0, 0.01, 0.01, -1)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShowSyncHudMsg(i, g_hudmsg1, &quot;[PJF Party]^nDamage: %d^n%d | %d^nTotal de Combos: %d^nTu Ganas: %d AmmoPacks&quot;, <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; g_damagep[i], g_damagep[i], (power(g_combop[i], 4)*430), g_combop[i], g_combop[i] * 4+((flags &amp; ADMIN_LEVEL_D ? 7: flags &amp; ADMIN_LEVEL_A ? 5: flags &amp; ADMIN_LEVEL_B ? 3 : 0)))<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }<br />}<br /><br />public reset_combo(id)<br />{<br />&nbsp; &nbsp; id -= TASK_COMBO<br />&nbsp; &nbsp; static flags<br />&nbsp; &nbsp; flags = get_user_flags(id)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; static ganancia; ganancia = g_combo[id] * 1+((flags &amp; ADMIN_LEVEL_D ? 7: flags &amp; ADMIN_LEVEL_A ? 5: flags &amp; ADMIN_LEVEL_B ? 3 : 0))<br />&nbsp; &nbsp; if (g_combo[id]&gt;0)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; set_hudmessage(120, 120, 120, -1.0, 0.25, 0, 0.1, 4.0, 0.01, 0.01, -1)<br />&nbsp; &nbsp; &nbsp; &nbsp; ShowSyncHudMsg(id, g_hudmsg1, &quot;^n^n^n^n Combo Terminado (%d)^nGanancia: %d AmmoPacks&quot;, g_combo[id], ganancia)<br />&nbsp; &nbsp; &nbsp; &nbsp; ColorChat(id, TEAM_COLOR, &quot;^x04[PJF Party]^x01 Combo Total:^x04 %d^x01 | Damage Total:^x04 %d^x01 | Hits Echos:^x04 %d^x01 | Ganancia:^x04 %d&quot;, g_combo[id], g_damage[id], g_Hits[id], ganancia)<br />&nbsp; &nbsp; &nbsp; &nbsp; za_set_user_experience(id, za_get_user_experience(id) + ganancia)<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; g_damage[id] = 0<br />&nbsp; &nbsp; g_Hits[id] = 0<br />&nbsp; &nbsp; g_combo[id] = 0<br />}<br />public reset_party_combo(i)<br />{<br />&nbsp; &nbsp; i -= TASK_COMBOP<br />&nbsp; &nbsp; static flags<br />&nbsp; &nbsp; flags = get_user_flags(i)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; static gananciap; gananciap = g_combop[i] * 4+((flags &amp; ADMIN_LEVEL_D ? 7: flags &amp; ADMIN_LEVEL_A ? 5: flags &amp; ADMIN_LEVEL_B ? 3 : 0))<br />&nbsp; &nbsp; if(g_PartyData[i][In_Party])<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; if(!zp_get_user_zombie(i))<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_hudmessage(120, 120, 120, -1.0, 0.25, 0, 0.1, 4.0, 0.01, 0.01, -1)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShowSyncHudMsg(i, g_hudmsg1, &quot;^n^n^n^n Combo Party Terminado (%d)^nGanancia: %d AmmoPacks&quot;, g_combop[i], gananciap)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ColorChat(i, TEAM_COLOR, &quot;^x04[PJF Party]^x01 Combo party Total:^x04 %d^x01 | Damage Total:^x04 %d^x01 | Hits Echos:^x04 %d^x01 | Ganancia:^x04 %d&quot;, g_combop[i], g_damagep[i], g_Hitsp[i], gananciap)<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; za_set_user_experience(i, za_get_user_experience(i) + gananciap)<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; g_damagep[i] = 0<br />&nbsp; &nbsp; g_Hitsp[i] = 0<br />&nbsp; &nbsp; g_combop[i] = 0<br />}<br /><br />public cmdParty(id) <br />{<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(g_PartyData[id][In_Party])<br />&nbsp; &nbsp; &nbsp; &nbsp; show_party_info_menu(id)<br />&nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; show_party_menu(id)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; return PLUGIN_HANDLED<br />}<br /><br />public show_party_menu(id) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new iMenu = menu_create(&quot;[PJF Party] - rMenu Party:&quot;,&quot;party_menu&quot;), BlockParty[50]<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_additem(iMenu, &quot;yCrear Party&quot;, &quot;0&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; formatex(BlockParty, charsmax(BlockParty), &quot;yBloquear Invitaciones De Party: w%s&quot;,g_PartyData[id][Block_Party] ? &quot;Si&quot; : &quot;No&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_additem(iMenu, BlockParty, &quot;1&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_setprop(iMenu, MPROP_EXITNAME, &quot;Salir&quot;)<br />&nbsp; &nbsp; menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_display(id, iMenu, 0)<br />}<br /><br />public show_party_info_menu(id) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new iMenu = menu_create(&quot;[PJF Party] - rMenu Party:&quot;,&quot;party_info_menu&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_additem(iMenu, &quot;Agregar Integrante&quot;, .callback = g_MenuCallback[MASTER])<br />&nbsp; &nbsp; menu_additem(iMenu, &quot;Expulsar Integrande&quot;, .callback = g_MenuCallback[MASTER])<br />&nbsp; &nbsp; menu_additem(iMenu, &quot;Destruir Party&quot;, .callback = g_MenuCallback[MASTER])<br />&nbsp; &nbsp; menu_additem(iMenu, &quot;Salir del Party&quot;, .callback = g_MenuCallback[USER])<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_setprop(iMenu, MPROP_EXITNAME, &quot;Salir&quot;)<br />&nbsp; &nbsp; menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_display(id, iMenu)<br />}<br /><br />public show_party_add_menu(id) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new iMenu = menu_create(g_PartyData[id][In_Party] ? &quot;rAgregar Integrante:&quot; : &quot;rCrear Party:&quot;, &quot;party_create_menu&quot;), Poss[3], Name[32]<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; for(new i = 1; i &lt;= g_maxplayers; i++) {<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; if(!is_available_to_party(i) || id == i)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; get_user_name(i, Name, charsmax(Name))<br />&nbsp; &nbsp; &nbsp; &nbsp; num_to_str(i, Poss, charsmax(Poss))<br />&nbsp; &nbsp; &nbsp; &nbsp; menu_additem(iMenu, Name, Poss)<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_setprop(iMenu, MPROP_EXITNAME, &quot;Salir&quot;)<br />&nbsp; &nbsp; menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_display(id, iMenu)<br />}<br /><br />public show_party_kick_menu(id) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new iMenu = menu_create(&quot;rKick Party Menu:&quot;,&quot;party_kick_menu&quot;), Players[32], Poss[3], user<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; get_party_index(id, Players)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; for(new i; i &lt; g_PartyData[id][Amount_In_Party]; i++) {<br />&nbsp; &nbsp; &nbsp; &nbsp; user = Players[i]<br />&nbsp; &nbsp; &nbsp; &nbsp; num_to_str(user, Poss, charsmax(Poss))<br />&nbsp; &nbsp; &nbsp; &nbsp; menu_additem(iMenu, g_PartyData[user][UserName], Poss)<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_setprop(iMenu, MPROP_EXITNAME, &quot;Salir&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_display(id, iMenu)<br />}<br /><br />public show_party_invite_menu(id2, MasterId) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new MenuTitle[128], iMenu, Str_MasterId[3]<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; set_player_party_name(MasterId)<br />&nbsp; &nbsp; set_player_party_name(id2)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; client_print(MasterId, print_chat, &quot;%s Solicitud enviada a %s&quot;, TAG, g_PartyData[id2][UserName])<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; formatex(MenuTitle, charsmax(MenuTitle), &quot;%s te mando una invitacion para %s Party&quot;, g_PartyData[MasterId][UserName], g_PartyData[MasterId][In_Party] ? &quot;unirte al&quot; : &quot;crear un&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new UserTaskArgs[3]<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; UserTaskArgs[0] = iMenu = menu_create( MenuTitle , &quot;party_invite_menu&quot;)<br />&nbsp; &nbsp; UserTaskArgs[1] = MasterId<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; num_to_str(MasterId, Str_MasterId, charsmax(Str_MasterId))<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_additem( iMenu , &quot;Aceptar&quot;, Str_MasterId)<br />&nbsp; &nbsp; menu_additem( iMenu , &quot;Rechazar&quot;, Str_MasterId)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(is_user_bot(id2) &amp;&amp; get_pcvar_num(cvar_allow_bots)) {<br />&nbsp; &nbsp; &nbsp; &nbsp; party_invite_menu(id2, iMenu, 0)<br />&nbsp; &nbsp; &nbsp; &nbsp; return<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_setprop(iMenu, MPROP_EXIT, MEXIT_NEVER)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_display(id2, iMenu)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; remove_task_acept(id2)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; set_task(get_pcvar_float(cvar_time_acept), &quot;Time_Acept&quot;, id2+TASK_ACEPT, UserTaskArgs, 2)<br />}<br />&nbsp; &nbsp; <br /><br />public party_menu(id, menu, item) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(item == MENU_EXIT) {<br />&nbsp; &nbsp; &nbsp; &nbsp; menu_destroy(menu)<br />&nbsp; &nbsp; &nbsp; &nbsp; return<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(item) {<br />&nbsp; &nbsp; &nbsp; &nbsp; g_PartyData[id][Block_Party] = g_PartyData[id][Block_Party] ? false : true<br />&nbsp; &nbsp; &nbsp; &nbsp; show_party_menu(id)<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; show_party_add_menu(id)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_destroy(menu)<br />&nbsp; &nbsp; <br />}<br /><br />public party_create_menu(id, menu, item) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(item == MENU_EXIT) {<br />&nbsp; &nbsp; &nbsp; &nbsp; menu_destroy(menu)<br />&nbsp; &nbsp; &nbsp; &nbsp; return<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new iKey[6], iAccess, iCallback, id2<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_item_getinfo(menu, item, iAccess, iKey, charsmax(iKey), _, _, iCallback)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; id2 = str_to_num(iKey)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(!is_available_to_party(id2))<br />&nbsp; &nbsp; &nbsp; &nbsp; return<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; show_party_invite_menu(id2, id)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_destroy(menu)<br />}<br /><br />public party_invite_menu(id, menu, item) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(item == MENU_EXIT) {<br />&nbsp; &nbsp; &nbsp; &nbsp; menu_destroy(menu)<br />&nbsp; &nbsp; &nbsp; &nbsp; remove_task_acept(id)<br />&nbsp; &nbsp; &nbsp; &nbsp; return<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new iKey[6], iAccess, iCallback, id_master<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_item_getinfo(menu, item, iAccess, iKey, charsmax(iKey), _, _, iCallback)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; id_master = str_to_num(iKey)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; switch(item) {<br />&nbsp; &nbsp; &nbsp; &nbsp; case 0: {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(!g_PartyData[id_master][In_Party]) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; create_party(id_master, id)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_task_party_hud(id_master)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_task_party_hud(id)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(g_PartyData[id_master][Amount_In_Party] == get_pcvar_num(cvar_max_players)) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; client_print(id, print_chat, &quot;%s Ya se alcanzo el numero maximo de integrantes en la party&quot;, TAG)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; client_print(id_master, print_chat, &quot;%s Ya alcanzaste el numero maximo de integrantes en la party&quot;, TAG)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; remove_task_acept(id)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; menu_destroy(menu)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; add_party_user(id_master, id)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_task_party_hud(id)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; client_print(id_master, print_chat, &quot;%s %s fue agregado al Party&quot;, TAG, g_PartyData[id][UserName])<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; case 1: client_print(id_master, print_chat, &quot;%s %s cancelo la invitacion de Party&quot;, TAG, g_PartyData[id][UserName])<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; remove_task_acept(id)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_destroy(menu)<br />}<br /><br />public party_kick_menu(id, menu, item) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(item == MENU_EXIT) {<br />&nbsp; &nbsp; &nbsp; &nbsp; menu_destroy(menu)<br />&nbsp; &nbsp; &nbsp; &nbsp; return<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new iKey[6], iAccess, iCallback, id2<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_item_getinfo(menu, item, iAccess, iKey, charsmax(iKey), _, _, iCallback)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; id2 = str_to_num(iKey)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(is_user_connected(id2))<br />&nbsp; &nbsp; &nbsp; &nbsp; g_PartyData[id][Amount_In_Party] == 2 ? destoy_party(id) : remove_party_user(id2)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_destroy(menu)<br />}<br /><br />public party_info_menu(id, menu,item) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(item == MENU_EXIT) {<br />&nbsp; &nbsp; &nbsp; &nbsp; menu_destroy(menu)<br />&nbsp; &nbsp; &nbsp; &nbsp; return<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; switch(item) {<br />&nbsp; &nbsp; &nbsp; &nbsp; case 0: {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(g_PartyData[id][Amount_In_Party] &lt; get_pcvar_num(cvar_max_players))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; show_party_add_menu(id)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; client_print(id, print_chat, &quot;%s Ya alcanzaste el numero maximo de integrantes en la party&quot;, TAG)<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; case 1: show_party_kick_menu(id)<br />&nbsp; &nbsp; &nbsp; &nbsp; case 2: destoy_party(id)<br />&nbsp; &nbsp; &nbsp; &nbsp; case 3: remove_party_user(id)<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; menu_destroy(menu)<br />}<br /><br />public PartyHud(taskid) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; static id<br />&nbsp; &nbsp; id = ID_HUD<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(!is_user_connected(id)) {<br />&nbsp; &nbsp; &nbsp; &nbsp; remove_task(taskid)<br />&nbsp; &nbsp; &nbsp; &nbsp; return<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; static CountParty, PartyMsg[256], Players[32], id2<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; CountParty = 0<br />&nbsp; &nbsp; PartyMsg[0] = 0<br /><br />&nbsp; &nbsp; get_party_index(id, Players)<br />&nbsp; &nbsp; for(new i; i &lt; g_PartyData[id][Amount_In_Party]; i++) {<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; id2 = Players[i]<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; if(CountParty)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; add(PartyMsg, charsmax(PartyMsg), &quot;^n&quot;)<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; format(PartyMsg, charsmax(PartyMsg), &quot;%s%s&quot;, strlen(PartyMsg) ? PartyMsg : &quot;^t^t^t[PJF Party] PARTY^n&quot;, g_PartyData[id2][UserName])<br />&nbsp; &nbsp; &nbsp; &nbsp; CountParty++<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; set_hudmessage(255, 255, 255, 0.6, 0.7, 0, 6.0, 1.0);<br />&nbsp; &nbsp; show_hudmessage(id, PartyMsg)<br />}<br /><br />public Time_Acept(UserTaskArgs[], taskid) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; taskid -= TASK_ACEPT;<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(!g_PartyData[taskid][In_Party]) {<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; client_print(UserTaskArgs[1], print_chat, &quot;%s %s cancelo la invitacion de party&quot;, TAG, g_PartyData[taskid][UserName])<br />&nbsp; &nbsp; &nbsp; &nbsp; menu_destroy(UserTaskArgs[0])<br />&nbsp; &nbsp; &nbsp; &nbsp; show_menu(taskid, 0, &quot;^n&quot;, 1)<br />&nbsp; &nbsp; }<br />}<br /><br />stock create_party(master, guest) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; set_party_member(master, master)<br />&nbsp; &nbsp; set_party_member(master, guest)<br />&nbsp; &nbsp; set_party_member(guest, master)<br />&nbsp; &nbsp; set_party_member(guest, guest)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; set_party_vars(master, Start_Amount)<br />&nbsp; &nbsp; set_party_vars(guest, ++g_PartyData[master][Amount_In_Party])<br />}<br /><br />stock add_party_user(master, guest) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new Players[32], member, amount = g_PartyData[master][Amount_In_Party]<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; get_party_index(master, Players)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; for(new i; i &lt; amount; i++) {<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; member = Players[i]<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; set_party_member(guest, member)<br />&nbsp; &nbsp; &nbsp; &nbsp; set_party_member(member, guest)<br />&nbsp; &nbsp; &nbsp; &nbsp; g_PartyData[member][Amount_In_Party]++<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; set_party_member(guest, guest)<br />&nbsp; &nbsp; set_party_vars(guest, amount+1)&nbsp; &nbsp; <br />}<br /><br />stock set_party_member(id, id2)<br />&nbsp; &nbsp; ArrayPushCell(Party_Ids[id], id2)<br /><br />stock set_party_vars(id, amount) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; g_PartyData[id][In_Party] = true<br />&nbsp; &nbsp; g_PartyData[id][Position] = amount-1<br />&nbsp; &nbsp; g_PartyData[id][Amount_In_Party] = amount<br />&nbsp; &nbsp; <br />}<br /><br />stock destoy_party(id) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new Players[32], id2, Amount = g_PartyData[id][Amount_In_Party]<br />&nbsp; &nbsp; get_party_index(id, Players)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; for(new i; i &lt; Amount; i++) {<br />&nbsp; &nbsp; &nbsp; &nbsp; id2 = Players[i]<br />&nbsp; &nbsp; &nbsp; &nbsp; clear_party_user(id2)<br />&nbsp; &nbsp; &nbsp; &nbsp; client_print(id2, print_chat, &quot;%s La party fue destruida&quot;, TAG)<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; }<br />}<br /><br />stock remove_party_user(user) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; new Players[32], id, Amount = g_PartyData[user][Amount_In_Party]<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; get_party_index(user, Players)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; clear_party_user(user)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; for(new i; i &lt; Amount; i++) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; id = Players[i]<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; if(id != user) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ArrayClear(Party_Ids[id])<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for(new z; z &lt; Amount; z++)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(Players[z] != user)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_party_member(id, Players[z])<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; g_PartyData[id][Position] = i<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; g_PartyData[id][Amount_In_Party] = Amount-1<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; client_print(id, print_chat, &quot;%s %s salio del party&quot;, TAG, g_PartyData[user][UserName])<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }<br />}<br /><br />stock clear_party_user(id) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; ArrayClear(Party_Ids[id])<br />&nbsp; &nbsp; g_PartyData[id][In_Party] = false<br />&nbsp; &nbsp; g_PartyData[id][Position] = NONE<br />&nbsp; &nbsp; g_PartyData[id][Amount_In_Party] = NONE<br />&nbsp; &nbsp; remove_task_party_hud(id)<br />&nbsp; &nbsp; <br />}<br /><br />stock set_task_party_hud(id)<br />&nbsp; &nbsp; set_task(1.0, &quot;PartyHud&quot;, id+TASK_HUD, _, _, &quot;b&quot;)<br />&nbsp; &nbsp; <br />stock remove_task_party_hud(id)<br />&nbsp; &nbsp; remove_task(id+TASK_HUD)<br /><br />stock remove_task_acept(id)<br />&nbsp; &nbsp; if(task_exists(id+TASK_ACEPT))<br />&nbsp; &nbsp; &nbsp; &nbsp; remove_task(id+TASK_ACEPT)<br />&nbsp; &nbsp; <br /><br />stock set_player_party_name(id) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(g_PartyData[id][UserName][0])<br />&nbsp; &nbsp; &nbsp; &nbsp; return 0<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; get_user_name(id, g_PartyData[id][UserName], charsmax(g_PartyData[][UserName]))<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; return 1<br />}<br /><br />stock is_available_to_party(id) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(!is_user_connected(id) || g_PartyData[id][In_Party] || g_PartyData[id][Block_Party])<br />&nbsp; &nbsp; &nbsp; &nbsp; return false<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; return true<br />}&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <br />stock get_party_index(id, players[]) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; for(new i; i &lt; g_PartyData[id][Amount_In_Party]; i++)<br />&nbsp; &nbsp; &nbsp; &nbsp; players[i] = ArrayGetCell(Party_Ids[id], i)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; return players[0] ? 1 : 0<br />}<br /><br />public check_master(id)<br />&nbsp; &nbsp; return g_PartyData[id][Position] ? ITEM_DISABLED : ITEM_ENABLED<br />&nbsp; &nbsp; <br />public check_user(id)<br />&nbsp; &nbsp; return g_PartyData[id][Position] ? ITEM_ENABLED : ITEM_DISABLED<br /><br />public cmdSayTeam(id) {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; static Text[192]<br />&nbsp; &nbsp; read_args(Text, charsmax(Text))<br />&nbsp; &nbsp; remove_quotes(Text)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; replace_all(Text, charsmax(Text), &quot;%&quot;, &quot;&quot;)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(!ValidMessage(Text) || !g_PartyData[id][In_Party]) {<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; client_print(id, print_chat,&quot;%s Tu Mensaje es invalido o no te encuentras en un Party&quot;, TAG)<br />&nbsp; &nbsp; &nbsp; &nbsp; return PLUGIN_HANDLED;<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; static Message[192], Players[32], id2, Amount <br />&nbsp; &nbsp; Amount = g_PartyData[id][Amount_In_Party]<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; get_party_index(id, Players)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; formatex(Message, charsmax(Message), &quot;^x04%s ^x03%s^x01 : %s&quot;, TAG, g_PartyData[id][UserName], Text)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; for(new i; i &lt; Amount; i++) {<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; id2 = Players[i]<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; message_begin(MSG_ONE_UNRELIABLE, g_MsgSayText, _, id2)<br />&nbsp; &nbsp; &nbsp; &nbsp; write_byte(id)<br />&nbsp; &nbsp; &nbsp; &nbsp; write_string(Message)<br />&nbsp; &nbsp; &nbsp; &nbsp; message_end()<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; return PLUGIN_HANDLED;<br />}<br /><br />ValidMessage(text[]) {<br />&nbsp; &nbsp; static len, i<br />&nbsp; &nbsp; len = strlen(text)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if(!len)<br />&nbsp; &nbsp; &nbsp; &nbsp; return false<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; for(i = 0; i &lt; len; i++) {<br />&nbsp; &nbsp; &nbsp; &nbsp; if( text[i] != ' ' ) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return true<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }<br /><br />&nbsp; &nbsp; return false<br />}</code><hr />
</div><br />I'm sure they operate if they use the Zombie Apocalypse 4.3 Raulitop<br />I use that Zombie and Anda me 100% error-free</div>

Wyświetl pełny artykuł




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych