SA-MP Forums Archive
/sellprods log problem - 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: /sellprods log problem (/showthread.php?tid=578059)



/sellprods log problem - Ugaustin - 16.06.2015

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;
    } 



Re: /sellprods log problem - Ugaustin - 16.06.2015

please anyone??


Re: /sellprods log problem - Matess - 16.06.2015

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


Re: /sellprods log problem - bgedition - 16.06.2015

What you want to save in this log?


Re: /sellprods log problem - Ugaustin - 16.06.2015

yes server log


Re: /sellprods log problem - Stanford - 16.06.2015

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!


Re: /sellprods log problem - Ugaustin - 16.06.2015

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


Re: /sellprods log problem - Ugaustin - 16.06.2015

thank you