SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 24/09/2017, 08:14 PM   #1
RuanPereira
Big Clucker
 
RuanPereira's Avatar
 
Join Date: Mar 2017
Posts: 115
Reputation: 0
Default Gunrack

comando " /gunrack " não está funcionando, não aparece o menu em dialog para guardar armas? Obs: comando tá completo, irei posta apenas o /gunrack se precisar de outro falem nos comentários.

Comando:

PHP Code:
CMD:gunrack(playeridparams[])
{
    new
        
id GetPlayerVehicleID(playerid);

    if (
IsPlayerInAnyVehicle(playerid))
    {
        if (
IsVehicleImpounded(id))
            return 
SendErrorMessage(playerid"Este veículo é apreendido e você não pode usá-lo.");

        if (!
PoliceCar(id))
            return 
SendErrorMessage(playerid"Este veículo não tem um gunrack. (LSPD/LVPD/SFPD)");

        if (
GetFactionType(playerid) != FACTION_POLICE)
            return 
SendErrorMessage(playerid"Você não é um oficial da lei.");

        
Car_ArmasGunrack(playeridCar_GetID(id));
    }
    else 
SendErrorMessage(playerid"Você não está dentro de nenhum veículo.");
    return 
1;

RuanPereira is offline   Reply With Quote
Old 24/09/2017, 08:21 PM   #2
willttoonn
Gangsta
 
willttoonn's Avatar
 
Join Date: Nov 2011
Location: Brazil
Posts: 941
Reputation: 88
Default Re: Gunrack

Poste a função Car_ArmasGunrack.
__________________
Sometimes a captain has to make the unpopular call because that's his responsibility

_________ Development Manager ______________________ Administrator
____________________ Brazilian Hard Roleplay Server ___________ Unofficial discord of the Brazilian/Portuguese SA-MP board

____________ _

willttoonn is offline   Reply With Quote
Old 24/09/2017, 08:22 PM   #3
fxckshzt
Huge Clucker
 
Join Date: Jul 2017
Location: 127.0.0.1
Posts: 264
Reputation: 11
Default Re: Gunrack

Quote:
Originally Posted by RuanPereira View Post
não aparece o menu em dialog para guardar armas?
ShowPlayerDialog?
Poste a função Car_ArmasGunrack. /2
__________________
Paz & Amor
fxckshzt is offline   Reply With Quote
Old 24/09/2017, 08:27 PM   #4
RuanPereira
Big Clucker
 
RuanPereira's Avatar
 
Join Date: Mar 2017
Posts: 115
Reputation: 0
Default Re: Gunrack

Quote:
Originally Posted by fxckshzt View Post
ShowPlayerDialog?
Poste a função Car_ArmasGunrack. /2
PHP Code:
Car_ArmasGunrack(playeridcarid)
{
    if (!
CarData[carid][carExists] || CarData[carid][carLocked])
        return 
0;

    static
        
string[164];

    
string[0] = 0;

    if (
22 <= CarData[carid][carArmaGunrack] <= 38)
        
format(stringsizeof(string), "%s%s - Munição: %d\n"stringReturnWeaponName(CarData[carid][carArmaGunrack]), CarData[carid][carMuniGunrack]);

    else
        
format(stringsizeof(string), "%s%s\n"string, (CarData[carid][carArmaGunrack]) ? (ReturnWeaponName(CarData[carid][carMuniGunrack])) : ("Slot Livre"));

    
Dialog_Show(playeridgunrackDIALOG_STYLE_LIST"Suporte"string"Selecionar""Cancelar");
    return 
1;

RuanPereira is offline   Reply With Quote
Old 24/09/2017, 08:32 PM   #5
C4rtm4n
Gangsta
 
C4rtm4n's Avatar
 
Join Date: Jul 2017
Location: South Park
Posts: 657
Reputation: 15
Default Re: Gunrack

Quote:
Originally Posted by RuanPereira View Post
PHP Code:
Car_ArmasGunrack(playeridcarid)
{
    if (!
CarData[carid][carExists] || CarData[carid][carLocked])
        return 
0;

    static
        
string[164];

    
string[0] = 0;

    if (
22 <= CarData[carid][carArmaGunrack] <= 38)
        
format(stringsizeof(string), "%s%s - Munição: %d\n"stringReturnWeaponName(CarData[carid][carArmaGunrack]), CarData[carid][carMuniGunrack]);

    else
        
format(stringsizeof(string), "%s%s\n"string, (CarData[carid][carArmaGunrack]) ? (ReturnWeaponName(CarData[carid][carMuniGunrack])) : ("Slot Livre"));

    
Dialog_Show(playeridgunrackDIALOG_STYLE_LIST"Suporte"string"Selecionar""Cancelar");
    return 
1;


Olha teu MP

PHP Code:
format(stringsizeof(string), "%s%s\n"string, (CarData[carid][carArmaGunrack]) ? (ReturnWeaponName(CarData[carid][carMuniGunrack])) : ("Slot Livre")); 
troque por

PHP Code:
format(stringsizeof(string), "%s%s\n"string, (CarData[carid][carArmaGunrack])
&& (
ReturnWeaponName(CarData[carid][carMuniGunrack])) : ("Slot Livre")); 
__________________
No Projects At the moment

C4rtm4n is offline   Reply With Quote
Old 24/09/2017, 08:39 PM   #6
RuanPereira
Big Clucker
 
RuanPereira's Avatar
 
Join Date: Mar 2017
Posts: 115
Reputation: 0
Default Re: Gunrack

Quote:
Originally Posted by C4rtm4n View Post
Olha teu MP

PHP Code:
format(stringsizeof(string), "%s%s\n"string, (CarData[carid][carArmaGunrack]) ? (ReturnWeaponName(CarData[carid][carMuniGunrack])) : ("Slot Livre")); 
troque por

PHP Code:
format(stringsizeof(string), "%s%s\n"string, (CarData[carid][carArmaGunrack])
&& (
ReturnWeaponName(CarData[carid][carMuniGunrack])) : ("Slot Livre")); 
PHP Code:
C:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(50622) : error 033: array must be indexed (variable "ReturnWeaponName")
C:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(50622) : error 029invalid expressionassumed zero
C
:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(50622) : warning 215expression has no effect
C
:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(50622) : error 001expected token";"but found ")"
C:\Users\XR7550\Desktop\America Roleplay\gamemodes\America.pwn(50622) : fatal error 107too many error messages on one line

Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase


4 Errors

RuanPereira is offline   Reply With Quote
Old 24/09/2017, 09:32 PM   #7
willttoonn
Gangsta
 
willttoonn's Avatar
 
Join Date: Nov 2011
Location: Brazil
Posts: 941
Reputation: 88
Default Re: Gunrack

Tente assim:

Code:
Car_ArmasGunrack(playerid, carid) 
{ 
    if(carid == -1)//Se não tiver irá dar erro no enum abaixo.
        return 1;

    if (!CarData[carid][carExists] || CarData[carid][carLocked]) 
        return 0;

    static 
        string[164]; 

    string[0] = 0; 

	if(CarData[carid][carArmaGunrack] > 21 && CarData[carid][carArmaGunrack] < 39)
		format(string, sizeof(string), "%s%s - Munição: %d\n", string, ReturnWeaponName(CarData[carid][carArmaGunrack]), CarData[carid][carMuniGunrack]);
	else if(CarData[carid][carArmaGunrack] < 22 || CarData[carid][carArmaGunrack] > 38)
		format(string, sizeof(string), "%s%s\n", string, ReturnWeaponName(CarData[carid][carArmaGunrack]));
	else
		format(string, sizeof(string), "%sSlot Livre\n", string);

	Dialog_Show(playerid, gunrack, DIALOG_STYLE_LIST, "Suporte", string, "Selecionar", "Cancelar"); 
    return 1; 
}
__________________
Sometimes a captain has to make the unpopular call because that's his responsibility

_________ Development Manager ______________________ Administrator
____________________ Brazilian Hard Roleplay Server ___________ Unofficial discord of the Brazilian/Portuguese SA-MP board

____________ _

willttoonn is offline   Reply With Quote
Old 24/09/2017, 10:02 PM   #8
RuanPereira
Big Clucker
 
RuanPereira's Avatar
 
Join Date: Mar 2017
Posts: 115
Reputation: 0
Default Re: Gunrack

Quote:
Originally Posted by willttoonn View Post
Tente assim:

Code:
Car_ArmasGunrack(playerid, carid) 
{ 
    if(carid == -1)//Se não tiver irá dar erro no enum abaixo.
        return 1;

    if (!CarData[carid][carExists] || CarData[carid][carLocked]) 
        return 0;

    static 
        string[164]; 

    string[0] = 0; 

	if(CarData[carid][carArmaGunrack] > 21 && CarData[carid][carArmaGunrack] < 39)
		format(string, sizeof(string), "%s%s - Munição: %d\n", string, ReturnWeaponName(CarData[carid][carArmaGunrack]), CarData[carid][carMuniGunrack]);
	else if(CarData[carid][carArmaGunrack] < 22 || CarData[carid][carArmaGunrack] > 38)
		format(string, sizeof(string), "%s%s\n", string, ReturnWeaponName(CarData[carid][carArmaGunrack]));
	else
		format(string, sizeof(string), "%sSlot Livre\n", string);

	Dialog_Show(playerid, gunrack, DIALOG_STYLE_LIST, "Suporte", string, "Selecionar", "Cancelar"); 
    return 1; 
}
Não deu certo mesma coisa tenta ver isso.

PHP Code:
Dialog:Gunrack(playeridresponselistiteminputtext[])
{
        if (
response)
        {
            new 
carid GetPlayerVehicleID(playerid);
            if (!
CarData[carid][carArmaGunrack])
            {
                if (!
GetWeapon(playerid))
                    return 
SendErrorMessage(playerid"Você não está segurando uma arma.");

                   if (
GetWeapon(playerid) == 23 && PlayerData[playerid][pTazer])
                    return 
SendErrorMessage(playerid"Você não pode guardar um taser.");

                if (
GetWeapon(playerid) == 25 && PlayerData[playerid][pBeanBag])
                    return 
SendErrorMessage(playerid"Você não pode guardar uma beanbag.");

                if (
ArmasGunrack(playerid))
                    return 
SendErrorMessage(playerid"Você não pode guardar essa arma. (Apenas M4/Shotgun/MP5)");

                   
CarData[carid][carArmaGunrack] = GetWeapon(playerid);
                
CarData[carid][carMuniGunrack] = GetPlayerAmmo(playerid);

                if(
CarData[carid][carMuniGunrack] != GetPlayerAmmo(playerid))
                {
                    
CarData[carid][carMuniGunrack] = GetPlayerAmmo(playerid);
                }
                
ResetWeapon(playeridCarData[carid][carArmaGunrack]);
                
SendNearbyMessage(playerid10.0COLOR_PURPLE"%s leva sua mão até o suporte e guarda uma %s no mesmo."ReturnName(playerid0), ReturnWeaponName(CarData[carid][carArmaGunrack]));

                
Car_Save(carid);
                
Car_ArmasGunrack(playeridcarid);
            }
            else
            {
                
GiveWeaponToPlayer(playeridCarData[carid][carArmaGunrack], CarData[carid][carMuniGunrack]);
                
SendNearbyMessage(playerid10.0COLOR_PURPLE"%s leva sua mão até o suporte e retira uma %s do mesmo."ReturnName(playerid0), ReturnWeaponName(CarData[carid][carArmaGunrack]));

                
CarData[carid][carArmaGunrack] = 0;
                
CarData[carid][carMuniGunrack] = 0;

                
Car_Save(carid);
                
Car_ArmasGunrack(playeridcarid);
            }
        }
        return 
1;
}(
veh 
RuanPereira is offline   Reply With Quote
Old 24/09/2017, 10:13 PM   #9
willttoonn
Gangsta
 
willttoonn's Avatar
 
Join Date: Nov 2011
Location: Brazil
Posts: 941
Reputation: 88
Default Re: Gunrack

Qual erro que acontece no jogo?
__________________
Sometimes a captain has to make the unpopular call because that's his responsibility

_________ Development Manager ______________________ Administrator
____________________ Brazilian Hard Roleplay Server ___________ Unofficial discord of the Brazilian/Portuguese SA-MP board

____________ _

willttoonn is offline   Reply With Quote
Old 24/09/2017, 10:17 PM   #10
RuanPereira
Big Clucker
 
RuanPereira's Avatar
 
Join Date: Mar 2017
Posts: 115
Reputation: 0
Default Re: Gunrack

Quote:
Originally Posted by willttoonn View Post
Qual erro que acontece no jogo?
Tipo, quando dou " /gunrack " não aparece o menu de guardar as armas não aparece nada..
RuanPereira 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
[FilterScript] Gunrack LSPD LopesMike Filterscripts 1 29/10/2016 12:35 PM
System Gunrack LSPD LopesMike Scripting Help 1 28/10/2016 06:39 AM
[Ajuda] Sistema de Gunrack Vinic1usz Português/Portuguese 1 04/06/2016 03:24 PM
[Ajuda] Gunrack FernandoDutra Português/Portuguese 22 06/03/2016 12:49 PM


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


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