question
#2

pawn Код:
new Float:RandomSpawn[][4] =
{
    // Positions, (X, Y, Z and Facing Angle)
    {-2796.9854, 1224.8180, 20.5429, 192.0335},
    {-2454.2170, 503.8759, 30.0790, 267.2932},
    {-2669.7322, -6.0874, 6.1328, 89.8853}
};
pawn Код:
public OnPlayerSpawn(playerid)
{
    new rand = random(sizeof(RandomSpawn));
 
    // SetPlayerPos to the random spawn data
    SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
 
    // SetPlayerFacingAngle to the random facing angle data
    SetPlayerFacingAngle(playerid, RandomSpawn[rand][3]);
    return 1;
}
https://sampwiki.blast.hk/wiki/Random
Reply


Messages In This Thread
question - by Christian_Bojic - 24.06.2011, 18:29
Re: question - by Jantjuh - 24.06.2011, 18:31
Re: question - by Christian_Bojic - 24.06.2011, 18:32
Re: question - by Jantjuh - 24.06.2011, 18:34
Re: question - by Christian_Bojic - 24.06.2011, 18:38
Re: question - by Jantjuh - 24.06.2011, 18:44
Re: question - by Christian_Bojic - 24.06.2011, 18:46
Re: question - by Jantjuh - 24.06.2011, 18:50
Re: question - by Christian_Bojic - 24.06.2011, 18:52
Re: question - by Jantjuh - 24.06.2011, 19:53

Forum Jump:


Users browsing this thread: 2 Guest(s)