What could be problem?
#1

On this line
PHP код:
format(stringsizeof(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??
Reply
#2

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.
Reply
#3

Thank you mate

And one more question. Should i use SCMF of should i format string? Which one is better and faster?
Reply
#4

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!)
Reply
#5

Yea. I am lazy too but is it more efficient than string??
Reply
#6

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, ...);
Reply
#7

So you suggest that, when it comes about efficient, formating is better?
Reply
#8

I don't know if efficiency is the correct term for it, but it is much better when it comes to memory saving.
Reply
#9

Well thank you man so much for deep explanation
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)