OnPlayerText, error 017: undefined symbol ( Send Messae naer player )
#1

Hi guys

i make this

pawn Код:
public OnPlayerText(playerid, text[])
{
    new textv2[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof (name));
    format(textv2, sizeof (textv2), "%s says: %s", name, text);
    SendAtHim(playerid, 10, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    Log("logs/chat.log", textv2);
    return 1;
}
pawn Код:
gamemodes\new.pwn(272) : error 017: undefined symbol "foreach"
gamemodes\new.pwn(274) : error 017: undefined symbol "IsPlayerLoggedIn"
gamemodes\new.pwn(276) : error 017: undefined symbol "i"
gamemodes\new.pwn(278) : error 017: undefined symbol "i"
gamemodes\new.pwn(284) : error 017: undefined symbol "i"
gamemodes\new.pwn(288) : error 017: undefined symbol "i"
gamemodes\new.pwn(292) : error 017: undefined symbol "i"
gamemodes\new.pwn(296) : error 017: undefined symbol "i"
gamemodes\new.pwn(300) : error 017: undefined symbol "i"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


10 Errors.
272 - 300
pawn Код:
stock SendAtHim(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(IsPlayerLoggedIn(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
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
You haven't included "foreach", plus it should be:

pawn Код:
foreach (new i : Player)
i fix it but thank you so much !!!

i make it but " #include <forech> " no fore"a"ch
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
Don't remove the original problem from your first post - other people can't search and find the solution if you do that.
done !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)