Quote:
Originally Posted by AndySedeyn
This is your problem:
PHP код:
new string[128];
PHP код:
format(string, 256, ""p"Hrбč "w"%s"p" vypsal odměnu na hrбče "w"%s"p" . Vypsanб odměna - "w"$%d",jmeno , jmeno2, PlayerInfo[pID][Hitman]);
You are declaring a variable with 128 cells, yet you format the variable passing a much larger amount of cells as second argument (256). And once the formatted string reaches a length of 128 and more, it will crash the server.
You're much safer using sizeof:
PHP код:
format(string, sizeof(string), "%d", variable);
Plus, it makes your code easier to maintain in the long run.
FYI: MAX_PLAYER_NAME is defined as 24, but the maximum length of a player's name is actually 20: https://sampwiki.blast.hk/wiki/GetPlayerName
|
I still don't quite understand what's going on with MAX_PLAYER_NAME lol. So you can connect to a server with a nickname between 3 and 20 characters, however when you use SetPlayerName(
https://sampwiki.blast.hk/wiki/SetPlayerName) you can choose a nickname between 1 and 24 characters, I wonder why they did that.