Не срабатывает выстрел
#1

PHP код:
public OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ)
{
    
ShotCount[playerid][weaponid]++;
    switch(
weaponid)
    {
        case 
22:
        {
            
Player[playerid][Ammo0] -=1;
        }
        case 
23:
        {
            
Player[playerid][Ammo1] -=1;
        }
        case 
24:
        {
            
Player[playerid][Ammo2] -=1;
        }
        case 
25:
        {
            
Player[playerid][Ammo3] -=1;
        }
        case 
28:
        {
            
Player[playerid][Ammo4] -=1;
        }
        case 
29:
        {
            
Player[playerid][Ammo5] -=1;
        }
        case 
WEAPON_TEC9:
        {
            
Player[playerid][Ammo6] -=1;
        }
        case 
30:
        {
            
Player[playerid][Ammo7] -=1;
        }
        case 
31:
        {
            
Player[playerid][Ammo8] -=1;
        }
    }
    if(
Player[playerid][Ammo0Skill] != 100 && Player[playerid][Ammo1Skill] != 100 && Player[playerid][Ammo2Skill] != 100 && Player[playerid][Ammo3Skill] != 100 && Player[playerid][Ammo4Skill] != 100 && Player[playerid][Ammo5Skill] != 100 && Player[playerid][Ammo6Skill] != 100 && Player[playerid][Ammo7Skill] != 100 && Player[playerid][Ammo8Skill] != 100
    
&& ShotCount[playerid][weaponid] >= gunScore[playerid][weaponid])
    {
        switch(
weaponid)
        {
            case 
22:
            {
                
Player[playerid][Ammo0Skill] += 1;
                
ShotCount[playerid][22] = 0;
                
SCM(playerid,-1,"(( +1 Skill ))");
            }
            case 
23:
            {
                
Player[playerid][Ammo1Skill] += 1;
                
ShotCount[playerid][23] = 0;
                
SCM(playerid,-1,"(( +1 Skill ))");
            }
            case 
24:
            {
                
Player[playerid][Ammo2Skill] += 1;
                
ShotCount[playerid][24] = 0;
                
SCM(playerid,-1,"(( +1 Skill ))");
            }
            case 
25:
            {
                
Player[playerid][Ammo3Skill] += 1;
                
ShotCount[playerid][25] = 0;
                
SCM(playerid,-1,"(( +1 Skill ))");
            }
            case 
29:
            {
                
Player[playerid][Ammo5Skill] += 1;
                
ShotCount[playerid][29] = 0;
                
SCM(playerid,-1,"(( +1 Skill ))");
            }
            case 
30:
            {
                
Player[playerid][Ammo7Skill] += 1;
                
ShotCount[playerid][30] = 0;
                
SCM(playerid,-1,"(( +1 Skill ))");
            }
            case 
31:
            {
                
Player[playerid][Ammo8Skill] += 1;
                
ShotCount[playerid][31] = 0;
                
SCM(playerid,-1,"(( +1 Skill ))");
            }
            
        }
    }
    return 
true;

Когда стреляю ничего не делается.
Reply
#2

Если стреляю с оружия ид 32. Остальное работает
Reply
#3

Очевидно проблема в дефайне WEAPON_TEC9.
Reply
#4

Quote:
Originally Posted by Stepashka
Посмотреть сообщение
Очевидно проблема в дефайне WEAPON_TEC9.
Даже если ид 32 ставить суть та же.
Reply
#5

А размер массива ShotCount какой?
Reply
#6

Quote:
Originally Posted by Stepashka
Посмотреть сообщение
А размер массива ShotCount какой?
32. Исправил спасибо
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)