Problem with ProxDetector
#1

Hi , I did that under OnPlayerText:
pawn Код:
public OnPlayerText(playerid, text[])
{
new string[150];
//=======Si le joueur est mutй
    if(Mute[playerid] == 1)
    {
        format(string, sizeof(string), "You can't talk , you're muted , wait %d sec", 600-SecondesMute[playerid]);
        SendClientMessage(playerid,COLOR_CERVENA,string);
        return 0;
    }
    if(IsLogged[playerid] == true)
    {
    format(string, sizeof(string), "%s[%d] says: %s", PlayerName(playerid),playerid, text);
    ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5); //problem
    SendClientMessage(playerid,COLOR_WHITE,string);
    }
    return 0;
}
I get an error (Undefined ProxDetector) , well for information I am creating RP chat.
Reply
#2

The Function "ProxDetector" Is not defined.
Reply
#3

Can you give me the exact error ?
If the error is this:
Код:
error 017: undefined symbol "ProxDetector"
I think you don't have the ProxDector function so.. add this at the bottom of your FS/GM:
pawn Код:
stock ProxDetector(playerid, Float:radius, string[], col1, col2, col3, col4, col5)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    new Float:ix, Float:iy, Float:iz;
    new Float:cx, Float:cy, Float:cz;
    foreach(Player, i)
    {
            if(GetPlayerInterior(playerid) == GetPlayerInterior(i) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
            {
                GetPlayerPos(i, ix, iy, iz);
                cx = (x - ix);
                cy = (y - iy);
                cz = (z - iz);
                if(((cx < radius/16) && (cx > -radius/16)) && ((cy < radius/16) && (cy > -radius/16)) && ((cz < radius/16) && (cz > -radius/16)))
                {
                    SendClientMessage(i, col1, string);
                }
                else if(((cx < radius/8) && (cx > -radius/8)) && ((cy < radius/8) && (cy > -radius/8)) && ((cz < radius/8) && (cz > -radius/8)))
                {
                    SendClientMessage(i, col2, string);
                }
                else if(((cx < radius/4) && (cx > -radius/4)) && ((cy < radius/4) && (cy > -radius/4)) && ((cz < radius/4) && (cz > -radius/4)))
                {
                    SendClientMessage(i, col3, string);
                }
                else if(((cx < radius/2) && (cx > -radius/2)) && ((cy < radius/2) && (cy > -radius/2)) && ((cz < radius/2) && (cz > -radius/2)))
                {
                    SendClientMessage(i, col4, string);
                }
                else if(((cx < radius) && (cx > -radius)) && ((cy < radius) && (cy > -radius)) && ((cz < radius) && (cz > -radius)))
                {
                    SendClientMessage(i, col5, string);
                }
            }
    }
    return 1;
}
Reply
#4

Yea
Код:
C:\Documents and Settings\PC\Bureau\DATABASE DE ALAE\SND\Votre Destin Role Play\gamemodes\VDRP.pwn(566) : error 017: undefined symbol "ProxDetector"
and when trying yours I get 9 errors , well , can I do that without ProxDetector?

NB : I wanna keep the Server "Clean" no plugins .
Reply
#5

Try to change this:
pawn Код:
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
To this:
pawn Код:
ProxDetector(playerid, 20.0, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
Because the parameters were wrong..
Reply
#6

Still the same ,I think the problem is I don't have foreach but I don't want plugins...
Reply
#7

Change the foreach line with this:
pawn Код:
for(new i = 0; i < GetMaxPlayers(); i ++)
Reply
#8

It works now thanks !! I have one error with color (I will change it ) thank u! so the message will be sent to nearest players?
Reply
#9

Yes.. It will do it!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)