SA-MP Forums Archive
Question Help: Facing Angle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Question Help: Facing Angle (/showthread.php?tid=355821)



Question Help: Facing Angle - Speed++ - 01.07.2012

in this very simple example, i have included, the angle.. but when i spawn set me the wrong facing angle.. why ? the coordinates are right..

PHP код:
new FloatExampleRandomSpawn[][4] =
{
    {-
2796.98541224.818020.5429192.0335},
    {-
2454.2170503.875930.0790267.2932},
    {-
2669.7322, -6.08746.132889.8853}
}; 
PHP код:
public OnPlayerSpawn(playerid)
{
    new 
rand random(sizeof(ExampleRandomSpawn));
    
SetPlayerPos(playeridExampleRandomSpawn[rand][0], ExampleRandomSpawn[rand][1], ExampleRandomSpawn[rand][2]);
 
    
SetPlayerFacingAngle(playeridExampleRandomSpawn[rand][3]);
    return 
1;




Re: Question Help: Facing Angle - Finn - 01.07.2012

Weird, try SetSpawnInfo.

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    new rand = random(sizeof(ExampleRandomSpawn));

    SetSpawnInfo(playerid, team, skin, ExampleRandomSpawn[rand][0], ExampleRandomSpawn[rand][1], ExampleRandomSpawn[rand][2], ExampleRandomSpawn[rand][3], weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
}



Re: Question Help: Facing Angle - Speed++ - 01.07.2012

Quote:
Originally Posted by Finn
Посмотреть сообщение
Weird, try SetSpawnInfo.

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    new rand = random(sizeof(ExampleRandomSpawn));

    SetSpawnInfo(playerid, team, skin, ExampleRandomSpawn[rand][0], ExampleRandomSpawn[rand][1], ExampleRandomSpawn[rand][2], ExampleRandomSpawn[rand][3], weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
}
SetSpawnInfo(...);

... There are parameters that do not serve me


Re: Question Help: Facing Angle - Finn - 01.07.2012

So leave them 0 and set them afterwards how you want.


Re: Question Help: Facing Angle - Speed++ - 01.07.2012

Quote:
Originally Posted by Finn
Посмотреть сообщение
So leave them 0 and set them afterwards how you want.
mhm... set me to the coordinates 0.0, 0.0, 0.0 ,0.0 ... when i spawn

PHP код:
            new
                
rand random(sizeof(ExampleRandomSpawn));
                
            
SetSpawnInfo(playerid, -1, -1ExampleRandomSpawn[rand][0], ExampleRandomSpawn[rand][1], ExampleRandomSpawn[rand][2], ExampleRandomSpawn[rand][3], 912640032400); 
and in the top i have definied the coordinates...


Re: Question Help: Facing Angle - LaGrande - 01.07.2012

maybe this function will help
pawn Код:
SpawnPlayer(playerid);
Place this under ur SetSpawnInfo