Class help
#8

Quote:
Originally Posted by Threshold
Посмотреть сообщение
Why are you using GetPlayerPos when you already have the coordinates that the player is going to be put on? SetPlayerPos probably hasn't been fully executed by the time you use GetPlayerPos, so the coordinates are a somewhat delayed version.

PHP код:
        SetPlayerTeamFromClass(playerid,classid); 
        
SetPlayerPos(playerid1558.1510, -1370.1229330.0528);
        
// SetPlayerFacingAngle(playerid, ...); ?
        
new Float:A// Remove if using SetPlayerFacingAngle
        
GetPlayerFacingAngle(playeridA); // If you're going to use SetPlayerFacingAngle, use the angle from that instead.
        
SetPlayerCameraPos(playerid1558.1510 + (floatsin(-A,degrees)), -1370.1229 + (floatcos(-A,degrees), 330.0528 1.0); 
        
SetPlayerCameraLookAt(playerid1558.1510, -1370.1229330.0528); 
Though there is a lazy but clean way of doing this, which could be helpful if you decide that you want to change these coordinates in the future.

PHP код:
    new 
        
Float:pX 1558.1510,
        
Float:pY = -1370.1229,
        
Float:pZ 330.0528,
        
Float:pA 0.0
    
;
    
SetPlayerTeamFromClass(playerid,classid); 
    
SetPlayerPos(playeridpXpYpZ);
    
SetPlayerFacingAngle(playeridpA);
    
SetPlayerCameraPos(playeridpX + (4.0 floatsin(-pAdegrees)), pY + (4.0 floatcos(-pAdegrees)), pZ 1.0); 
    
SetPlayerCameraLookAt(playeridpXpYpZ); 
What is R in here?
Reply


Messages In This Thread
Class help - by StrikerZ - 06.11.2016, 08:58
Re: Class help - by Killa[DGZ] - 06.11.2016, 09:24
Re: Class help - by StrikerZ - 06.11.2016, 09:44
Re: Class help - by Killa[DGZ] - 06.11.2016, 10:03
Re: Class help - by StrikerZ - 06.11.2016, 10:21
Re: Class help - by Killa[DGZ] - 06.11.2016, 10:46
Re: Class help - by Threshold - 06.11.2016, 12:03
Re: Class help - by StrikerZ - 06.11.2016, 13:19

Forum Jump:


Users browsing this thread: 1 Guest(s)