Pomoc u vezi ProxDetector-a


Započeo Neckiy, April 16, 2021, 05:32:02 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

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)
Poslednja Izmena: April 17, 2021, 11:23:35 PRE PODNE od M Ө M Σ N Z I
Mnogo ljudi mi govori da sam autistican.
U pravu su...



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;
}
Poslednja Izmena: April 16, 2021, 05:56:08 PRE PODNE od yeet
CitatNe idite uokolo tumačeći kako vam svijet duguje život. Svijet vam ne duguje ništa. On je bio prvi ovdje.

Citat: Neckiy poslato April 16, 2021, 05:32:02 PRE PODNE
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

Sve je reseno hvala momci!
Mnogo ljudi mi govori da sam autistican.
U pravu su...