29.12.2016, 17:02
So, I defined the strings in my commands at 256.
new string[256];
Is it too big and if so, what can it cause?
new string[256];
Is it too big and if so, what can it cause?
Make the string big enought for your format or whatever you want to use it
For ISmokezU format a 17 cells is enought, because there is 16 characters + the string termination It's just a memory thing, how much memory to reserve for "string" , a 256cells (how you put) it's exactly 1024bytes Not a big deal, don't worry about it unless you have to much much big strings (and their cells is not used ) than you can worry for memory leaks or to memeory using.... |
CMD:aann(playerid, params[]) { new string[256], message[128]; if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not an admin!"); if(sscanf(params, "s[128]", message)) return SCM(playerid, COLOR_GRAD2,"/aann <message>"); format(string, sizeof(string), "STAFF ANNOUNCEMENT: {FFFFFF}%s", message); SendClientMessageToAll(COLOR_ORANGE, string); AdminLog(string); format(string, sizeof(string), "Announcement made by {FFFFFF}%s.", RPName(playerid)); SendAdminMessage(COLOR_ORANGE, string); return 1; }