Problem /trunk help please
#1

Hello.
I have a problem, please help, in general does not work only slot 0 is always, I think somewhere with a case that is not in order.
Dapustim to receive Desert Egle he is not taken, it is taken to take the Shotgun. Please help solve the problem.


Command:
PHP код:
CMD:trunk(playeridparams[])
{
    if(
GetPlayerHouse(playerid) == 0) return SCM(playeridCOLOR_WHITE"У вас нет машины!");
    if(
CarInfo[playerid][cLock] == 1) return SCM(playeridCOLOR_WHITE"Ошибка: Ваш транспорт закрыт. Откройте его, дабы воспользоваться багажником.");
    new 
FloatvXFloatvYFloatvZ;
    
GetCoordBootVehicle(GetPVarInt(playerid,"CREVEH"), vXvYvZ);
    if(!
IsPlayerInRangeOfPoint(playerid2.0vXvYvZ) || IsPlayerInAnyVehicle(playerid)) return SCM(playeridCOLOR_WHITE"Ошибка: Подсказка: Возможно использовать команду возле багажника!");
    new 
engine,lights,alarm,doors,bonnet,boot,objective;
    
GetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,boot,objective);
    
SetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,1,objective);
    
ApplyAnimation(playerid,"CASINO","dealone",4.1,1,1,1,1,1);
    new 
string[500];
    new 
gunname[5][32];
    for(new 
05i++)
    {
        if(
CarInfo[playerid][cGun][i] != 0GetWeaponName(CarInfo[playerid][cGun][i],gunname[i],32);
        if(
CarInfo[playerid][cGun][i] == 0format(gunname[i], 6,"Пусто");
    }
    
format(string,sizeof(string),"{ffffff}[-] Заправить транспорт\n[-] Положить оружие\n[-] Забрать все оружие\n[-] Положить наркотики\n[-] Взять наркотики\t\t%i г.\n\n[0] Слот (%s)\t\t{0BDA51}%i{ffffff} пт.\n[1] Слот (%s)\t\t{0BDA51}%i{ffffff} пт.\n[2] Слот (%s)\t\t{0BDA51}%i{ffffff} пт.\n[3] Слот (%s)\t\t{0BDA51}%i{ffffff} пт.\n[4] Слот (%s)\t\t{0BDA51}%i{ffffff} пт.",
    
CarInfo[playerid][cDrugs],
    
gunname[0],CarInfo[playerid][cGunAmmo][0],
    
gunname[1],CarInfo[playerid][cGunAmmo][1],
    
gunname[2],CarInfo[playerid][cGunAmmo][2],
    
gunname[3],CarInfo[playerid][cGunAmmo][3],
    
gunname[4],CarInfo[playerid][cGunAmmo][4]);
    
SPD(playerid,169,DIALOG_STYLE_LIST,"Багажник личного транспорта",string,"Выбрать","Закрыть");
    return 
true;

case:
PHP код:
    case 169:
        {
            if(
response)
            {
                switch(
listitem)
                {
                case 
0://Заправить авто
                    
{
                        if(
PlayerInfo[playerid][pJerrycan] == 0)
                        {
                            new 
engine,lights,alarm,doors,bonnet,boot,objective;
                            
GetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,boot,objective);
                            
SetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,0,objective);
                            
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,0);
                            
SCM(playeridCOLOR_GREY"У вас нет канистры!");
                            return 
true;
                        }
                        
PlayerInfo[playerid][pJerrycan] = 0;
                        
Vehicle[vehicle][Fuel] += 50;
                        
SCM(playeridCOLOR_LIGHTBLUE"[Т] Вы дозаправили транспорт (+50 литров)");
                    }
                case 
1://Положить оружие, по слотам
                    
{
                        new 
weaponid GetPlayerWeapon(playerid);
                        new 
slot GetWeaponSlot(weaponid);
                        if(
slot || slot 6)
                        {
                            new 
engine,lights,alarm,doors,bonnet,boot,objective;
                            
GetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,boot,objective);
                            
SetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,0,objective);
                            
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,0);
                            
SCM(playeridCOLOR_GREY"Данное оружие не подходить к ячейке!");
                            return 
true;
                        }
                        if(
PlayerInfo[playerid][pGun][slot] == 0)
                        {
                            new 
engine,lights,alarm,doors,bonnet,boot,objective;
                            
GetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,boot,objective);
                            
SetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,0,objective);
                            
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,0);
                            
SCM(playeridCOLOR_GREY"Ошибка!");
                            return 
true;
                        }
                        if(
CarInfo[playerid][cGun][slot-2] != && PlayerInfo[playerid][pGun][slot] != CarInfo[playerid][cGun][slot-2])
                        {
                            new 
engine,lights,alarm,doors,bonnet,boot,objective;
                            
GetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,boot,objective);
                            
SetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,0,objective);
                            
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,0);
                            
SCM(playeridCOLOR_GREY"Данная ячейка уже занята!");
                            return 
true;
                        }
                        
CarInfo[playerid][cGun][slot-2] = PlayerInfo[playerid][pGun][slot];
                        
CarInfo[playerid][cGunAmmo][slot-2] += PlayerInfo[playerid][pGunAmmo][slot];
                        
ResetPlayerWeaponID(playeridPlayerInfo[playerid][pGun][slot]);
                    }
                case 
2:
                    {
                        new 
guns;
                        for(new 
05i++)
                        {
                            if(
CarInfo[playerid][cGun][i] == || CarInfo[playerid][cGunAmmo][i] == 0) continue;
                            
GivePlayerWeaponAC(playeridCarInfo[playerid][cGun][i], CarInfo[playerid][cGunAmmo][i]);
                            
CarInfo[playerid][cGunAmmo][i] = 0;
                            
CarInfo[playerid][cGun][i] = 0;
                            
guns++;
                        }
                        if(!
gunsSCM(playeridCOLOR_GREY,"В багажнике нет оружия.");
                        else 
SCM(playeridCOLOR_GREY,"Вы забрали все оружие из багажника.");
                    }
                case 
3://Положить наркотики
                    
{
                        
CarInfo[playerid][cDrugs] += PlayerInfo[playerid][pDrugs];
                        
PlayerInfo[playerid][pDrugs] = 0;
                    }
                case 
4://Взять наркотики
                    
{
                        if(
CarInfo[playerid][cDrugs] == 0)
                        {
                            new 
engine,lights,alarm,doors,bonnet,boot,objective;
                            
GetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,boot,objective);
                            
SetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,0,objective);
                            
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,0);
                            
SCM(playerid,COLOR_GREY,"В транспорте нет наркотиков!");
                            return 
true;
                        }
                        if(
CarInfo[playerid][cDrugs] > 50)
                        {
                            
CarInfo[playerid][cDrugs] -= 50;
                            
PlayerInfo[playerid][pDrugs] += 50;
                        }
                        if(
CarInfo[playerid][cDrugs] <= 50)
                        {
                            
PlayerInfo[playerid][pDrugs] += CarInfo[playerid][cDrugs];
                            
CarInfo[playerid][cDrugs] = 0;
                        }
                    }
                }
                new 
engine,lights,alarm,doors,bonnet,boot,objective;
                
GetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,boot,objective);
                
SetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,0,objective);
                
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,0);
                if(
listitem 6) return true;
                if(
CarInfo[playerid][cGunAmmo][listitem-5] == 0) return SCM(playeridCOLOR_GREY,"В данной ячейки нет оружия!");
                if(
CarInfo[playerid][cGunAmmo][listitem-5] > 50)
                {
                    new 
gunname[32];
                    
GetWeaponName(CarInfo[playerid][cGun][listitem-5],gunname,32);
                    new 
mes[128];
                    
format(mes,sizeof(mes),"Вы взяли 50 патрон %s"gunname);
                    
SCM(playeridCOLOR_GREY,mes);
                    
GivePlayerWeaponAC(playeridCarInfo[playerid][cGun][listitem-5], 50);
                    
CarInfo[playerid][cGunAmmo][listitem-5] -= 50;
                    return 
true;
                }
                if(
CarInfo[playerid][cGunAmmo][listitem-5] <= 50)
                {
                    new 
gunname[32];
                    
GetWeaponName(CarInfo[playerid][cGun][listitem-5],gunname,32);
                    new 
mes[128];
                    
format(mes,sizeof(mes),"Вы взяли %i патрон %s"CarInfo[playerid][cGunAmmo][listitem-5], gunname);
                    
SCM(playeridCOLOR_GREY,mes);
                    
GivePlayerWeaponAC(playeridCarInfo[playerid][cGun][listitem-5], CarInfo[playerid][cGunAmmo][listitem-5]);
                    
CarInfo[playerid][cGunAmmo][listitem-5] = 0;
                    
CarInfo[playerid][cGun][listitem-5] = 0;
                    return 
true;
                }
                return 
true;
            }
            else
            {
                new 
engine,lights,alarm,doors,bonnet,boot,objective;
                
GetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,boot,objective);
                
SetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,0,objective);
                
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,0);
                return 
true;
            }
        } 
Help
The problem occurs only with weapons. Slot zero.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)