Help whit save position to use /spec
#1

Hello, I have this to save the position of the admin when you use /spec, so when you use /specoff as set in the position it was before using /spec.

PHP код:
new 
    
FloatSave_PositionMAX_PLAYERS ][ ], 
    
boolInSpectateMAX_PLAYERS 

OnPlayerConnect
PHP код:
        Save_Positionplayerid ][ ] = 0.0
    
Save_Positionplayerid ][ ] = 0.0
    
Save_Positionplayerid ][ ] = 0.0
    
Save_Positionplayerid ][ ] = 0.0
    
InSpectateplayerid ] = false
OnPlayerSpawn
PHP код:
    if( InSpectateplayerid ] ) 
    { 
        
SetPlayerPosplayeridSave_Positionplayerid ][ ], Save_Positionplayerid ][ ], Save_Positionplayerid ][ ] ); 
           
SetPlayerFacingAngleplayeridSave_Positionplayerid ][ ] ); 
        
InSpectateplayerid ] = false
    } 
/spec
PHP код:
                new SpecID[MAX_PLAYERS]; 
                new 
id
                new 
string[44]; 
                
GetPlayerPosplayeridSave_Positionplayerid ][ ], Save_Positionplayerid ][ ], Save_Positionplayerid ][ ] ); 
                
GetPlayerFacingAngleplayeridSave_Positionplayerid ][ ] ); 
                
InSpectateplayerid } = true
                
TogglePlayerSpectating(playerid1); 
                
SpecID[playerid] = id
                return 
1
/specoff
PHP код:
                TogglePlayerSpectating(playerid0); 
                
SetPlayerPosplayeridSave_Positionplayerid ][ ], Save_Positionplayerid ][ ], Save_Positionplayerid ][ ] ); 
                   return 
1
But when you use /specoff the admin returns to spawn as if he had died, why? What is wrong?
Reply


Messages In This Thread
Help whit save position to use /spec - by Guss - 22.05.2015, 18:15
Re: Help whit save position to use /spec - by AlonzoTorres - 22.05.2015, 18:27
Respuesta: Re: Help whit save position to use /spec - by Guss - 22.05.2015, 18:31
Re: Help whit save position to use /spec - by AlonzoTorres - 22.05.2015, 18:35
Re: Help whit save position to use /spec - by SickAttack - 22.05.2015, 18:46
Respuesta: Help whit save position to use /spec - by alexus - 22.05.2015, 18:48
Respuesta: Re: Help whit save position to use /spec - by Guss - 22.05.2015, 18:56

Forum Jump:


Users browsing this thread: 1 Guest(s)