![]() |
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
Код: Код:
void cmd_nick ( char *param )init_samp_chat_cmds() Код: Код:
addClientCommand( "nick", (char)cmd_nick );Thanks |
"param" is a "char *" just like "setLocalPlayerName" function argument, so you don't need to convert to int and then to "char *" again.
so, just... setLocalPlayerName(param); and the second argument of "addClientCommand" is a int, so you must not convert that void to char, but do it as an int, like this: addClientCommand("nick", (int)cmd_nick); ;) |
Thanks :)
|
void cmd_nick( char *param )
{ setLocalPlayerName(param); //name disconnect( 1 );//disconect restartGame();//restart games cheat_state->_generic.rejoinTick = GetTickCount(); } |
Цитата:
|
Цитата:
i use "1" millisecond :D |
Цитата:
|
Цитата:
http://puu.sh/3TJ20 now look at this function at samp dll: timing out(losting connection): http://puu.sh/3TIxH http://puu.sh/3TICF leaving: http://puu.sh/3TISt so, dec: 500(hex: 0x01F4) will corectly close connection, any other value(default is 0) will timeout the connection. ;) |
Цитата:
|
| Время: 00:17 |