/sellprods log problem
#1

hi does anyone know on what line can I add log??


PHP код:
    if(strcmp(cmd"/sellprods"true) == 0)
    {
        new 
cashmade;
        new 
tmpcar;
        if(
IsPlayerConnected(playerid))
        {
            
tmpcar GetPlayerVehicleID(playerid);
            if(!
IsATruck(tmpcar))
            {
                
GameTextForPlayer(playerid"~r~You are not in a delivery truck"50001);
                return 
1;
            }
            if(
PlayerHaul[tmpcar][pLoad] == 0)
            {
                
GameTextForPlayer(playerid"~r~Truck is empty, return to the stock house"50001);
                
format(stringsizeof(string), "Products: %d/%d."PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
                
SendClientMessage(playeridTEAM_GROVE_COLORstring);
                return 
1;
            }
            for(new 
0sizeof(BizzInfo); i++)
            {
                if (
IsPlayerInRangeOfPoint(playerid10,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
                {
                    
//printf("Found House :%d",i);
                    
for(new PlayerHaul[tmpcar][pLoad]; 0l--)
                    {
                        if(
BizzInfo[i][bProducts] == BizzInfo[i][bMaxProducts])
                        {
                            
GameTextForPlayer(playerid"~r~Our stores are full"50001);
                            
format(stringsizeof(string), "Cash Earned $%d."cashmade);
                            
SendClientMessage(playeridTEAM_GROVE_COLORstring);
                            
format(stringsizeof(string), "Products: %d/%d."PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
                            
SendClientMessage(playeridTEAM_GROVE_COLORstring);
                            
PlayerPlaySound(playerid10520.00.00.0);
                            return 
1;
                        }
                        if(
BizzInfo[i][bPriceProd] > BizzInfo[i][bTill])
                        {
                            
GameTextForPlayer(playerid"~r~We Cant Afford The Deal"50001);
                            
format(stringsizeof(string), "Cash Earned $%d."cashmade);
                            
SendClientMessage(playeridTEAM_GROVE_COLORstring);
                            
format(stringsizeof(string), "Products: %d/%d."PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
                            
SendClientMessage(playeridTEAM_GROVE_COLORstring);
                            
PlayerPlaySound(playerid10520.00.00.0);
                            return 
1;
                        }
                        
PlayerHaul[tmpcar][pLoad]--;
                        
BizzInfo[i][bProducts]++;
                        
cashmade cashmade+BizzInfo[i][bPriceProd];
                        
//ConsumingMoney[playerid] = 1;
                        
SafeGivePlayerMoney(playerid,BizzInfo[i][bPriceProd]);
                        
BizzInfo[i][bTill] -= BizzInfo[i][bPriceProd];
                        if(
PlayerHaul[tmpcar][pLoad] == 0)
                        {
                            
GameTextForPlayer(playerid"~r~Truck is empty, return to the stock house"50001);
                            
format(stringsizeof(string), "Cash Earned $%d."cashmade);
                            
SendClientMessage(playeridTEAM_GROVE_COLORstring);
                            
format(stringsizeof(string), "Products: %d/%d."PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
                            
SendClientMessage(playeridTEAM_GROVE_COLORstring);
                            
PlayerPlaySound(playerid10520.00.00.0);
                            return 
1;
                        }
                    }
                    
OnPropUpdate(3,i);
                    return 
1;
                }
            }
        }
        for(new 
0sizeof(SBizzInfo); i++)
        {
            if (
IsPlayerInRangeOfPoint(playerid10,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ]))
            {
                
//printf("Found House :%d",i);
                
for(new PlayerHaul[tmpcar][pLoad]; 0l--)
                {
                    if(
SBizzInfo[i][sbProducts] == SBizzInfo[i][sbMaxProducts])
                    {
                        
GameTextForPlayer(playerid"~r~Our stores are full"50001);
                        
format(stringsizeof(string), "Cash Earned $%d."cashmade);
                        
SendClientMessage(playeridTEAM_GROVE_COLORstring);
                        
format(stringsizeof(string), "Products: %d/%d."PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
                        
SendClientMessage(playeridTEAM_GROVE_COLORstring);
                        return 
1;
                    }
                    if(
SBizzInfo[i][sbPriceProd] > SBizzInfo[i][sbTill])
                    {
                        
GameTextForPlayer(playerid"~r~We Cant Afford The Deal"50001);
                        
format(stringsizeof(string), "Cash Earned $%d."cashmade);
                        
SendClientMessage(playeridTEAM_GROVE_COLORstring);
                        
format(stringsizeof(string), "Products: %d/%d."PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
                        
SendClientMessage(playeridTEAM_GROVE_COLORstring);
                        return 
1;
                    }
                    
PlayerHaul[tmpcar][pLoad]--;
                    
SBizzInfo[i][sbProducts]++;
                    
cashmade cashmade+SBizzInfo[i][sbPriceProd];
                    
//ConsumingMoney[playerid] = 1;
                    
SafeGivePlayerMoney(playerid,SBizzInfo[i][sbPriceProd]);
                    
SBizzInfo[i][sbTill] -= SBizzInfo[i][sbPriceProd];
                    if(
PlayerHaul[tmpcar][pLoad] == 0)
                    {
                        
GameTextForPlayer(playerid"~r~Truck is empty, return to the stock house"50001);
                        
format(stringsizeof(string), "Cash Earned $%d."cashmade);
                        
SendClientMessage(playeridTEAM_GROVE_COLORstring);
                        
format(stringsizeof(string), "Products: %d/%d."PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
                        
SendClientMessage(playeridTEAM_GROVE_COLORstring);
                        return 
1;
                    }
                }
                
OnPropUpdate(3,i);
                return 
1;
            }
        }
        
GameTextForPlayer(playerid"~r~To Far From A Business"50001);
        return 
1;
    } 
Reply
#2

please anyone??
Reply
#3

What do you mean by log? Log into server_log? Log all texts in "/sellprods" or what?
Reply
#4

What you want to save in this log?
Reply
#5

yes server log
Reply
#6

Use gettime and getdate and get player name and rest of values that are important for you and use printf, this goes to server log as well!
Reply
#7

i know but where?? I don't know between { } ex: X sold at biz: %d
Reply
#8

thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)