Cant figure out where is the error...
#1

I get this error messages:

PHP код:
D:\test\gamemodes\test.pwn(109) : error 001expected token"-string end-"but found "-identifier-"
D:\test\gamemodes\test.pwn(109) : warning 215expression has no effect
D
:\test\gamemodes\test.pwn(109) : error 001expected token";"but found ")"
D:\test\gamemodes\test.pwn(109) : error 029invalid expressionassumed zero
D
:\test\gamemodes\test.pwn(109) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
4 Errors

And this is the code:

PHP код:
forward LoginTimer(playerid);
public 
LoginTimer(playerid)
{
    new 
string[50];
    
format(stringsizeof(string), "%s"PlayerInfo[playerid][pLozinka]);
    
INFO(playeridstring); // line 109
    
format(stringsizeof(string), "%d"PlayerInfo[playerid][pID]);
    
INFO(playeridstring);

This is macro for INFO
PHP код:
#define INFO(%1,%2) SendClientMessage(%1,-1,"{0080FF}INFO:{FFFFFF}"%2) 
Reply
#2

PHP код:
#define INFO(%1,%2) SendClientMessage(%1,-1,"{0080FF}INFO:{FFFFFF}",%2) 
get it.
Reply
#3

Oh thanks Can you tell me why , . Its working but i cant get it :3

EDIT:
warning 202: number of arguments does not match definition

Ok maybe no :P
Reply
#4

ah, sheit. sorry D

Try now:

PHP код:
stock INFO(playerid,string)
{
    new 
gg[144];
    
format(gg,144,"{0080FF}INFO:{FFFFFF}%s",string);
    
SendClientMessage(playerid,gg);

U cant use SendClientMessage function with
PHP код:
"text %s",somethingstring); 
Reply
#5

It will wrong IK. But its possible with MACRO and faster..
Reply
#6

Quote:
Originally Posted by ilijap
Посмотреть сообщение
It will wrong IK. But its possible with MACRO and faster..
U still cannot use SendClientMessage like that.
U need to format your message before sendclient.

Or use it like that:
PHP код:
#define INFO(%1,%2) SendClientMessage(%1,-1,%2)  
format(stringsizeof(string), "{0080FF}INFO:{FFFFFF}%s"PlayerInfo[playerid][pLozinka]); 
INFO(playeridstring);
format(stringsizeof(string), "{0080FF}INFO:{FFFFFF}%d"PlayerInfo[playerid][pID]); 
INFO(playeridstring); 
Reply
#7

Having it as a function like BloodyRP did is recommended because it won't work with #define unless you use a global string to set it and join it with strcat (no other workaround as far as I know). If the text was not stored in a variable, using # would join it with the rest.

A correction for the above (forgot color and using strcat is faster):
pawn Код:
INFO(playerid,string)
{
    new gg[144] = "{0080FF}INFO:{FFFFFF}";
    strcat(gg, string);
    SendClientMessage(playerid, -1, gg);
}
Reply
#8

Nevermind I found that this will work too :P And not much lines :3
Код:
#define INFO(%1,%2) format(stinfo,150,"{0080FF}INFO:{FFFFFF}%s",%2)&&SendClientMessage(%1,-1,stinfo)
But thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)