[HELP] SendClientMessageToAll
#1

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);
        }
    }
}
Reply
#2

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
Reply
#3

Color is not a string.

Change
pawn Код:
public SCMToAll(playerid,col[],msg[])
to:
pawn Код:
public SCMToAll(playerid,col,msg[])
Reply
#4

U can define it #define SCMTOALL SendClientMessageToAll
Reply
#5

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
Reply
#6

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)