SA-MP Forums Archive
somes errors - 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: somes errors (/showthread.php?tid=506923)



somes errors - Karter - 15.04.2014

hello i need your help for somes errors i have :


errors :

PHP код:
(391) : error 017undefined symbol "Streamer_OnPlayerPickUpPickup"
(411) : error 017undefined symbol "Streamer_OnPlayerEnterCP"
(431) : error 017undefined symbol "Streamer_OnPlayerLeaveCP"
(451) : error 017undefined symbol "Streamer_OnPlayerEnterRaceCP"
(471) : error 017undefined symbol "Streamer_OnPlayerLeaveRaceCP"
(5386) : error 017undefined symbol "foreach"
(5386) : error 029invalid expressionassumed zero
(5386) : error 017undefined symbol "Player"
(5386) : fatal error 107too many error messages on one line 
code :

PHP код:
{
     new 
line1[10];
     new 
line2[10];
    foreach(new 
i:Player// <-- the line 5386
    
{
        if(
IsPlayerConnected(i) && zoneupdates[i] == 1)
        {
               if(
IsPlayerInZone(i,player_zone[i]))
              {
              }
               else {
                new 
player_zone_before;
                
player_zone_before player_zone[i];
                
player_zone[i] = -1;
                for(new 
j=0j<sizeof(zones);j++)
                {
                     if(
IsPlayerInZone(i,j) && player_zone[i] == -1)
                    {
                        if(
player_zone_before == -1)
                        {
                            new 
string[128];
                             
format(string,sizeof(string),"%s",zones[j][zone_name]);
                             
TextDrawSetString(LocationTD[i],string);
                        }
                             else
                         {
                             if(
strcmp(zones[j][zone_name],zones[player_zone_before][zone_name],true) != 0)
                             {
                                 new 
string[128];
                                 
format(string,sizeof(string),"%s",zones[j][zone_name]);
                                 
TextDrawSetString(LocationTD[i],string);
                            }
                        }
                        
player_zone[i] = j;
                          
format(line1,10,"p%dzone",i);
                          
format(line2,10,"%d",j);
                          
PropertySet(line1,line2);
                    }
                }
                if(
player_zone[i] == -1player_zone[i] = player_zone_before;
            }
           } 
i can give you some code if you want, sorry for my very bad english!

thanks you!


Re: somes errors - IceBilizard - 15.04.2014

First of all type this at top of your script

pawn Код:
#include <foreach>
and foreach loop is like this

pawn Код:
foreach(Player, i)
{
//here code
}