Players freeze when shot
#1

Ok so this happens only somethings, I don't know what's casuing this maybe these animations. Anyways here is the code. It started happening after I added this code.
PHP код:
public OnPlayerGiveDamage(playeriddamagedidFloatamountweaponid)
{
    if(
damagedid != INVALID_PLAYER_ID)
    {
        
/*Weapon Damage Sync*/
        
if(weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 || weaponid == 33 || weaponid == 34 || weaponid == 38)
          {
               new 
tmptmp=random(48); // 1/3 Change
            
switch(tmp)
            {
                 case 
0:  { ApplyAnimation(damagedid,"PED","DAM_armL_frmBK",4.0,0,0,0,1,1); }
                 case 
1:  { }
                 case 
2:  { }
                 case 
3:  { ApplyAnimation(damagedid,"PED","DAM_armR_frmBK",4.0,0,0,0,1,1); }
                 case 
4:  { }
                 case 
5:  { }
                 case 
6:  { ApplyAnimation(damagedid,"PED","DAM_LegL_frmBK",4.0,0,0,0,1,1); }
                 case 
7:  { }
                 case 
8:  { }
                 case 
9:  { ApplyAnimation(damagedid,"PED","DAM_LegR_frmBK",4.0,0,0,0,1,1); }
                 case 
10: { }
                 case 
11: { }
                 case 
12: { ApplyAnimation(damagedid,"PED","DAM_stomach_frmBK",4.0,0,0,0,1,1); }
                 case 
13: { }
                 case 
14: { }
                 case 
15: { ApplyAnimation(damagedid,"PED","DAM_stomach_frmRT",4.0,0,0,0,1,1); }
                 case 
16: { }
                 case 
17: { }
                 case 
18: { ApplyAnimation(damagedid,"PED","DAM_armL_frmFT",4.0,0,0,0,1,1); }
                 case 
19: { }
                 case 
20: { }
                 case 
21: { ApplyAnimation(damagedid,"PED","DAM_armL_frmLT",4.0,0,0,0,1,1); }
                 case 
22: { }
                 case 
23: { }
                 case 
24: { ApplyAnimation(damagedid,"PED","DAM_LegL_frmFT",4.0,0,0,0,1,1); }
                 case 
25: { }
                 case 
26: { }
                 case 
27: { ApplyAnimation(damagedid,"PED","DAM_LegR_frmFT",4.0,0,0,0,1,1); }
                 case 
28: { }
                 case 
29: { }
                 case 
30: { ApplyAnimation(damagedid,"PED","DAM_LegL_frmLT",4.0,0,0,0,1,1); }
                 case 
31: { }
                 case 
32: { }
                 case 
33: { ApplyAnimation(damagedid,"PED","DAM_LegR_frmRT",4.0,0,0,0,1,1); }
                 case 
34: { }
                 case 
35: { }
                 case 
36: { ApplyAnimation(damagedid,"PED","DAM_stomach_frmFT",4.0,0,0,0,1,1); }
                 case 
37: { }
                 case 
38: { }
                 case 
39: { ApplyAnimation(damagedid,"PED","DAM_armR_frmFT",4.0,0,0,0,1,1); }
                 case 
40: { }
                 case 
41: { }
                 case 
42: { ApplyAnimation(damagedid,"PED","DAM_armR_frmRT",4.0,0,0,0,1,1); }
                 case 
43: { }
                 case 
44: { }
                 case 
45: { ApplyAnimation(damagedid,"PED","DAM_stomach_frmLT",4.0,0,0,0,1,1); }
                 case 
46: { }
                 case 
47: { }
            }
            
//return 1; 
Reply
#2

Is this what you want to do?

PHP код:
public OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart)
{
    if(
issuerid != INVALID_PLAYER_ID)
    {
        if(
weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 || weaponid == 33 || weaponid == 34 || weaponid == 38)
        {
            switch(
bodypart)
            {
                case 
3// Torso
                
case 4// Groin
                
case 5// Left arm
                
case 6// Right arm
                
case 7// Left leg
                
case 8// Right leg
                
case 9// head
            
}
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)