Cant figure out where is the error... -
ilijap - 21.05.2016
I get this error messages:
PHP код:
D:\test\gamemodes\test.pwn(109) : error 001: expected token: "-string end-", but found "-identifier-"
D:\test\gamemodes\test.pwn(109) : warning 215: expression has no effect
D:\test\gamemodes\test.pwn(109) : error 001: expected token: ";", but found ")"
D:\test\gamemodes\test.pwn(109) : error 029: invalid expression, assumed zero
D:\test\gamemodes\test.pwn(109) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
And this is the code:
PHP код:
forward LoginTimer(playerid);
public LoginTimer(playerid)
{
new string[50];
format(string, sizeof(string), "%s", PlayerInfo[playerid][pLozinka]);
INFO(playerid, string); // line 109
format(string, sizeof(string), "%d", PlayerInfo[playerid][pID]);
INFO(playerid, string);
}
This is macro for INFO
PHP код:
#define INFO(%1,%2) SendClientMessage(%1,-1,"{0080FF}INFO:{FFFFFF}"%2)
Re: Cant figure out where is the error... -
BloodyRP - 21.05.2016
PHP код:
#define INFO(%1,%2) SendClientMessage(%1,-1,"{0080FF}INFO:{FFFFFF}",%2)
get it.
Re: Cant figure out where is the error... -
ilijap - 21.05.2016
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
Re: Cant figure out where is the error... -
BloodyRP - 21.05.2016
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);
Re: Cant figure out where is the error... -
ilijap - 21.05.2016
It will wrong IK. But its possible with MACRO and faster..
Re: Cant figure out where is the error... -
BloodyRP - 21.05.2016
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(string, sizeof(string), "{0080FF}INFO:{FFFFFF}%s", PlayerInfo[playerid][pLozinka]);
INFO(playerid, string);
format(string, sizeof(string), "{0080FF}INFO:{FFFFFF}%d", PlayerInfo[playerid][pID]);
INFO(playerid, string);
Re: Cant figure out where is the error... -
Konstantinos - 21.05.2016
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);
}
Re: Cant figure out where is the error... -
ilijap - 21.05.2016
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