[Ajuda] Comando nгo funciona
#1

Bom dia a todos do fуrum,queria ver se hб possibilidade de vocкs me ajudar nesse comando no qual nгo funciona.O comando seria para a profissгo de mecвnico no qual o mesmo conserta veнculos,sу que hб um problema nгo dб certo,eu jб tentei arrumб-lo de vбrias forma,porйm sem resultado.O comando nгo estб checando se a pessoa estб com dinheiro para poder arrumar o veнculo e nem consertando.Vou separar as partes
que usa o comando.
Na include:
PHP код:
{
    if(
PlayerInfo[playerid][pJob] == JOB_MECHANIC)
    {
        if(
RefillOffer[playerid] == INVALID_PLAYER_ID && RepairOffer[playerid] == INVALID_PLAYER_ID)
        {
            if(
PlayerInfo[playerid][pPasatizhi])
            {
                if(!
RepairReset[playerid])
                {
                    new 
idpartpricestring[150], Float:XFloat:Y[2], Float:Zrname[30];
                    if(
sscanf(params,"uii"idpartprice) || part || part 5)
                    {
                        
SendClientMessage(playerid,COLOR_ISPOLZUY,"Use: /reparar [ID/Nome] [ID parte do veнculo] [Preзo]");
                        
SendClientMessage(playerid,COLOR_WHITE,"__________ lista disponнveis ID's __________");
                        
SendClientMessage(playerid,COLOR_WHITE,"1. Motor");
                        
SendClientMessage(playerid,COLOR_WHITE,"2. Painel");
                        
SendClientMessage(playerid,COLOR_WHITE,"3. Portas");
                        
SendClientMessage(playerid,COLOR_WHITE,"4. Farуis");
                        
SendClientMessage(playerid,COLOR_WHITE,"5. Rodas");
                        
SendClientMessage(playerid,COLOR_WHITE,"____________________________________________");
                        return 
true;
                    }
                    switch(
part)
     {
                        case 
1rname "Reparou o Motor";
                        case 
2rname "Reparou o Painel";
                        case 
3rname "Reparou as Portas";
                        case 
4rname "Reparou os Farуis";
                        case 
5rname "Reparou as rodas";
                    }
                    if(
RepairOffer[id] == INVALID_PLAYER_ID)
                    {
                        if(
GetPlayerState(id) == PLAYER_STATE_DRIVER)
                        {
                            if(
GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
                            {
           if(
price 0)
                                {
                                    new 
carid GetPlayerVehicleID(id);
                                    
GetVehicleModelInfo(GetVehicleModel(carid), VEHICLE_MODEL_INFO_SIZEXY[1], Z);
                                    
GetVehicleShiftPoscarid0XY[0], ZY[1] / );
                                    if(
IsPlayerInRangeOfPointplayerid1.0XY[0], ) )
                                    {
                                        if(
price 200) return SendClientMessage(playerid,COLOR_GREY,"Nгo pode cobrar mais de $200 pelo serviзo");
                                        
format(string,sizeof(string),"{FFFFFF}Mecвnico {10F441}%s {FFFFFF}oferece-lhe %s.\nCusto: {10F441}$%d",cPN(playerid), rnameprice);
                                        
ProxDetector(1.0playeridstringCOLOR_PURPLE);
                                        if(!
ShowPlayerDialogEx(id,75,0,"Reparos",string,"Aceitar","Cancelar"))
                                        {
                                            
SendClientMessage(playeridCOLOR_GREY"Nгo disponнvel no momento.");
                                        }
                                        else
                                        {
                                            
format(string,sizeof(string),"Vocк quer consertar %s veнculo %s por $%d",cPN(id), rnameprice);
                                            
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
                                            
RepairOffer[playerid] = id;
                                            
RepairOffer[id] = playerid;
                                            
RepairPrice[id] = price;
                                            
RepairPart[id] = part;
                                        }
                                    }
                                    else 
SendClientMessage(playerid,COLOR_GREY,"Vocк estб muito longe desse veнculo.");
                                }
                                else 
SendClientMessage(playerid,COLOR_GREY,"Preзo deve ser entre RS $ 1 a $ 200.");
                            }
                            else 
SendClientMessage(playerid,COLOR_GREY,"Vocк deve estar fora desse veнculo.");
                        }
                        else 
SendClientMessage(playerid,COLOR_GREY,"O jogador deve sentar-se no veнculo.");
                    }
                    else 
SendClientMessage(playerid,COLOR_GREY,"Este jogador jб recebeu uma proposta para uma reparaзгo.");
                }
                else 
SendClientMessage(playerid,COLOR_GREY,"Vocк pode reparar, reabastece, instalaзгo de nйon/apenas 1 vezes em 30 segundos");
            }
            else 
SendClientMessage(playerid,COLOR_GREY,"Vocк nгo tem uma chave para reparar veнculos.");
        }
        else 
SendClientMessage(playerid,COLOR_GREY,"Jб tem alguйm reparando o veнculo.");
    }
    return 
true;

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[]) 
:
PHP код:
case 75:
        {
            new 
rname[30];
            new 
offer RepairOffer[playerid];
            if(
response)
            {
                if(
offer != INVALID_PLAYER_ID && RepairOffer[offer] == playerid)
                {
                    new 
carid GetPlayerVehicleID(playerid), Float:XFloat:YFloat:Z;
                    
GetVehicleShiftPoscarid0XYZ3.0 );
                    if(
IsPlayerInRangeOfPointoffer2.0XYZ) )
                    {
                        if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER && GetPlayerState(offer) == PLAYER_STATE_ONFOOT)
                        {
                            if(
GetMoney(playerid) >= RepairPrice[playerid])
                            {
                                switch(
RepairPart[playerid])
                                {
                                    case 
1:
                                    {
                                        
rname "Reparou o Motor";
                                        
SetBonnetStatuscaridtrue );
                                        
SetPlayerFaceToPoint(offerXY);
                                    }
                                    case 
2:
                                    {
                                        
rname "Reparou o Painel";
                                        
RepairReset[offer] = 15 20;
                                    }
                                    case 
3:
                                    {
                                        
rname "Reparou as Portas";
                                        
RepairReset[offer] = 15 20;
                                    }
                                    case 
4:
                                    {
                                        
rname "Reparou os Farуis";
                                        
RepairReset[offer] = 10 20;
                                    }
                                    case 
5:
                                    {
                                        
rname "Reparou as rodas";
                                        
RepairReset[offer] = 20 20;
                                    }
                                    default: return 
false;
                                }
                                
ApplyAnimation(offer"ROB_BANK""CAT_Safe_Rob"4.1011101);
                                
format(string,sizeof(string),"Vocк usou os serviзos de mecвnica %s ( %s ) por $%d",cPN(offer), rnameRepairPrice[playerid]);
                                
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
                                
format(string,sizeof(string),"Forneceu um serviзo ao jogador %s ( %s ) por $%d",cPN(playerid), rnameRepairPrice[playerid]);
                                
ProxDetector(1.0playeridstringCOLOR_PURPLE);
                                
SendClientMessage(offer,COLOR_LIGHTBLUE,string);
                                
GiveMoney(playerid,-RepairPrice[playerid],"Repair-");
                                
GiveMoney(offer,RepairPrice[playerid],"Repair+");
                                
SetEngineStatuscaridfalse );
                                
SaveAccount(playerid);
                                
SaveAccount(offer);
                                
InJob[offer] = 1;
                            }
                            else
                            {
                                
SendClientMessage(playerid,COLOR_GREY,"Vocк nгo tem dinheiro.");
                                
CheckRepairoffer );
                            }
                        }
                        else
                        {
                            
SendClientMessage(playerid,COLOR_GREY,"vocк estб fora de veнculo ou o mecвnico.");
                            
CheckRepairoffer );
                        }
                    }
                    else
                    {
                        
SendClientMessage(playerid,COLOR_GREY,"Mecвnico estб longe do veнculo.");
                        
CheckRepairoffer );
                    }
                }
                else
                {
                    
SendClientMessage(playerid,COLOR_GREY,"Ocorreu um erro.");
                    
CheckRepairoffer );
                }
            }
            else
            {
                
SendClientMessage(playerid,COLOR_GREY,"Vocк se recusou.");
                
CheckRepairoffer );
            }
            return 
true;
        } 
Quando o condutor do veiculo aceita arrumar o carro aparece isso,
PHP код:
 SendClientMessage(playerid,COLOR_GREY,"Ocorreu um erro."); 

Caso esteja faltando alguma parte eu posto,espero que entendam e me ajudem,agradeзo.
Reply
#2

Otimize seu comando:
pawn Код:
if (Condicao != 1) return SendClientMessage(playerid, 1, "ERRO");
Vocк irб encontrar o erro rapidinho.
Reply
#3

И assim,o mecвnico manda o convite para o condutor do veнculo para aceitar o preзo e a parte do veнculo para consertar.Quando o condutor aceita aн aparece esse erro.Eu tentei tirar todo o dinheiro do condutor para ver
se estava checando o dinheiro do condutor tambйm nгo deu.Acho que um problema estб levando ao outro..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)