Syntax error
#1

Hi,

I'm getting this error
Код:
error 076: syntax error in the expression, or invalid function call
for this line
pawn Код:
format(string,sizeof(string),"%s%s(%d): %s%s",Colour[playerid][pNameCol],PlayerName,playerid,Colour[playerid][pChat],text[0]);
Where did I make my mistake..?
Reply
#2

Show me the value of text
Reply
#3

pawn Код:
public OnPlayerText (playerid,text[])
Reply
#4

pawn Код:
format(string,sizeof(string),"%s%s(%d): %s%s",Colour[playerid][pNameCol],PlayerName,playerid,Colour[playerid][pChat],text);
Try that, I don't really use that function as ZCMD / YCMD's are better
Reply
#5

Still the same error. I do use ZCMD by the way..
Reply
#6

Have you tried...
pawn Код:
new colour = GetPlayerColor(playerid);
format(string,sizeof(string),"%s(%d): %s%s",PlayerName,playerid,Colour[playerid][pChat],text);
SendClientMessageToAll(colour,string);
Reply
#7

Colour is already in the script

pawn Код:
new Colour[MAX_PLAYERS][pInfo];
Reply
#8

pawn Код:
new colourzZ69 = GetPlayerColor(playerid);
format(string,sizeof(string),"%s(%d): %s%s",PlayerName,playerid,Colour[playerid][pChat],text);
SendClientMessageToAll(colourzZ69,string);
Reply
#9

Still the same error..
Reply
#10

What values are given to Colour[playerid][pChat] ?? If they are hex values, you cannot format them as strings, so it will return a syntax error. Which is why players cannot usually use SendClientMessage(GetPlayerColour(playerid),... as GetPlayerColour returns a hex value.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)