17.11.2013, 11:21
pawn Код:
CMD:newb(playerid, params[])
{
if(PlayerInfo[playerid][pNewb] ==0) return SendClientMessage(playerid,0xffffffaa,"You are not a newbie"); //checking if a player is not a noob, change it to your variable if any
if(NewbieChat == false) return SendClientMessage(playerid, COLOR_GREY, "Newbie chat is disabled!");
new string[256], text[256];
for(new i=0; i< MAX_PLAYERS;i++)
{
if(PlayerInfo[i][pNewb] ==1)
{
format(string,sizeof(string),"[NewbieChat] %s: %s",GetName,text);
SendClientMessage(i,0xffffffaa,string);
}
}
return 1;
}
pawn Код:
public OnPlayerText(playerid, text[])
{
new string[128];
format(string, sizeof(string), "%s: %s", GetName, text); //here
nearByMessage(playerid, COLOR_GREY, string);
return 1;
}
format(string, sizeof(string), "%s: %s", GetName, text);
format(string,sizeof(string),"[NewbieChat] %s: %s",GetName,text);
What did i do wrong?
How can i solve it?
My NearByMessage
pawn Код:
stock nearByMessage(playerid, color, string[], Float: Distance = 12.0) {
new
Float: nbCoords[3];
GetPlayerPos(playerid, nbCoords[0], nbCoords[1], nbCoords[2]);
foreach(Player, i) {
if(IsPlayerInRangeOfPoint(i, Distance, nbCoords[0], nbCoords[1], nbCoords[2]) && (GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))) {
SendClientMessage(i, color, string);
}
}
return 1;
}
Код:
C:\Users\LG\Desktop\Mustafa\LV RP\gamemodes\RPLV.pwn(188) : error 076: syntax error in the expression, or invalid function call C:\Users\LG\Desktop\Mustafa\LV RP\gamemodes\RPLV.pwn(639) : error 076: syntax error in the expression, or invalid function call Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.