if(strcmp(cmd, "/help", true) == 0) { if(IsPlayerConnected(playerid)) { strcat(HELP1, "General : /rules /doorbell /time /enter /exit /fish /describe /lamp /inv\n"); strcat(HELP1, "General : /doorshout /createnote /shownotes /putgun /takegun /pickreward\n"); strcat(HELP1, "General : /pay /putbeer /takebeer /putwine /takewine /putciggy /takeciggy\n"); strcat(HELP1, "General : /gateopen /gateclose /calc /tog /hidemenu /factionon /robbiz\n"); strcat(HELP1, "CarHelp : /engine /fill /wi(ndows) /seatbelt /trunk /fuel /gascan /payticket /payimpound\n"); strcat(HELP1, "AnimHelp : /animlist /taunt /walkstyle /eat /drink /sunglasses\n"); strcat(HELP1, "Account : /stats /changepass /upgrade /resetupgrades /dropmoney /dropgun /dropmats /dropdrugs\n"); strcat(HELP1, "Char : /skills /clothes /usedrugs /appearance /myage /skinids /pickitem\n"); strcat(HELP1, "Requests : /admins /helpers /report \n"); ShowPlayerDialog(playerid,DIALOG_HELPGEN,DIALOG_STYLE_MSGBOX, "Command Help", HELP1,"Okay",""); } return 1; }
new HELP1[1024];
1) How can a player, who enters a command, be disconnected? The IsPlayerConnected check is not necessary - there's no way OnPlayerCommandText gets called with an unconnected player.
|
1)
Also the SA-MP server doesn't have more than one thread for script execution, so things do not get messed up like that. |
1)
2) The first strcat(HELP1, ...) can be replaced by a simple assignment like HELP1 = "General : ..."; |
1)
3) I really hope that you don't declare arrays like HELP1[1024], COMMANDS[1024], COMMANDS2[1024] at the top of your script. If you are, you're wasting space (and your .amx gets huge) and making your compilation slow. One string, perhaps string[1024] will do. |
1)
4) You could try lessening the amount of strcat calls you have. I can't remember the line length limit from the top of my head, but perhaps it is 512 characters? There are some compiler mods that allow it to go up to 4096, but if you're not willing to do that, I can tell that you could fit a few more lines into one strcat call. |