Hi, I tried nick changer command and compiling is ok, but when I testing on SAMP server, my game crashed... Why? please can you help me? Here is code
init_samp_chat_cmds()
Thanks
Код:
void cmd_nick ( char *param )
{
if ( !strlen( param ) )
{
addMessageToChatWindow( "USAGE: /nick <your new nick>" );
return;
}
else if ( g_SAMP == NULL )
return;
else if ( strlen( param ) < 3 || strlen( param ) > ALLOWED_PLAYER_NAME_LENGTH )
{
addMessageToChatWindow( "USAGE: /nick <3 - 20 SA-MP allowed characters>" );
return;
}
setLocalPlayerName( (char *)atoi( param ) );
restartGame();
disconnect( 500 );
cheat_state_text( "Rejoining in %d seconds...", set.rejoin_delay / 1000 );
cheat_state->_generic.rejoinTick = GetTickCount();
}
init_samp_chat_cmds()
Код:
addClientCommand( "nick", (char)cmd_nick );
Thanks