Erro onplayertakedamage
#1

Esta dando erro ao compilar codigo :
PHP код:
public OnPlayerTakeDamageplayeridissueridFloat:amountweaponid )
{
    if ( 
playerDataplayerid ][ P_SYNCING ] )
        return 
true
    
new
        
Float:health,
        
Float:damage
    
;
    
GetPlayerHealthplayeridhealth );
    
damage = ( amount health health amount );
    if ( 
issuerid != INVALID_PLAYER_ID )
    {
        if ( 
playerDataissuerid ][ P_PLAYING ] )
        {
            if ( 
playerDataissuerid ][ P_TEAM ] == playerDataplayerid ][ P_TEAM ] )
                return 
true;
            
roundDataplayerDataissuerid ][ P_SLOT ] ][ playerDataissuerid ][ P_TEAM ] ][ playerDamage ] += damage;
            
teamDataplayerDataissuerid ][ P_TEAM ] ][ TEAM_DAMAGE ] += damage;
            if ( 
serverDatacw_enabled ] )
                
playerDataissuerid ][ P_TOTAL_DMG ] += damage;
            
update_infoTxtissuerid );
        }
        
damageHitissuerid ][ playerid ][ ] += damage;
        
damageHitplayerid ][ issuerid ][ ] += damage;
        
// doing_damage
        
if ( playerid != playerDataissuerid ][ P_LAST_HIT ][ ] )
        {
            switch ( 
playerDataissuerid ][ P_HIT_ROWS ][ ] )
            {
                case 
0:
                {
                    
formatdamageStrissuerid ][ ], 128"%s (%s) -%i"playerNameplayerid ), weaponNamesweaponid ], floatrounddamageHitissuerid ][ playerid ][ ] ) );
                    
playerDataissuerid ][ P_HIT_ROWS ][ ] ++;
                }
                case 
1:
                {
                    
formatdamageStrissuerid ][ ], 128"%s (%s) -%i~n~%s"playerNameplayerid ), weaponNamesweaponid ], floatrounddamageHitissuerid ][ playerid ][ ] ), damageStrissuerid ][ ] );
                    
playerDataissuerid ][ P_HIT_ROWS ][ ] ++;
                }
                case 
2:
                {
                    if ( 
strfinddamageStrissuerid ][ ], playerNameplayerid ), true ) != -)
                    {
                        new 
ref64 ];
                        
strmidrefdamageStrissuerid ][ ], 0strfinddamageStrissuerid ][ ], "~n~"true ) );
                        
formatdamageStrissuerid ][ ], 128"%s (%s) -%i~n~%s"playerNameplayerid ), weaponNamesweaponid ], floatrounddamageHitissuerid ][ playerid ][ ] ), ref );
                    }
                    else
                    {
                         
formatdamageStrissuerid ][ ], 128"%s (%s) -%i~n~%s"playerNameplayerid ), weaponNamesweaponid ], floatrounddamageHitissuerid ][ playerid ][ ] ), damageStrissuerid ][ ] );
                        
playerDataissuerid ][ P_HIT_ROWS ][ ] ++;
                    }
                }
                case 
3:
                {
                    new 
lenref64 ];
                    
len strfinddamageStrissuerid ][ ], "~n~"true );
                    
strmidrefdamageStrissuerid ][ ], 0strfinddamageStrissuerid ][ ], "~n~"truelen ) );
                    
formatdamageStrissuerid ][ ], 128"%s (%s) -%i~n~%s"playerNameplayerid ), weaponNamesweaponid ], floatrounddamageHitissuerid ][ playerid ][ ] ), ref );
                }
            }
            
playerDataissuerid ][ P_LAST_HIT ][ ] = playerid;
        }
        else
        {
            new 
lenref64 ];
            
len strfinddamageStrissuerid ][ ], "~n~"true );
            if ( 
len != -)
                
strmidrefdamageStrissuerid ][ ], len 3strlendamageStrissuerid ][ ] ) );
            if ( !
isnullref ) )
                
formatdamageStrissuerid ][ ], 128"%s (%s) -%i~n~%s"playerNameplayerid ), weaponNamesweaponid ], floatrounddamageHitissuerid ][ playerid ][ ] ), ref );
            else
                
formatdamageStrissuerid ][ ], 128"%s (%s) -%i"playerNameplayerid ), weaponNamesweaponid ], floatrounddamageHitissuerid ][ playerid ][ ] ) );
        }
        
PlayerTextDrawSetStringissueriddamageTextissuerid ][ ], damageStrissuerid ][ ] );
        
PlayerTextDrawShowissueriddamageTextissuerid ][ ] );
          
loopPlayersotherid )
        {
             if ( 
GetPlayerStateotherid ) == PLAYER_STATE_SPECTATING && playerDataotherid ][ P_SPECTATING ] == issuerid )
            {
                
PlayerTextDrawSetStringotheriddamageTextotherid ][ ], damageStrissuerid ][ ] );
                
PlayerTextDrawShowotheriddamageTextotherid ][ ] );
                
playerDataotherid ][ P_DAMAGE_INDEX ][ ] = 5;
                
PlayerPlaySoundotherid1780200);
            }
        }
        
// getting_damage
        
if ( issuerid != playerDataplayerid ][ P_LAST_HIT ][ ] )
        {
            switch ( 
playerDataplayerid ][ P_HIT_ROWS ][ ] )
            {
                case 
0:
                {
                    
formatdamageStrplayerid ][ ], 128"%s (%s) -%i"playerNameissuerid ), weaponNamesweaponid ], floatrounddamageHitplayerid ][ issuerid ][ ] ) );
                    
playerDataplayerid ][ P_HIT_ROWS ][ ] ++;
                }
                case 
1:
                {
                    
formatdamageStrplayerid ][ ], 128"%s (%s) -%i~n~%s"playerNameissuerid ), weaponNamesweaponid ], floatrounddamageHitplayerid ][ issuerid ][ ] ), damageStrplayerid ][ ] );
                    
playerDataplayerid ][ P_HIT_ROWS ][ ] ++;
                }
                case 
2:
                {
                    if ( 
strfinddamageStrplayerid ][ ], playerNameissuerid ), true ) != -)
                    {
                        new 
ref64 ];
                        
strmidrefdamageStrplayerid ][ ], 0strfinddamageStrplayerid ][ ], "~n~"true ) );
                        
formatdamageStrplayerid ][ ], 128"%s (%s) -%i~n~%s"playerNameissuerid ), weaponNamesweaponid ], floatrounddamageHitplayerid ][ issuerid ][ ] ), ref );
                    }
                    else
                    {
                         
formatdamageStrplayerid ][ ], 128"%s (%s) -%i~n~%s"playerNameissuerid ), weaponNamesweaponid ], floatrounddamageHitplayerid ][ issuerid ][ ] ), damageStrplayerid ][ ] );
                        
playerDataplayerid ][ P_HIT_ROWS ][ ] ++;
                    }
                }
                case 
3:
                {
                    new 
lenref64 ];
                    
len strfinddamageStrplayerid ][ ], "~n~"true );
                    
strmidrefdamageStrplayerid ][ ], 0strfinddamageStrplayerid ][ ], "~n~"truelen ) );
                    
formatdamageStrplayerid ][ ], 128"%s (%s) -%i~n~%s"playerNameissuerid ), weaponNamesweaponid ], floatrounddamageHitplayerid ][ issuerid ][ ] ), ref );
                }
            }
            
playerDataplayerid ][ P_LAST_HIT ][ ] = issuerid;
        }
        else
        {
            new 
lenref64 ];
            
len strfinddamageStrplayerid ][ ], "~n~"true );
            if ( 
len != -)
                
strmidrefdamageStrplayerid ][ ], len 3strlendamageStrplayerid ][ ] ) );
            if ( !
isnullref ) )
                
formatdamageStrplayerid ][ ], 128"%s (%s) -%i~n~%s"playerNameissuerid ), weaponNamesweaponid ], floatrounddamageHitplayerid ][ issuerid ][ ] ), ref );
            else
                
formatdamageStrplayerid ][ ], 128"%s (%s) -%i"playerNameissuerid ), weaponNamesweaponid ], floatrounddamageHitplayerid ][ issuerid ][ ] ) );
        }
        
PlayerTextDrawSetStringplayeriddamageTextplayerid ][ ], damageStrplayerid ][ ] );
        
PlayerTextDrawShowplayeriddamageTextplayerid ][ ] );
          
loopPlayersotherid )
        {
             if ( 
GetPlayerStateotherid ) == PLAYER_STATE_SPECTATING && playerDataotherid ][ P_SPECTATING ] == playerid )
            {
                
PlayerTextDrawSetStringotheriddamageTextotherid ][ ], damageStrplayerid ][ ] );
                
PlayerTextDrawShowotheriddamageTextotherid ][ ] );
                
playerDataotherid ][ P_DAMAGE_INDEX ][ ] = 5;
                
PlayerPlaySoundotherid113100);
            }
        }
        
playerDataissuerid ][ P_DAMAGE_INDEX ][ ] = 5;
        
playerDataplayerid ][ P_DAMAGE_INDEX ][ ] = 5;
        
PlayerPlaySoundissuerid1780200);
        
PlayerPlaySoundplayerid1131,  00);
    }
    if ( 
serverDatastarted ] )
    {
        if ( 
playerDataplayerid ][ P_PLAYING ] )
        {
            new 
slot findBarSlotplayeridplayerDataplayerid ][ P_TEAM ] );
            
setBarValueplayerDataplayerid ][ P_TEAM ], slot, ( barValueplayerDataplayerid ][ P_TEAM ] ][ slot ] - damage ) );
            
loopPlayersotherid )
            {
                if ( 
playerDataotherid ][ P_CLASS ] == -)
                    
TextDrawShowForPlayerotheridhpBarplayerDataplayerid ][ P_TEAM ] ][ slot ][ ] );
            }
            if ( 
serverDatamodetype ] == BASE || serverDatamodetype ] == ARENA )
            {
                if ( 
teamDataplayerDataplayerid ][ P_TEAM ] ][ TEAM_DMG_INDEX ] ) teamDataplayerDataplayerid ][ P_TEAM ] ][ TEAM_DMG_COMBO ] += damage;
                else                                                                  
teamDataplayerDataplayerid ][ P_TEAM ] ][ TEAM_DMG_COMBO ]  = damage;
                
teamDataplayerDataplayerid ][ P_TEAM ] ][ TEAM_DMG_INDEX ] = 4;
                
teamDataplayerDataplayerid ][ P_TEAM ] ][ TEAM_HEALTH ] -= damage;
                new 
dmgStr16 ];
                
formatdmgStrsizeofdmgStr ), "%s~h~~h~-%i"teamTxtplayerDataplayerid ][ P_TEAM ] ), floatroundteamDataplayerDataplayerid ][ P_TEAM ] ][ TEAM_DMG_COMBO ] ) );
                
TextDrawSetStringtextDrawsteamDamage ][ playerDataplayerid ][ P_TEAM ] ], dmgStr );
            }
        }
    }
    return 
true;

Erros :
PHP код:
C:\Users\User\Desktop\hard.pwn(848) : error 017undefined symbol "playerData"
C:\Users\User\Desktop\hard.pwn(848) : warning 215expression has no effect
C
:\Users\User\Desktop\hard.pwn(848) : error 001expected token";"but found "]"
C:\Users\User\Desktop\hard.pwn(848) : error 029invalid expressionassumed zero
C
:\Users\User\Desktop\hard.pwn(848) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
4 Errors

Reply
#2

You obviously did take this from somewhere else thus it says you have no variable set 'playerData'. Assuming it's the array that holds all the player data, you need to create one yourself.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)