SA-MP Forums Archive
Problem with ProxDetector - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with ProxDetector (/showthread.php?tid=354030)



Problem with ProxDetector - rumen98 - 25.06.2012

I then wrote the forward
PHP код:
ProxDetector (Floatradiplayeridstring [], col1col2col3col4col5); 
then the bottom
PHP код:
public ProxDetector(Float:radiplayeridstring[],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);
        
//radi = 2.0; //Trigger Radius
        
for(new 0MAX_PLAYERSi++)
        {
            if(
IsPlayerConnected(i))
            {
                if(!
BigEar[i])
                {
                    
GetPlayerPos(iposxposyposz);
                    
tempposx = (oldposx -posx);
                    
tempposy = (oldposy -posy);
                    
tempposz = (oldposz -posz);
                    
//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
                    
if (((tempposx radi/16) && (tempposx > -radi/16)) && ((tempposy radi/16) && (tempposy > -radi/16)) && ((tempposz radi/16) && (tempposz > -radi/16)))
                    {
                        
SendClientMessage(icol1string);
                    }
                    else if (((
tempposx radi/8) && (tempposx > -radi/8)) && ((tempposy radi/8) && (tempposy > -radi/8)) && ((tempposz radi/8) && (tempposz > -radi/8)))
                    {
                        
SendClientMessage(icol2string);
                    }
                    else if (((
tempposx radi/4) && (tempposx > -radi/4)) && ((tempposy radi/4) && (tempposy > -radi/4)) && ((tempposz radi/4) && (tempposz > -radi/4)))
                    {
                        
SendClientMessage(icol3string);
                    }
                    else if (((
tempposx radi/2) && (tempposx > -radi/2)) && ((tempposy radi/2) && (tempposy > -radi/2)) && ((tempposz radi/2) && (tempposz > -radi/2)))
                    {
                        
SendClientMessage(icol4string);
                    }
                    else if (((
tempposx radi) && (tempposx > -radi)) && ((tempposy radi) && (tempposy > -radi)) && ((tempposz radi) && (tempposz > -radi)))
                    {
                        
SendClientMessage(icol5string);
                    }
                }
                else
                {
                    
SendClientMessage(icol1string);
                }
            }
        }
    }
//not connected
    
return 1;

Compile but do you get these errors

PHP код:
C:\Documents and Settings\xXx\Desktop\samp03e_svr_win32\gamemodes\register.pwn(506) : error 017undefined symbol "BigEar"
C:\Documents and Settings\xXx\Desktop\samp03e_svr_win32\gamemodes\register.pwn(506) : warning 215expression has no effect
C
:\Documents and Settings\xXx\Desktop\samp03e_svr_win32\gamemodes\register.pwn(506) : error 001expected token";"but found "]"
C:\Documents and Settings\xXx\Desktop\samp03e_svr_win32\gamemodes\register.pwn(506) : error 029invalid expressionassumed zero
C
:\Documents and Settings\xXx\Desktop\samp03e_svr_win32\gamemodes\register.pwn(506) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
4 Errors




Re: Problem with ProxDetector - mendax - 25.06.2012

Код:
new BigEar[MAX_PLAYERS];