[HELP] SendClientMessageToAll -
M0HAMMAD - 28.01.2015
Hi !
i created a public as you see down of the Thread, i don't know where is the problem.
i write the errors in Compiler, forward and public !
Errors:
pawn Код:
// all 26 errors are like this, but this is one of errors:
.pwn(3500) : error 035: argument type mismatch (argument 2)
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
26 Errors.
Line 3500 in error:
pawn Код:
// OnPlayerDisconnect
format(string,sizeof(string),"%s(%d) Left The Server",PlayerName(playerid),playerid);
SCMToAll(playerid,0x999999AA,string);
Public And Forward:
pawn Код:
forward SCMToAll(playerid,col[],msg[]);
public SCMToAll(playerid,col[],msg[])
{
for(new i=0;i<MAX_PLAYERS;i++)
{
//This "pPosX" and ... it's like GetPlayerPos in OnPlayerUpdate !
if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i,3,PlayerInfo[playerid][pPosX],PlayerInfo[playerid][pPosY],PlayerInfo[playerid][pPosZ]))
{
SendClientMessage(i,col,msg);
}
}
}
Re: [HELP] SendClientMessageToAll -
ReshiramZekrom - 28.01.2015
forwards are for timers, you have to create a stock:
pawn Код:
stock SCMToAll(playerid,col[],msg[])
{
for(new i=0;i<MAX_PLAYERS;i++)
{
//This "pPosX" and ... it's like GetPlayerPos in OnPlayerUpdate !
if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i,3,PlayerInfo[playerid][pPosX],PlayerInfo[playerid][pPosY],PlayerInfo[playerid][pPosZ]))
{
SendClientMessage(i,col,msg);
}
}
}
It should be works
Re: [HELP] SendClientMessageToAll -
Schneider - 28.01.2015
Color is not a string.
Change
pawn Код:
public SCMToAll(playerid,col[],msg[])
to:
pawn Код:
public SCMToAll(playerid,col,msg[])
Re: [HELP] SendClientMessageToAll -
arlindi - 28.01.2015
U can define it #define SCMTOALL SendClientMessageToAll
Re: [HELP] SendClientMessageToAll -
CrazyChoco - 28.01.2015
Quote:
Originally Posted by ReshiramZekrom
forwards are for timers, you have to create a stock:
pawn Код:
stock SCMToAll(playerid,col[],msg[]) { for(new i=0;i<MAX_PLAYERS;i++) { //This "pPosX" and ... it's like GetPlayerPos in OnPlayerUpdate ! if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i,3,PlayerInfo[playerid][pPosX],PlayerInfo[playerid][pPosY],PlayerInfo[playerid][pPosZ])) { SendClientMessage(i,col,msg); } } }
It should be works
|
Not only for timers, you're wrong.
Quote:
Originally Posted by Schneider
Color is not a string.
Change
pawn Код:
public SCMToAll(playerid,col[],msg[])
to:
pawn Код:
public SCMToAll(playerid,col,msg[])
|
As he posted, that snippet should be your fix
Re: [HELP] SendClientMessageToAll -
M0HAMMAD - 28.01.2015
Quote:
Originally Posted by ReshiramZekrom
forwards are for timers ... It should be works
|
ReshiramZekrom: thanks for your !
Quote:
Originally Posted by arlindi
U can define it #define SCMTOALL SendClientMessageToAll
|
arlindi: if you see my code, i add playerid after SCMToAll, and thats why i cant use define.
Quote:
Originally Posted by Schneider
Color is not a string...
|
Schneider:Thanks very much
Quote:
Originally Posted by CrazyChoco
Not only for timers ... should be your fix
|
CrazyChoco: thanks for your help
-------------------------------------------------------------------------------------
so, thanks every body for helping me, i use your offers and i just edit the public to stock and
edit
col[] to
co