Guardar posiciуn al usar /spec
#1

Hola, tengo esto para guardar la posiciуn del admin cuando usa /spec, asн cuando use /specoff lo setearб en la posiciуn que estaba antes de usar /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 } )
    {
         
PlayerSpawned[playerid] = 0;
        
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
Pero al usar /specoff el admin vuelve a spawnear como si hubiera muerto, por quй? quй estб mal?
Reply
#2

Quita la linea de "SetPlayerPos" de /specoff y cambia los curly braces "{ }" por brackets "[ ]" en "InSpectate".
Reply
#3

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Quita la linea de "SetPlayerPos" de /specoff y cambia los curly braces "{ }" por brackets "[ ]" en "InSpectate".
Sigue igual
Reply
#4

ї Para que te sirve la variable PlayerSpawned[playerid] ?
Reply
#5

Quote:
Originally Posted by alexus
Посмотреть сообщение
ї Para que te sirve la variable PlayerSpawned[playerid] ?
Para nada, fue algo que intentй y no funcionу.

Ya solucionй, metн InSpectate en un if y el resto del callback en un else. Ahora me quedan algunos problemas pero ya los arreglarй, gracias por interesarse en ayudarme.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)