Werid error:
#1

SendNearbyMessage(playerid, 15.0, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);

number of arguments does not match definition


however:

stock SendNearbyMessage(playerid, Float:radius, string[], col1, col2, col3, col4, col5)

everything matches up fine? :c
Reply
#2

you copypasted something and it didnt work..?

post Sendnearbymessage func
Reply
#3

Or just do this:

pawn Код:
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);

for(new i = 0; i <= GetPlayerPoolSize(); i++)
{
    if(IsPlayerConnected(i) && GetPlayerDistanceFromPoint(i, Pos[0], Pos[1], Pos[2]) <= 15.0) SendClientMessage(i, COLOR_PURPLE, string);
}
Reply
#4

Looks like the ProxDetector-Code.
Try to use this code instead. You can rename the stock.

PHP код:
stock ProxDetector(Float:radiplayeridtext[],col1,col2,col3,col4,col5)
{
    if(
IsPlayerConnected(playerid))
    {
        new 
Float:posxFloat:posyFloat:posz;
        new 
Float:oldposxFloat:oldposyFloat:oldposz;
        new 
Float:tempposxFloat:tempposyFloat:tempposz;
        
GetPlayerPos(playeridoldposxoldposyoldposz);
        for(new 
0MAX_PLAYERSi++)
        {
            if(
IsPlayerConnected(i))
            {
                if(
GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
                {
                    
GetPlayerPos(iposxposyposz);
                    
tempposx = (oldposx -posx);
                    
tempposy = (oldposy -posy);
                    
tempposz = (oldposz -posz);
                    if (((
tempposx radi/16) && (tempposx > -radi/16)) && ((tempposy radi/16) && (tempposy > -radi/16)) && ((tempposz radi/16) && (tempposz > -radi/16)))
                    {
                        
SendClientMessage(icol1text);
                    }
                    else if (((
tempposx radi/8) && (tempposx > -radi/8)) && ((tempposy radi/8) && (tempposy > -radi/8)) && ((tempposz radi/8) && (tempposz > -radi/8)))
                    {
                        
SendClientMessage(icol2text);
                    }
                    else if (((
tempposx radi/4) && (tempposx > -radi/4)) && ((tempposy radi/4) && (tempposy > -radi/4)) && ((tempposz radi/4) && (tempposz > -radi/4)))
                    {
                        
SendClientMessage(icol3text);
                    }
                    else if (((
tempposx radi/2) && (tempposx > -radi/2)) && ((tempposy radi/2) && (tempposy > -radi/2)) && ((tempposz radi/2) && (tempposz > -radi/2)))
                    {
                        
SendClientMessage(icol4text);
                    }
                    else if (((
tempposx radi) && (tempposx > -radi)) && ((tempposy radi) && (tempposy > -radi)) && ((tempposz radi) && (tempposz > -radi)))
                    {
                        
SendClientMessage(icol5text);
                    }
                }
            }
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)