SA-MP Forums Archive
Cmd not showing list of bizs - 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: Cmd not showing list of bizs (/showthread.php?tid=589308)



Cmd not showing list of bizs - TheLegend1 - 17.09.2015

hey fellas.
I have an problem with my command.
/orderedcomps is command which i made when someone orders comps for his own biz
but when i press /orderedcomps it wont show me bizs that
Here is my command. No script errors

PHP Code:
COMMAND:orderedcomps(playerid,params[])
        {
            if(
PlayerInfo[playerid][orderedcomps] <1)
            {
                new 
MSG[90];
                
SendClientMessage(playerid,COLOR_YELLOW,"---- Ordered comps from bizs owners / biz ids ----");
                for(new 
i=0;i<(sizeof(i));i++)
                {
                new 
zone[60];
                        
GetZone(biz[i][bizenter_x],biz[i][bizenter_y],biz[i][bizenter_z], zone);
                        
format(MSG,sizeof(MSG),"Business Name:[%s][%d] - Business Location[%s]",biz[i][bizname],biz[i][bizid],zone);
                        
SendClientInfo(playeridMSG);
                }
                return 
1;
            }
            return 
1;
           } 



Re: Cmd not showing list of bizs - Sawalha - 17.09.2015

pawn Code:
for(new i=0;i<(sizeof(i));i++)
this doesn't make sense;
you define the variable 'i' and give it zero value, then you make 'i' smaller than it's size?
even that 'i' variable is an integer, not an array or string to assign "sizeof" to it
an example how would it work
pawn Code:
for(new i = 0; i < Bizzes[playerid]; i++)
here, i looped into player bizzes variable, and we can suppose that it's value represents number of player's bizzes (could be loaded from file or database -instance-)


Re: Cmd not showing list of bizs - Lunoxel - 17.09.2015

PHP Code:
for(new i=0;i<(sizeof(i));i++)  ---> for(new 0sizeof(biz); i++)