SA-MP Forums Archive
Guardar posiciуn al usar /spec - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Guardar posiciуn al usar /spec (/showthread.php?tid=574966)



Guardar posiciуn al usar /spec - Guss - 22.05.2015

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?


Re: Guardar posiciуn al usar /spec - SickAttack - 22.05.2015

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


Respuesta: Re: Guardar posiciуn al usar /spec - Guss - 22.05.2015

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


Respuesta: Guardar posiciуn al usar /spec - alexus - 22.05.2015

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


Respuesta: Guardar posiciуn al usar /spec - Guss - 22.05.2015

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.