SetPlayerBounds ( playerid, 20000.0000, -20000.0000, 20000.0000, -20000.0000 ); SetPlayerColor ( playerid, playerData[ playerid ][ p_sub ] ? ( SUB_COLOR ) : ( teamColor[ playerData[ playerid ][ p_team ] ][ 0 ] ) ); SetPlayerScore ( playerid, playerData[ playerid ][ p_kills ] ); SetPlayerInterior ( playerid, floatround( mspawn[ 4 ] ) ); SetPlayerVirtualWorld ( playerid, 0 ); DisablePlayerCheckpoint( playerid );
SetPlayerBounds( playerid, 20000.0000, -20000.0000, 20000.0000, -20000.0000 ); SetPlayerColor( playerid, playerData[ playerid ][ p_sub ] ? ( SUB_COLOR ) : ( teamColor[ playerData[ playerid ][ p_team ] ][ 0 ] ) ); SetPlayerScore( playerid, playerData[ playerid ][ p_kills ] ); SetPlayerInterior( playerid, floatround( mspawn[ 4 ] ) ), SetPlayerVirtualWorld ( playerid, 0 ); DisablePlayerCheckpoint( playerid );
Bueno yo tengo la costumbre de escribir siempre a doble espacio para ver mas claro cualquier script, por ejemplo:
Код:
SetPlayerBounds ( playerid, 20000.0000, -20000.0000, 20000.0000, -20000.0000 ); SetPlayerColor ( playerid, playerData[ playerid ][ p_sub ] ? ( SUB_COLOR ) : ( teamColor[ playerData[ playerid ][ p_team ] ][ 0 ] ) ); SetPlayerScore ( playerid, playerData[ playerid ][ p_kills ] ); SetPlayerInterior ( playerid, floatround( mspawn[ 4 ] ) ); SetPlayerVirtualWorld ( playerid, 0 ); DisablePlayerCheckpoint( playerid ); Код:
SetPlayerBounds( playerid, 20000.0000, -20000.0000, 20000.0000, -20000.0000 ); SetPlayerColor( playerid, playerData[ playerid ][ p_sub ] ? ( SUB_COLOR ) : ( teamColor[ playerData[ playerid ][ p_team ] ][ 0 ] ) ); SetPlayerScore( playerid, playerData[ playerid ][ p_kills ] ); SetPlayerInterior( playerid, floatround( mspawn[ 4 ] ) ), SetPlayerVirtualWorld ( playerid, 0 ); DisablePlayerCheckpoint( playerid ); |
No es tan asi, el principal problema con los grandes arrays no es la memoria que utilizan, si no que muchos scripters, tienden a crear loops sobre los mismos, los cuales tardan mucho tiempo (hablamos de unos cuantos milisegundos, pero cuando se trata de 1 thread para todo, esos milisegundos de mas que utilizamos cuentan) y no tanto a la memoria utilizada (generalmente desperdiciada) para almacenarlos.
Para que te des una idea de la memoria ram utilizada podemos realizar el siguiente calculo: Supongamos que tenemos un array con un tamaсo de 1024cells ("new mi_array[1024];"). 1 cell equivale a 4 bytes; entonces, 1024 cells equivalen a 4*1024 bytes (4096 bytes); entonces nuestro array llamado "mi_array" tiene un peso aproximado de 4Kb. |