Hello, i'm wondering how can i put the parameters for the "
WriteShort(Float Fade time) and "
WriteShort(Float Fade duration)" for the message "ScreenFade" in the code below
so the
native in
sma code would be -
native send_screen_fade(Index, Float:Fade, Float: Duration, Type, Red, Green, Blue, Alpha)
PHP Code:
static cell AMX_NATIVE_CALL send_screen_fade( AMX *, cell * pParameters ) {
if( gpGlobals -> time > 4 && !FNullEnt( INT_TO_EDICT( pParameters[ 1 ] ) ) ) {
MESSAGE_BEGIN( MSG_ONE_UNRELIABLE, CMessages.screenfade, 0, ENT( INT_TO_EDICT( pParameters[ 1 ] ) ) );
WRITE_SHORT( 4096 ); // this parameter
WRITE_SHORT( 2048 ); // this parameter
WRITE_SHORT( 0 ); // and this parameter
WRITE_BYTE( pParameters[ 2 ] );
WRITE_BYTE( pParameters[ 3 ] );
WRITE_BYTE( pParameters[ 4 ] );
WRITE_BYTE( pParameters[ 5 ] );
MESSAGE_END( );
}
return 1;
}
so i would send the screen fade like:
PHP Code:
public func(index)
{
// for exapmle
send_screen_fade(index, 1.0, 0,60, 0x0000, 255, 0, 0, 255) // id, float fade, float duration, fade type , color red, green, blue, alpha
}
__________________