SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 21/11/2016, 01:06 AM   #1
MineiriinHo
Huge Clucker
 
MineiriinHo's Avatar
 
Join Date: Feb 2016
Location: pawno/include/world. inc
Posts: 314
Reputation: 13
Default Invalid function or Declaration

Estou fazendo um simples comando com easyDialog, mas está dando um erro que eu já tentei resolver de diversas formas (não foram todas as formas ¬¬')

Code:
PHP Code:
CMD:oficina(playeridparams[])
{
    new 
vehicleid GetNearestVehicle(playerid);

    if(
PlayerData[playerid][pJob] != JOB_MECHANIC || !IsDoorVehicle(vehicleid))
        return 
SendErrorMessage(playerid"Você não é um mecânico ou este veículo não pode ser modificado.");

    if(!
IsPlayerInRangeOfPoint(playerid2.01985.4850,-2148.5571,15.4306))
        return 
SendErrorMessage(playerid"Você não está em uma oficina.");

    if(
vehicleid == INVALID_VEHICLE_ID)
        return 
SendErrorMessage(playerid"Você não está próximo de nenhum veículo.");

    if(
IsPlayerInAnyVehicle(playerid))
        return 
SendErrorMessage(playerid"Você deve sair do veículo primeiro.");

    
Dialog_Show(playeridMechanicOfficeDIALOG_STYLE_TABLIST_HEADERS"Mesa de Trabalho - Mecânicos""Item\tPreço (Peças)\n\
Adicionar Rodas\t260\n\
Adicionar NOS\t30\n\
Reparar Motor\t600\n\
Reparar Lataria\t600\n\
Adicionar som automotivo\t3000\n\
Remover Modificações\tGrátis\n\
Adicionar Hidráulica\t200"
"Selecionar""Cancelar");
    return 
1;

Dialog Response
PHP Code:
Dialog:MechanicOffice(playeridresponselistiteminputtext[])
{
    new 
vehicleid GetNearestVehicle(playerid);

    if (
response)
    {
        switch(
listitem)
        {
            case 
0:
                
ShowModelSelectionMenu(playerid"Trocar Rodas"MODEL_SELECTION_WHEELS, {10251073107410751076107710781079108010811082108310841085109610971098}, 170.00.090.0);

            case 
1:
                
AddVehicleComponent(vehicleid1010);

            case 
2:
                
SetVehicleHealth(vehicleid1000);

            case 
3:
                
RepairVehicle(vehicleid);

            case 
4:
                switch(
GetVehicleModel(vehicleid))
                {
                    case 
496:
                    {
                        new 
caixablista CreateObject(2232,0,0,-1000,0,0,0,100);
                        new 
caixablista2 CreateObject(2232,0,0,-1000,0,0,0,100);

                        
AttachObjectToVehicle(caixablistavehicleid0.005000,-1.520000,0.000000,-35.100002,90.539985,0.000000);
                        
AttachObjectToVehicle(caixablista2vehicleid0.005000,-1.520000,0.000000,-145.079940,90.539985,180.899887);
                        
SendClientMessage(playeridCOLOR_CLIENT"INFORMAÇÃO: {FFFFFF}Você adicionou uma caixa de som ao seu Blista Compact.");
                    }
                    case 
400:
                    {
                        new 
caixalandstal CreateObject(2232,0,0,-1000,0,0,0,100);
                        new 
caixalandstal2 CreateObject(2232,0,0,-1000,0,0,0,100);

                        
AttachObjectToVehicle(caixalandstalvehicleid, -0.094999,-1.575000,0.119999,0.000000,90.359977,0.000001);
                        
AttachObjectToVehicle(caixalandstal2vehicleid, -0.094999,-1.575000,0.119999,0.000000,270.000030,0.180020);
                        
SendClientMessage(playeridCOLOR_CLIENT"INFORMAÇÃO: {FFFFFF}Você adicionou uma caixa de som ao seu Landstalker.");
                    }
                    case 
404:
                    {
                        new 
caixaperrenial CreateObject(2232,0,0,-1000,0,0,0,100);
                        new 
caixaperrenial2 CreateObject(2232,0,0,-1000,0,0,0,100);

                        
AttachObjectToVehicle(caixaperrenialvehicleid0.000000,-2.060000,0.215000,0.000000,90.179985,0.000000);
                        
AttachObjectToVehicle(caixaperrenial2vehicleid0.000000,-2.060000,0.215000,0.000000,-90.719985,0.000000);
                        
SendClientMessage(playeridCOLOR_CLIENT"INFORMAÇÃO: {FFFFFF}Você adicionou uma caixa de som ao seu Perrenial.");
                    }
                    default:
                    {
                        
SendErrorMessage(playerid"Este veículo não suporta uma caixa de som.");
                    }
                }
                
                case 
5:
                {
                    new 
Float:XFloat:YFloat:Z;
                    
GetPlayerPos(playeridXYZ);
                    
SetPlayerPos(playeridXYZ);
                }
                
                case 
6:
                    
AddVehicleComponent(vehicleid1087);
            }
        }
    }
    return 
1;

O erro se encontra no return 1;
Eu tirei o return 1 e deu erro.
Eu coloquei o return 0 (erro) pra ver o que acontecia, e continuou Invalid Function or Declaration.
MineiriinHo is offline   Reply With Quote
Old 21/11/2016, 05:04 AM   #2
matheusspohr
Gangsta
 
matheusspohr's Avatar
 
Join Date: Feb 2015
Location: Capanema PR
Posts: 673
Reputation: 33
Default Re: Invalid function or Declaration

Olá, tente trocar "Dialog_Show" por "ShowPlayerDialog".

Acredito ser isso!

Boa sorte.

Abraços.
matheusspohr is offline   Reply With Quote
Old 22/11/2016, 03:03 PM   #3
MineiriinHo
Huge Clucker
 
MineiriinHo's Avatar
 
Join Date: Feb 2016
Location: pawno/include/world. inc
Posts: 314
Reputation: 13
Default Re: Invalid function or Declaration

O Show_Dialog é do easyDialog, amigo.
MineiriinHo is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Invalid function or declaration Gorgeousmaniac Scripting Help 2 14/09/2016 02:51 PM
Weird error: invalid symbol name and invalid function or declaration Reboma Scripting Help 1 04/02/2014 11:58 AM
error 010: invalid function or declaration & warning 235: public function lacks forward declaration (symbol "Drag") tboysamp Scripting Help 1 14/04/2013 06:10 AM
Invalid function or declaration? Ferrari123 Help Archive 2 07/03/2011 05:04 PM


All times are GMT. The time now is 05:11 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.