Yea, so sorry I did fix my problem. Sorry for the late response I was at work.
Vortex is correct as what he suggested is what I used,.
function onClientCommand(cmd, text)
{
if(cmd == "mouse")
{
if ( text == "on" )
{
while( !IsMouseCursorShowing( ) )
{
ShowMouseCursor( true );
Message("Show Mouse Cursor on", RED);
}
}
else if ( text == "off" )
{
while( IsMouseCursorShowing( ) )
{
ShowMouseCursor( false );
Message("Show Mouse Cursor off", RED);
}
}
else Message( "You must write /mouse on or /mouse off." );
}
}
Sorry if the code moved around,
btw if you want to have the player bind that function in a menu window then i suggest to use this
BindKey(KEY_F1, BINDTYPE_DOWN, "onClientCommand", "mouse", "on");
BindKey(KEY_F1, BINDTYPE_UP, "onClientCommand", "mouse", "off");
the objective is to hold it down and when finished release it
"Not needed on scriptload"