SA-MP Forums Archive
loop doesn't work?! - 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: loop doesn't work?! (/showthread.php?tid=608638)



loop doesn't work?! - Zevcore - 03.06.2016

Hello, after the creation of the loop does not work for me either 3dText or MapIcon.

PHP код:
#define MAX_BAYS 3 
PHP код:
forward ShowBays(playerid);
public 
ShowBays(playerid)
{
    for(new 
id 0id MAX_BAYSid++)
    {
        
SetPlayerMapIcon(id12BayCache[bPosX], BayCache[bPosY], BayCache[bPosZ], 510MAPICON_LOCAL);
    }
    return 
1;

PHP код:
forward LoadBays();
public 
LoadBays()
{
    new 
        
info[256],
        
query[256], 
        
data[256];
    
    
format(querysizeof query"SELECT * FROM `bays`");
    
mysql_query(query);
    
    
mysql_store_result();
    new 
nums mysql_num_rows();
    
printf("[TOWARY] Zaladowano %d towarow."nums);
    for(new 
0numsi++)
    {
        if(
mysql_fetch_row(data","))
        {
            
sscanf(data"p<,>ds[32]fff",
                
BayCache[bUID],
                
BayCache[bName],
                
BayCache[bCargo],
                
BayCache[bPosX],
                
BayCache[bPosY],
                
BayCache[bPosZ]
            );
            
            
format(infosizeof info"{00CC00}[{FFFFFF}%d{00CC00}]\nDok załadunkowy w:\n{00CC00}%s"BayCache[bUID], BayCache[bName]);
            
Create3DTextLabel(info, -1BayCache[bPosX], BayCache[bPosY], BayCache[bPosZ], 0.001);
        }
    }
    
    
    return 
1;