Pomoc u vezi ProxDetector-a

Započeo Neckiy
16. Apr. 2021.
452
pregleda
4
postova
Neckiy
4
Shot Caller
16. Apr. 2021.
Poz, imam problem sa ProxDetectorom. Ja sam ga ispisao ali kada god compilam uvek bude 4 errora za 1 line.

CEO PROXDETECTOR:
 forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
    new Float:posx, Float:posy, Float:posz;
    new Float:oldposx, Float:oldposy, Float:oldposz;
    new Float:tempposx, Float:tempposy, Float:tempposz;
    GetPlayerPos(playerid, oldposx, oldposy, oldposz);
    foreach(new i = Player)
    {
        if(IsPlayerConnected(i))
        {
            if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
            {
                GetPlayerPos(i, posx, posy, posz);
                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)))
                {
                    SCM(i, col1, string);
                }
                else if(((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
                {
                    SCM(i,col2,string);
                }
                else if(((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
                {
                    SCM(i,col3,string);
                }
                else if(((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && (tempposz < radi/2) && (tempposz > -radi/2)))
                {
                    SCM(i,col4,string);
                }
                else if(((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && (tempposz < radi) && (tempposz > -radi)))
                {
                    SCM(i,col5,string);
                }
            }
        }
    }
}
return 1;
}


i problemi su za ovaj line
foreach(new i = Player)
Lexy
5
Underboss
16. Apr. 2021.
pokusaj ovo
stock IsPlayerNearPlayer(Float:radi, playerid, targetid)
{
    if( IsPlayerConnected(playerid) && IsPlayerConnected( targetid ) )
{
    if( GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld( targetid ) )
{
new Float:posx, Float:posy, Float:posz,
    Float:oldposx, Float:oldposy, Float:oldposz,
    Float:tempposx, Float:tempposy, Float:tempposz;

GetPlayerPos( playerid, oldposx, oldposy, oldposz);

GetPlayerPos(targetid, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);

if(((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
}
return 0;
}
dekszy
4
Enforcer
16. Apr. 2021.
Neckiy wrote on April 16, 2021, 3:32 am:
Poz, imam problem sa ProxDetectorom. Ja sam ga ispisao ali kada god compilam uvek bude 4 errora za 1 line.

CEO PROXDETECTOR:
 forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
    new Float:posx, Float:posy, Float:posz;
    new Float:oldposx, Float:oldposy, Float:oldposz;
    new Float:tempposx, Float:tempposy, Float:tempposz;
    GetPlayerPos(playerid, oldposx, oldposy, oldposz);
    foreach(new i = Player)
    {
        if(IsPlayerConnected(i))
        {
            if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
            {
                GetPlayerPos(i, posx, posy, posz);
                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)))
                {
                    SCM(i, col1, string);
                }
                else if(((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
                {
                    SCM(i,col2,string);
                }
                else if(((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
                {
                    SCM(i,col3,string);
                }
                else if(((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && (tempposz < radi/2) && (tempposz > -radi/2)))
                {
                    SCM(i,col4,string);
                }
                else if(((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && (tempposz < radi) && (tempposz > -radi)))
                {
                    SCM(i,col5,string);
                }
            }
        }
    }
}
return 1;
}


i problemi su za ovaj line
foreach(new i = Player)

Pa ne ide new i = Player nego new i: Player
Neckiy
4
Shot Caller
17. Apr. 2021.
Sve je reseno hvala momci!

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha