Mensajes: 454
Temas: 95
Registro en: May 2015
Reputación:
8
Código PHP: public Finish_Combo_Party(taskid) { static id; id = ID_COMBOPARTY; new i for (i = 0; i < sizeof(gComboInfo)-1; i++) { if (gComboInfo[i][gCombos] > gCombo[id]) break; } static szBono; szBono = gCombo[id] * gComboInfo[i][gMulti]
set_hudmessage(255, 255, 255, 0.45, 0.27, 0, 1.5, 1.5, 1.0, 1.0) ShowSyncHudMsg(id, gCombopHud, "Combo de party finalizado (%s)^nRendimiento de %s^nTotal %s AmmoPacks^n",Add_Point(gCombo[id]), Add_Point(gCombo[id] * 2), Add_Point(szBono)) gComboDamage[id] = 0 gHits[id] = 0 gCombo[id] = 0 g_iAmmoPacks[id] += szBono
UpdateLevel(id) }
alguien me puede dar una mano? al terminar el combo del party, las ganancias no se dividen, solo gana quien hace el combo
Mensajes: 395
Temas: 48
Registro en: Oct 2018
Reputación:
6
24/10/2022, 11:41 PM
(Última modificación: 24/10/2022, 11:46 PM por [E]manuelitop15. Edited 1 time in total.)
Mostra donde ejecutas esta funcion, ya que deberias tener un for o un while donde le envie el task a todos los miembros cuando alguno de este party acabe de combear.
Algo asi me imagino yo que deberias tener...
Código PHP: public funcion_donde_termina_de_combear(id) { for (new miembros = 1; miembros < 33; miembros++) { if (g_party[miembros] == g_party[id]) { remove_task(TASK_COMBOPARTY); set_task(0.2, "Finish_Combo_Party", miembros); } } }
public Finish_Combo_Party(taskid) { static miembro; miembro = ID_COMBOPARTY;
new i;
for (i = 0; i < sizeof(gComboInfo)-1; i++) if (gComboInfo[i][gCombos] > gCombo[miembro]) break;
// Y si queres dividir la ganancia de verdad > szBono = (gCombo[miembro] * gComboInfo[i][gMulti]) / total_de_miembros static szBono; szBono = gCombo[miembro] * gComboInfo[i][gMulti];
set_hudmessage(255, 255, 255, 0.45, 0.27, 0, 1.5, 1.5, 1.0, 1.0) ShowSyncHudMsg(miembro, gCombopHud, "Combo de party finalizado (%s)^nRendimiento de %s^nTotal %s AmmoPacks^n",Add_Point(gCombo[miembro]), Add_Point(gCombo[miembro] * 2), Add_Point(szBono))
gComboDamage[miembro] = 0; gHits[miembro] = 0; gCombo[miembro] = 0; g_iAmmoPacks[miembro] += szBono;
UpdateLevel(miembro); }
___________________________________
SI NECESITAS UN PLUGIN TE LO HAGO $$$
COMUNICATE A MI DISCORD: emanuelitop15
Mensajes: 454
Temas: 95
Registro en: May 2015
Reputación:
8
25/10/2022, 05:40 PM
(Última modificación: 25/10/2022, 05:40 PM por Blackk. Edited 1 time in total.)
(24/10/2022, 11:41 PM)[E]manuelitop15 escribió: Mostra donde ejecutas esta funcion, ya que deberias tener un for o un while donde le envie el task a todos los miembros cuando alguno de este party acabe de combear.
Algo asi me imagino yo que deberias tener...
Código PHP: public funcion_donde_termina_de_combear(id) { for (new miembros = 1; miembros < 33; miembros++) { if (g_party[miembros] == g_party[id]) { remove_task(TASK_COMBOPARTY); set_task(0.2, "Finish_Combo_Party", miembros); } } }
public Finish_Combo_Party(taskid) { static miembro; miembro = ID_COMBOPARTY;
new i;
for (i = 0; i < sizeof(gComboInfo)-1; i++) if (gComboInfo[i][gCombos] > gCombo[miembro]) break;
// Y si queres dividir la ganancia de verdad > szBono = (gCombo[miembro] * gComboInfo[i][gMulti]) / total_de_miembros static szBono; szBono = gCombo[miembro] * gComboInfo[i][gMulti];
set_hudmessage(255, 255, 255, 0.45, 0.27, 0, 1.5, 1.5, 1.0, 1.0) ShowSyncHudMsg(miembro, gCombopHud, "Combo de party finalizado (%s)^nRendimiento de %s^nTotal %s AmmoPacks^n",Add_Point(gCombo[miembro]), Add_Point(gCombo[miembro] * 2), Add_Point(szBono))
gComboDamage[miembro] = 0; gHits[miembro] = 0; gCombo[miembro] = 0; g_iAmmoPacks[miembro] += szBono;
UpdateLevel(miembro); }
Código PHP: for(new i; i < g_PartyData[attacker][Amount_In_Party]; i++) { user = Players[i] while (gDamageDealt[attacker] >= szDamage) { gCombo[user]+= szReward g_iAmmoPacks[user]++ gDamageDealt[attacker] -= szDamage gHits[user]++ } set_task(5.0, "Finish_Combo_Party", user) return HAM_IGNORED; }
algo asi??, probe como me dijiste y nada..
Mensajes: 130
Temas: 56
Registro en: Mar 2021
Reputación:
0
26/12/2022, 12:56 PM
(Última modificación: 26/12/2022, 03:24 PM por aramayo123. Edited 1 time in total.)
(24/10/2022, 02:48 AM)Blackk escribió: Código PHP: public Finish_Combo_Party(taskid) { static id; id = ID_COMBOPARTY; new i for (i = 0; i < sizeof(gComboInfo)-1; i++) { if (gComboInfo[i][gCombos] > gCombo[id]) break; } static szBono; szBono = gCombo[id] * gComboInfo[i][gMulti]
set_hudmessage(255, 255, 255, 0.45, 0.27, 0, 1.5, 1.5, 1.0, 1.0) ShowSyncHudMsg(id, gCombopHud, "Combo de party finalizado (%s)^nRendimiento de %s^nTotal %s AmmoPacks^n",Add_Point(gCombo[id]), Add_Point(gCombo[id] * 2), Add_Point(szBono)) gComboDamage[id] = 0 gHits[id] = 0 gCombo[id] = 0 g_iAmmoPacks[id] += szBono
UpdateLevel(id) }
alguien me puede dar una mano? al terminar el combo del party, las ganancias no se dividen, solo gana quien hace el combo Si estas usando party de rak con esto deberia ser suficiente
Código PHP: static szBono; szBono = gCombo[id] * gComboInfo[i][gMulti]/g_PartyData[taskid][Amount_In_Party]
Mensajes: 454
Temas: 95
Registro en: May 2015
Reputación:
8
Mensajes: 56
Temas: 6
Registro en: Dec 2018
Reputación:
2
Muestra el código completo de los combos (lo relacio al party), como lo incias, lo mostras y lo terminas.
Mensajes: 454
Temas: 95
Registro en: May 2015
Reputación:
8
(26/12/2022, 12:56 PM)aramayo123 escribió: Si estas usando party de rak con esto deberia ser suficiente
Código PHP: static szBono; szBono = gCombo[id] * gComboInfo[i][gMulti]/g_PartyData[taskid][Amount_In_Party]
(22/05/2023, 07:14 PM)SVC escribió: Muestra el código completo de los combos (lo relacio al party), como lo incias, lo mostras y lo terminas.
el problema es al dividir la exp
Mensajes: 56
Temas: 6
Registro en: Dec 2018
Reputación:
2
23/05/2023, 05:21 PM
(Última modificación: 23/05/2023, 05:21 PM por SVC. Edited 1 time in total.)
(23/05/2023, 12:43 PM)Blackk escribió: el problema es al dividir la exp
Bueno en ese caso (ya que no conozco la rutina completa....), debuguea esta funcion Finish_Combo_Party:
Código PHP: public Finish_Combo_Party(taskid) { static miembro; miembro = ID_COMBOPARTY; log_amx("Finish_Combo_Party() for 'miembro-id' %d", miembro)
new i;
for (i = 0; i < sizeof(gComboInfo)-1; i++) if (gComboInfo[i][gCombos] > gCombo[miembro]) break;
// Y si queres dividir la ganancia de verdad > szBono = (gCombo[miembro] * gComboInfo[i][gMulti]) / total_de_miembros static szBono; szBono = gCombo[miembro] * gComboInfo[i][gMulti];
set_hudmessage(255, 255, 255, 0.45, 0.27, 0, 1.5, 1.5, 1.0, 1.0) ShowSyncHudMsg(miembro, gCombopHud, "Combo de party finalizado (%s)^nRendimiento de %s^nTotal %s AmmoPacks^n",Add_Point(gCombo[miembro]), Add_Point(gCombo[miembro] * 2), Add_Point(szBono))
gComboDamage[miembro] = 0; gHits[miembro] = 0; gCombo[miembro] = 0; g_iAmmoPacks[miembro] += szBono;
UpdateLevel(miembro); }
Y verifica que, se te este mostrando ese LOG a los jugadores en la party, una vez finalizado el combo
Mensajes: 454
Temas: 95
Registro en: May 2015
Reputación:
8
23/05/2023, 07:13 PM
(Última modificación: 23/05/2023, 07:17 PM por Blackk. Edited 1 time in total.)
bien ahora agarra, el tema es que me muestra las ganancias y total de ammopacks en 0 cuando finalizo el combo, pero la exp la divide
osea el hud sale primero y atrás sale otro diciendo q gane 0, como q se repite el msghud
Mensajes: 56
Temas: 6
Registro en: Dec 2018
Reputación:
2
Cambia este HUD:
Código PHP: ShowSyncHudMsg(miembro, gCombopHud, "Combo de party finalizado (%s)^nRendimiento de %s^nTotal %s AmmoPacks^n",Add_Point(gCombo[miembro]), Add_Point(gCombo[miembro] * 2), Add_Point(szBono))
>>>>>
Muestralo asi y verificas si es la funcion Add_Point():
Código PHP: ShowSyncHudMsg(miembro, gCombopHud, "Combo de party finalizado (%d)^nRendimiento de %d^nTotal %d AmmoPacks^n",gCombo[miembro], gCombo[miembro] * 2, szBono)
Más no veo que este mal, pero como no veo todo el codigo del combo, no puedo saber si es desde otra parte que este teniendo ese problema...
Mensajes: 454
Temas: 95
Registro en: May 2015
Reputación:
8
23/05/2023, 08:38 PM
(Última modificación: 23/05/2023, 08:57 PM por Blackk. Edited 1 time in total.)
(23/05/2023, 08:14 PM)SVC escribió: Cambia este HUD:
Código PHP: ShowSyncHudMsg(miembro, gCombopHud, "Combo de party finalizado (%s)^nRendimiento de %s^nTotal %s AmmoPacks^n",Add_Point(gCombo[miembro]), Add_Point(gCombo[miembro] * 2), Add_Point(szBono))
>>>>>
Muestralo asi y verificas si es la funcion Add_Point():
Código PHP: ShowSyncHudMsg(miembro, gCombopHud, "Combo de party finalizado (%d)^nRendimiento de %d^nTotal %d AmmoPacks^n",gCombo[miembro], gCombo[miembro] * 2, szBono)
Más no veo que este mal, pero como no veo todo el codigo del combo, no puedo saber si es desde otra parte que este teniendo ese problema...
sigue igual, te paso el code de takedamage
Código PHP: if (!g_PartyData[attacker][In_Party]) { static szReward, szFlags; szFlags = get_user_flags(attacker) if (szFlags & STAFF) szReward = 3 else if (szFlags & ADMIN) szReward = 3 else if (szFlags & VIP_FULL) szReward = 2 else szReward = 1 * gGananciaAdmingratis[attacker] gDamageDealt[attacker] += floatround(damage) gComboDamage[attacker] += floatround(damage) gHits[attacker]++ UpdateLevel(attacker) remove_task(attacker+TASK_COMBO) g_iAmmoPacks[attacker] = clamp(g_iAmmoPacks[attacker], 5, 74536200) static szDamage; if(get_user_weapon(attacker) == CSW_DEAGLE && gDeagle[attacker]) szDamage = 250 * 60 else if(get_user_weapon(attacker) == CSW_AWP && gM200[attacker]) szDamage = 250 * 70 else if(gLevel[attacker][1] > 20) szDamage = 105 * 20 else szDamage = 100 * gLevel[attacker][1] + 2 while (gDamageDealt[attacker] >= szDamage) { gCombo[attacker]+= szReward + gLevel[attacker][1] + 1 + Ammount_Combaso(gMejorasT[attacker][1][1]) g_iAmmoPacks[attacker]++ gDamageDealt[attacker] -= szDamage } new szComboDamage[10], szComboDamage2[10] acortar(floatround(damage), szComboDamage, 9) acortar2(gComboDamage[attacker], szComboDamage2, 9) for (new i; i < sizeof(gComboInfo) - 1; i++) { if (gCombo[attacker] >= gComboInfo[i][gCombos]) { set_hudmessage(gComboInfo[i][Rojo], gComboInfo[i][Verde], gComboInfo[i][Azul], gPosicionCombo2[attacker], gPosicionCombo[attacker], 0, 1.5, 1.5, 1.0, 1.0) ShowSyncHudMsg(attacker, gComboHud, "Combo %s AmmoPacks^n%s %d hits %s de Daño^nhit %s de Daño" ,Add_Point(gCombo[attacker]),gComboInfo[i][gMessage], gHits[attacker], szComboDamage2, szComboDamage) } } if(gMejorasT[attacker][1][1]) set_task(5.0, "Finish_Combo", attacker+TASK_COMBO) else set_task(4.0, "Finish_Combo", attacker+TASK_COMBO) return HAM_IGNORED; } else if (g_PartyData[attacker][In_Party]){ new Players[32], Users get_party_index(attacker, Players)
for (new i; i < g_PartyData[attacker][Amount_In_Party]; i++) { Users = Players[i]
gDamageDealt[attacker] += floatround(damage) gComboDamage[Users] += floatround(damage)
remove_task(Users+TASK_COMBO_PARTY) g_iAmmoPacks[attacker] = clamp(g_iAmmoPacks[attacker], 5, 74536200) UpdateLevel(Users) static szReward, szFlags; szFlags = get_user_flags(attacker) if (szFlags & STAFF) szReward = 3 else if (szFlags & ADMIN) szReward = 3 else if (szFlags & VIP_FULL) szReward = 2 else szReward = 1 * gGananciaAdmingratis[attacker] static szDamage; if(get_user_weapon(attacker) == CSW_DEAGLE && gDeagle[attacker]) szDamage = 250 * 60 else if(get_user_weapon(attacker) == CSW_AWP && gM200[attacker]) szDamage = 250 * 70 else if(gLevel[attacker][1] > 20) szDamage = 105 * 20 else szDamage = 100 * gLevel[attacker][1] + 2 new szComboDamage[10], szComboDamage2[10] acortar2(gComboDamage[Users], szComboDamage2, 9) new szComboPDamage[10] acortar2(floatround(damage), szComboPDamage, 9) while (gDamageDealt[attacker] >= szDamage) { gCombo[Users]+= szReward + gLevel[attacker][1] + 1 + Ammount_Combaso(gMejorasT[attacker][1][1]) g_iAmmoPacks[attacker]++ gDamageDealt[attacker] -= szDamage } for (new i; i < sizeof(gComboInfo); i++) { if (gCombo[Users] >= gComboInfo[i][gCombos]) { set_hudmessage(gComboInfo[i][Rojo], gComboInfo[i][Verde], gComboInfo[i][Azul], gPosicionCombo2[attacker], gPosicionCombo[attacker], 0, 1.5, 1.5, 1.0, 1.0) ShowSyncHudMsg(Users, gCombopHud, " [PARTY] ^nCombo %s AmmoPacks^n%s %s de Daño^nhit %s de Daño",Add_Point(gCombo[Users]),gComboInfo[i][gMessage], szComboDamage2, szComboPDamage)
} set_task(5.0, "Finish_Combo_Party", Users+TASK_COMBO_PARTY) } } } return HAM_IGNORED }
al cambiarlo así
Código PHP: Color(miembro, "!g%s!y Combo de party finalizado (%s) |Rendimiento de %s Total %s AmmoPacks ",g_szModPrefix, Add_Point(gCombo[miembro]), Add_Point(gCombo[miembro] * 2), Add_Point(szBono))
en consola me salta lo siguiente
Código PHP: [ZT] Combo de party finalizado (2.028) Rendimiento de 4.056 Total 3.042 AmmoPacks [ZT] Combo de party finalizado (0) Rendimiento de 0 Total 0 AmmoPacks [ZT] Combo de party finalizado (0) Rendimiento de 0 Total 0 AmmoPacks [ZT] Combo de party finalizado (0) Rendimiento de 0 Total 0 AmmoPacks [ZT] Combo de party finalizado (0) Rendimiento de 0 Total 0 AmmoPacks [ZT] Combo de party finalizado (0) Rendimiento de 0 Total 0 AmmoPacks [ZT] Combo de party finalizado (0) Rendimiento de 0 Total 0 AmmoPacks [ZT] Combo de party finalizado (0) Rendimiento de 0 Total 0 AmmoPacks [ZT] Combo de party finalizado (0) Rendimiento de 0 Total 0 AmmoPacks [ZT] Combo de party finalizado (0) Rendimiento de 0 Total 0 AmmoPacks
Mensajes: 56
Temas: 6
Registro en: Dec 2018
Reputación:
2
23/05/2023, 09:00 PM
(Última modificación: 23/05/2023, 09:00 PM por SVC.)
A simple vista no veo nada malo con el codigo...
Cuando estas en PARTY, este HUD
Código PHP: ShowSyncHudMsg(Users, gCombopHud, " [PARTY] ^nCombo %s AmmoPacks^n%s %s de Daño^nhit %s de Daño",Add_Point(gCombo[Users]),gComboInfo[i][gMessage], szComboDamage2, szComboPDamage)
Se muestra correctamente?
Es decir, a todos los miembros le muestra lo mismo?
Por otro lado, puedes seguir debugeando la funcion Finish_Combo_Party mostrando qué valores tienen gCombo y demaces para cerciorar que al llamarse siguen teniendo los valores
Mensajes: 454
Temas: 95
Registro en: May 2015
Reputación:
8
23/05/2023, 09:06 PM
(Última modificación: 23/05/2023, 09:16 PM por Blackk. Edited 1 time in total.)
(23/05/2023, 09:00 PM)SVC escribió: A simple vista no veo nada malo con el codigo...
Cuando estas en PARTY, este HUD
Código PHP: ShowSyncHudMsg(Users, gCombopHud, " [PARTY] ^nCombo %s AmmoPacks^n%s %s de Daño^nhit %s de Daño",Add_Point(gCombo[Users]),gComboInfo[i][gMessage], szComboDamage2, szComboPDamage)
Se muestra correctamente?
Es decir, a todos los miembros le muestra lo mismo?
Por otro lado, puedes seguir debugeando la funcion Finish_Combo_Party mostrando qué valores tienen gCombo y demaces para cerciorar que al llamarse siguen teniendo los valores
deje al bot combeando y me salio lo mismo, asique si, le muestra a todos lo mismo
https://ibb.co/nj3tRFD
Mensajes: 56
Temas: 6
Registro en: Dec 2018
Reputación:
2
24/05/2023, 12:20 AM
(Última modificación: 24/05/2023, 12:20 AM por SVC.)
Código PHP: if (!g_PartyData[attacker][In_Party]) { static szReward, szFlags; szFlags = get_user_flags(attacker) if (szFlags & STAFF) szReward = 3 else if (szFlags & ADMIN) szReward = 3 else if (szFlags & VIP_FULL) szReward = 2 else szReward = 1 * gGananciaAdmingratis[attacker] gDamageDealt[attacker] += floatround(damage) gComboDamage[attacker] += floatround(damage) gHits[attacker]++ UpdateLevel(attacker) remove_task(attacker+TASK_COMBO) g_iAmmoPacks[attacker] = clamp(g_iAmmoPacks[attacker], 5, 74536200) static szDamage; if(get_user_weapon(attacker) == CSW_DEAGLE && gDeagle[attacker]) szDamage = 250 * 60 else if(get_user_weapon(attacker) == CSW_AWP && gM200[attacker]) szDamage = 250 * 70 else if(gLevel[attacker][1] > 20) szDamage = 105 * 20 else szDamage = 100 * gLevel[attacker][1] + 2 while (gDamageDealt[attacker] >= szDamage) { gCombo[attacker]+= szReward + gLevel[attacker][1] + 1 + Ammount_Combaso(gMejorasT[attacker][1][1]) g_iAmmoPacks[attacker]++ gDamageDealt[attacker] -= szDamage } new szComboDamage[10], szComboDamage2[10] acortar(floatround(damage), szComboDamage, 9) acortar2(gComboDamage[attacker], szComboDamage2, 9) for (new i; i < sizeof(gComboInfo) - 1; i++) { if (gCombo[attacker] >= gComboInfo[i][gCombos]) { set_hudmessage(gComboInfo[i][Rojo], gComboInfo[i][Verde], gComboInfo[i][Azul], gPosicionCombo2[attacker], gPosicionCombo[attacker], 0, 1.5, 1.5, 1.0, 1.0) ShowSyncHudMsg(attacker, gComboHud, "Combo %s AmmoPacks^n%s %d hits %s de Daño^nhit %s de Daño" ,Add_Point(gCombo[attacker]),gComboInfo[i][gMessage], gHits[attacker], szComboDamage2, szComboDamage) } } if(gMejorasT[attacker][1][1]) set_task(5.0, "Finish_Combo", attacker+TASK_COMBO) else set_task(4.0, "Finish_Combo", attacker+TASK_COMBO) return HAM_IGNORED; } else if (g_PartyData[attacker][In_Party]){ new Players[32], Users get_party_index(attacker, Players)
for (new i; i < g_PartyData[attacker][Amount_In_Party]; i++) { Users = Players[i]
gDamageDealt[attacker] += floatround(damage) gComboDamage[Users] += floatround(damage)
remove_task(Users+TASK_COMBO_PARTY) g_iAmmoPacks[attacker] = clamp(g_iAmmoPacks[attacker], 5, 74536200) UpdateLevel(Users) static szReward, szFlags; szFlags = get_user_flags(attacker) if (szFlags & STAFF) szReward = 3 else if (szFlags & ADMIN) szReward = 3 else if (szFlags & VIP_FULL) szReward = 2 else szReward = 1 * gGananciaAdmingratis[attacker] static szDamage; if(get_user_weapon(attacker) == CSW_DEAGLE && gDeagle[attacker]) szDamage = 250 * 60 else if(get_user_weapon(attacker) == CSW_AWP && gM200[attacker]) szDamage = 250 * 70 else if(gLevel[attacker][1] > 20) szDamage = 105 * 20 else szDamage = 100 * gLevel[attacker][1] + 2 new szComboDamage[10], szComboDamage2[10] acortar2(gComboDamage[Users], szComboDamage2, 9) new szComboPDamage[10] acortar2(floatround(damage), szComboPDamage, 9) while (gDamageDealt[attacker] >= szDamage) { gCombo[Users]+= szReward + gLevel[attacker][1] + 1 + Ammount_Combaso(gMejorasT[attacker][1][1]) g_iAmmoPacks[attacker]++ gDamageDealt[attacker] -= szDamage } for (new i; i < sizeof(gComboInfo); i++) { if (gCombo[Users] >= gComboInfo[i][gCombos]) { set_hudmessage(gComboInfo[i][Rojo], gComboInfo[i][Verde], gComboInfo[i][Azul], gPosicionCombo2[attacker], gPosicionCombo[attacker], 0, 1.5, 1.5, 1.0, 1.0) ShowSyncHudMsg(Users, gCombopHud, " [PARTY] ^nCombo %s AmmoPacks^n%s %s de Daño^nhit %s de Daño",Add_Point(gCombo[Users]),gComboInfo[i][gMessage], szComboDamage2, szComboPDamage)
} remove_task(Users+TASK_COMBO_PARTY) // checa set_task(5.0, "Finish_Combo_Party", Users+TASK_COMBO_PARTY) } } } return HAM_IGNORED }
Mensajes: 454
Temas: 95
Registro en: May 2015
Reputación:
8
Mensajes: 56
Temas: 6
Registro en: Dec 2018
Reputación:
2
(24/05/2023, 01:45 AM)Blackk escribió: lmao, gracias xdDDdd
Estoy desde el tlf
La parte del combo para un jugador sin party también necesita que hagas lo mismo.
|