TOP PLAYERS POR KILLS BUG
#4

Te sugiero que revises el scrip, ya que podrias producir un overflow al utilizar "OnPlayerInfo" con un tamaсo de 11 celdas en su 1є dimencion cuando puedes necesitar 500 (excepto que tu servidor sea de 10 jugadores). їA quй me refiero? Definiste OnPlayerInfo de la siguiente forma:
pawn Код:
new OnPlayerInfo[MEJORES_PLAYERS+1][oInfo];
їQuй pasaria si el jugador con el id 100 mata al id 55?
El callback "OnPlayerDeath" seria llamado de la siguiente forma:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    OnPlayerInfo[killerid][oKills] ++;//Overflow, tamaсo maximo 10, pero killerid es 100.
    OnPlayerInfo[playerid][oDeaths] ++;//Overflow, tamaсo maximo 10, pero playerid es 55.
    return 1:
}
Y para detectar los mejores, te sugiero utilizar el algoritmo "QuickSort" o en su defecto "BubleSort".
Reply


Messages In This Thread
TOP PLAYERS POR KILLS BUG - by Parka - 08.08.2012, 06:15
Respuesta: TOP PLAYERS POR KILLS BUG - by Bu11Sh0t - 08.08.2012, 06:58
Respuesta: TOP PLAYERS POR KILLS BUG - by Parka - 08.08.2012, 21:50
Respuesta: TOP PLAYERS POR KILLS BUG - by TheChaoz - 08.08.2012, 23:45
Respuesta: TOP PLAYERS POR KILLS BUG - by OTACON - 09.08.2012, 08:12

Forum Jump:


Users browsing this thread: 1 Guest(s)