SA-MP Forums Archive
[AJUDA]Erro /rebocar - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [AJUDA]Erro /rebocar (/showthread.php?tid=255695)



[AJUDA]Erro /rebocar - [Dk]TuReTOo - 16.05.2011

Criei um tуpico e agora deixam de responder ? Epa juro que andei a procura de reboques e nao encontro... podem me ajudar a tirar estes erros por favor?

Quote:

C:\Users\Ricardo Moreira\Desktop\RedContry\RP-NossaComunidade 0.3c.1\gamemodes\RP-NossaComunidade.pwn(107) : error 010: invalid function or declaration
C:\Users\Ricardo Moreira\Desktop\RedContry\RP-NossaComunidade 0.3c.1\gamemodes\RP-NossaComunidade.pwn(335 : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Ricardo Moreira\Desktop\RedContry\RP-NossaComunidade 0.3c.1\gamemodes\RP-NossaComunidade.pwn(3513) : warning 235: public function lacks forward declaration (symbol "IsAnMecanico")
C:\Users\Ricardo Moreira\Desktop\RedContry\RP-NossaComunidade 0.3c.1\gamemodes\RP-NossaComunidade.pwn(3522) : warning 235: public function lacks forward declaration (symbol "IsAnMecanicoCar")
C:\Users\Ricardo Moreira\Desktop\RedContry\RP-NossaComunidade 0.3c.1\gamemodes\RP-NossaComunidade.pwn(43913) : warning 219: local variable "alarme" shadows a variable at a preceding level
C:\Users\Ricardo Moreira\Desktop\RedContry\RP-NossaComunidade 0.3c.1\gamemodes\RP-NossaComunidade.pwn(43913) : warning 219: local variable "portas" shadows a variable at a preceding level
C:\Users\Ricardo Moreira\Desktop\RedContry\RP-NossaComunidade 0.3c.1\gamemodes\RP-NossaComunidade.pwn(43913) : warning 219: local variable "capo" shadows a variable at a preceding level
C:\Users\Ricardo Moreira\Desktop\RedContry\RP-NossaComunidade 0.3c.1\gamemodes\RP-NossaComunidade.pwn(43913) : warning 219: local variable "portamalas" shadows a variable at a preceding level
C:\Users\Ricardo Moreira\Desktop\RedContry\RP-NossaComunidade 0.3c.1\gamemodes\RP-NossaComunidade.pwn(43937) : warning 203: symbol is never used: "SetWorld"
C:\Users\Ricardo Moreira\Desktop\RedContry\RP-NossaComunidade 0.3c.1\gamemodes\RP-NossaComunidade.pwn(42131) : warning 204: symbol is assigned a value that is never used: "roadblocktimer"
C:\Users\Ricardo Moreira\Desktop\RedContry\RP-NossaComunidade 0.3c.1\gamemodes\RP-NossaComunidade.pwn(10104) : warning 204: symbol is assigned a value that is never used: "tugate"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Linha 107 erro
PHP код:
foward IsAnMecanico(playerid); 
Linha 3513 warning
PHP код:
public IsAnMecanico(playerid
Linha 3522 warning
PHP код:
public IsAnMecanicoCar(carid



Re: [AJUDA]Erro /rebocar - Josma_cmd - 16.05.2011

pawn Код:
forward IsAnMecanico(playerid);
Vocк esqueceu do R.
Aconselho cuidar desses warnings cara...


Re: [AJUDA]Erro /rebocar - [Dk]TuReTOo - 16.05.2011

vocк sabe tirar estes warnings? se conseguir ajudar me a tirar agradeзo.. ja pedi ajuda e ainda ng conseguiu ajudar :S se conseguir me ajudar fico muito grato cara


Re: [AJUDA]Erro /rebocar - [S]trong - 16.05.2011

eu gostaria de te ajudar mas onde vocк postou nгo da de ver quais warnings sгo.


Re: [AJUDA]Erro /rebocar - [Dk]TuReTOo - 16.05.2011

eu ja posto.. olhe eu faзo rebocar com o reboque ID 525 e diz sempre " Vocк nгo estб em um guincho! "

o que fiz mal ? veja tudo o que meti:

Comando:
PHP код:
        if(strcmp(cmd,"/rebocar",true)==0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
IsAnMecanico(playerid))
            {
                if(
IsPlayerInAnyVehicle(playerid))
                {
                    new 
carid GetPlayerVehicleID(playerid);
                    if(
IsAnMecanicoCar(carid))
                    {
                        if(
GetPlayerState(playerid)==2)
                        {
                            new 
Float:pX,Float:pY,Float:pZ;
                            
GetPlayerPos(playerid,pX,pY,pZ);
                            new 
Float:vX,Float:vY,Float:vZ;
                            new 
Found=0;
                            new 
vid=0;
                            while((
vid<MAX_VEHICLES)&&(!Found))
                            {
                                
vid++;
                                
GetVehiclePos(vid,vX,vY,vZ);
                                if ((
floatabs(pX-vX)<7.0)&&(floatabs(pY-vY)<7.0)&&(floatabs(pZ-vZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
                                {
                                    if(
IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
                                    {
                                        
DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
                                    }
                                    else
                                    {
                                       
AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
                                    }
                                }
                            }
                            if(!
Found)
                            {
                                
SendClientMessage(playerid,COLOR_RED,"Nгo tem nenhum carro perto.");
                            }
                        }
                        else
                        {
                            
SendClientMessage(playeridCOLOR_RED"Vocк precisa estar dirigindo!");
                            return 
1;
                        }
                    }
                    else
                    {
                        
SendClientMessage(playeridCOLOR_GRAD2"Vocк nгo tem um Guincho!");
                        return 
1;
                    }
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"Vocк nгo estб em um guincho!");
                    return 
1;
                }
            }
               else
            {
                
SendClientMessage(playerid,COLOR_RED,"Vocк nгo й mecanico/Cop!");
                return 
1;
                     }
        }
        return 
0;
    } 
TOPO GM:

PHP код:
forward IsAnMecanico(playerid);
forward IsAnMecanicoCar(carid); 
Fim GM:
PHP код:
public IsAnMecanico(playerid)
{
     if(
PlayerInfo[playerid][pJob] == 8// Coloque o pJob e o !! de acordo com o seu Gamemode
     
{
          return 
1;
     }
     return 
0;
}
public 
IsAnMecanicoCar(carid)
{
     if(
carid == 525// Troque o !! pelo id do seu veiculo
     
{
          return 
1;
     }
     return 
0;




Re: [AJUDA]Erro /rebocar - Dr_Pawno - 17.05.2011

@Off:
Kra, para de fica criando topicos sem necessidade. Olha so o que vc jб crio:
https://sampforum.blast.hk/showthread.php?tid=255477 => Outro de Reboque
https://sampforum.blast.hk/showthread.php?tid=255267 => Erro por causa de uma Chave
https://sampforum.blast.hk/showthread.php?tid=255225 => Como converter
https://sampforum.blast.hk/showthread.php?tid=255250 => Cor de veiculo
https://sampforum.blast.hk/showthread.php?tid=254987 => Como troca uma pickup, e ainda acho que era um MapIcon
Kra, antes de vim pra ca, tente entender um pouco, por favor.
Alem de quase tudo ter no [ FAQ: Dъvidas Freqьentes & Tutoriais (04/05) ] e no Wiki Sa:Mp.
Use tambem o Search.

@Topic:
O Erro esta no ID do veiculo. Vocк pegou o ID do Modelo e nгo do veiculo. Se vocк quiser pelo modelo use:
pawn Код:
public IsAnMecanicoCar(carid)
{
     new model = GetVehicleModel(carid);
     if(model== 525)
     {
          return 1;
     }
     return 0;
}



Re: [AJUDA]Erro /rebocar - [Dk]TuReTOo - 17.05.2011

deume estra Warning

Quote:

C:\Users\Ricardo Moreira\Desktop\RedContry\RP-NossaComunidade 0.3c.1\gamemodes\RP-NossaComunidade.pwn(3524) : warning 219: local variable "model" shadows a variable at a preceding level

linha 3524
PHP код:
     new model GetVehicleModel(model); 



Re: [AJUDA]Erro /rebocar - Dr_Pawno - 17.05.2011

pawn Код:
new model = GetVehicleModel(carid);



Re: [AJUDA]Erro /rebocar - [Dk]TuReTOo - 17.05.2011

Dame estes erros e vvarings

Quote:

C:\Users\Ricardo Moreira\Desktop\RedContry\RP-NossaComunidade 0.3c.1\gamemodes\RP-NossaComunidade.pwn(3522) : error 025: function heading differs from prototype
C:\Users\Ricardo Moreira\Desktop\RedContry\RP-NossaComunidade 0.3c.1\gamemodes\RP-NossaComunidade.pwn(3524) : warning 219: local variable "model" shadows a variable at a preceding level
C:\Users\Ricardo Moreira\Desktop\RedContry\RP-NossaComunidade 0.3c.1\gamemodes\RP-NossaComunidade.pwn(3524) : error 017: undefined symbol "carid"
C:\Users\Ricardo Moreira\Desktop\RedContry\RP-NossaComunidade 0.3c.1\gamemodes\RP-NossaComunidade.pwn(17482) : error 017: undefined symbol "carid"

o que fiz mal ?

TOPO GM
PHP код:
forward IsAnMecanico(playerid);
forward IsAnMecanicoCar(carid); 
Comando
PHP код:
if(strcmp(cmd,"/rebocar",true)==0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
IsAnMecanico(playerid))
            {
                if(
IsPlayerInAnyVehicle(playerid))
                {
                    new 
model GetPlayerVehicleID(playerid);
                    if(
IsAnMecanicoCar(carid))
                    {
                        if(
GetPlayerState(playerid)==2)
                        {
                            new 
Float:pX,Float:pY,Float:pZ;
                            
GetPlayerPos(playerid,pX,pY,pZ);
                            new 
Float:vX,Float:vY,Float:vZ;
                            new 
Found=0;
                            new 
vid=0;
                            while((
vid<MAX_VEHICLES)&&(!Found))
                            {
                                
vid++;
                                
GetVehiclePos(vid,vX,vY,vZ);
                                if ((
floatabs(pX-vX)<7.0)&&(floatabs(pY-vY)<7.0)&&(floatabs(pZ-vZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
                                {
                                    if(
IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
                                    {
                                        
DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
                                    }
                                    else
                                    {
                                       
AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
                                    }
                                }
                            }
                            if(!
Found)
                            {
                                
SendClientMessage(playerid,COLOR_RED,"Nгo tem nenhum carro perto.");
                            }
                        }
                        else
                        {
                            
SendClientMessage(playeridCOLOR_RED"Vocк precisa estar dirigindo!");
                            return 
1;
                        }
                    }
                    else
                    {
                        
SendClientMessage(playeridCOLOR_GRAD2"Vocк nгo tem um Guincho!");
                        return 
1;
                    }
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"Vocк nгo estб em um guincho!");
                    return 
1;
                }
            }
               else
            {
                
SendClientMessage(playerid,COLOR_RED,"Vocк nгo й mecanico/Cop!");
                return 
1;
                     }
        }
        return 
0;
    } 
Fim GM
PHP код:
public IsAnMecanico(playerid)
{
     if(
PlayerInfo[playerid][pJob] == || PlayerInfo[playerid][pLeader] == 1// mete aqui o id do job ou da facзгo
     
{
          return 
1;
     }
     return 
0;
}
public 
IsAnMecanicoCar(model)
{
     new 
model GetVehicleModel(carid);
     if(
model== 525)
     {
          return 
1;
     }
     return 
0;




Re: [AJUDA]Erro /rebocar - Shadoww5 - 17.05.2011

Primeiro compare a forward com a public e veja se elas estгo iguais.