Cmd not showing list of bizs
#1

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;
           } 
Reply
#2

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-)
Reply
#3

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


Forum Jump:


Users browsing this thread: 1 Guest(s)