What could be problem? -
Micko123 - 26.08.2016
On this line
PHP код:
format(string, sizeof(string), ""G_SRVBOJA"Info: "S_BJELA"Uspjesno ste postavili novo ime servera (%s).", inputtext);
I get these
Код:
C:\Users\Micko\Desktop\BaySide\gamemodes\BS.pwn(567) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Micko\Desktop\BaySide\gamemodes\BS.pwn(567) : warning 215: expression has no effect
C:\Users\Micko\Desktop\BaySide\gamemodes\BS.pwn(567) : error 001: expected token: ";", but found "-string-"
C:\Users\Micko\Desktop\BaySide\gamemodes\BS.pwn(567) : warning 215: expression has no effect
C:\Users\Micko\Desktop\BaySide\gamemodes\BS.pwn(567) : warning 215: expression has no effect
C:\Users\Micko\Desktop\BaySide\gamemodes\BS.pwn(567) : error 001: expected token: ";", but found ")"
C:\Users\Micko\Desktop\BaySide\gamemodes\BS.pwn(567) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Any ideas??
Re: What could be problem? -
Konstantinos - 26.08.2016
G_SRVBOJA and S_BJELA should be defined as strings
pawn Код:
#define S_BJELA "{RRGGBB}"
#define G_SRVBOJA "{RRGGBB}"
WHERE RRGGBB is the hex. Having them defined as integers will results to the errors/warnings you got.
Re: What could be problem? -
Micko123 - 26.08.2016
Thank you mate
And one more question. Should i use SCMF of should i format string? Which one is better and faster?
Re: What could be problem? -
JaKe Elite - 26.08.2016
I'd say SCMF (SendClientMessageFormat, If i am not wrong ??) - I found it easy and I used it as a shortcut (I am lazy too that is why I used it hah!)
Re: What could be problem? -
Micko123 - 26.08.2016
Yea. I am lazy too but is it more efficient than string??
Re: What could be problem? -
Stinged - 26.08.2016
Quote:
Originally Posted by Micko123
Yea. I am lazy too but is it more efficient than string??
|
No, in fact it is less efficient.
Usually they create strings with either 129 cells or 145 cells.
If you send 3 messages to the player, you're wasing 2*129 or 2*145 cells.
While doing it normally, you can just reuse the string.
pawn Код:
new string[145];
format(string, sizeof (string), "...", ...);
SendClientMessage(playerid, ...);
format(string, sizeof (string), "...", ...);
SendClientMessage(playerid, ...);
// --- SendFormattedMessage:
SendFormattedMessage(playerid, color, "...", ...);
SendFormattedMessage(playerid, color, "...", ...);
is the same as (string size can be different, but it's usually higher than 128)
new string1[129];
format(string1, sizeof (string1), "...", ...);
SendClientMessage(playerid, -1, ...);
new string2[129];
format(string2, sizeof (string2), "...", ...);
SendClientMessage(playerid, -1, ...);
Re: What could be problem? -
Micko123 - 26.08.2016
So you suggest that, when it comes about efficient, formating is better?
Re: What could be problem? -
Stinged - 26.08.2016
I don't know if efficiency is the correct term for it, but it is much better when it comes to memory saving.
Re: What could be problem? -
Micko123 - 26.08.2016
Well thank you man so much for deep explanation