Use sizeof() in OnCurWeapon as well. Any time you are looping through an array, use sizeof(). charsmax() should only be used in string functions/natives to set the max chars.
You should probably also check that a model exists in the string here. Or atleast for model P
Code:
for( new i = 0 ; i < charsmax( g_szWeapons ); i++ )
{
if( get_user_team( id
) == g_szWeapons
[ i
][ Teams
] &&
( get_user_flags( id
) & g_szWeapons
[ i
][ Access ] == g_szWeapons
[ i
][ Access ] ) && iWeapon == g_szWeapons
[ i
][ WeaponsID
] )
{
if ( g_szWeapons[ i ][ ModelV ][ 0 ] != EOS )
set_pev
( id, pev_viewmodel2, g_szWeapons
[ i
][ ModelV
] )
if ( g_szWeapons[ i ][ ModelP ][ 0 ] != EOS )
set_pev
( id, pev_weaponmodel2, g_szWeapons
[ i
][ ModelP
] )
break;
}
}
__________________