[Pedido] random
#1

Queria ajuda de voces para criar uma random para os players nascer nas cordenada abaixo.

pawn Код:
(1380.0412597656,-43.031181335449,1000.9254760742)
(1380.0412597656,-38.639026641846,1000.9254760742)
(1380.0412597656,-34.365936279297,1000.9254760742)
(1380.0412597656,-30.123250961304,1000.9254760742)
(1380.0412597656,-26.024021148682,1000.9254760742)
(1363.7985839844,-26.058116912842,1000.9254760742)
(1363.7985839844,-30.883451461792,1000.9254760742)
(1363.7985839844,-34.365936279297,1000.9254760742)
(1363.7985839844,-38.639026641846,1000.9254760742)
(1363.7985839844,-43.031181335449,1000.9254760742)
(1380.0412597656,-43.031181335449,1005.3444824219)
(1380.0412597656,-38.639026641846,1005.3444824219)
(1380.0412597656,-34.365936279297,1005.3444824219)
(1380.0412597656,-30.123250961304,1005.3444824219)
(1380.0412597656,-26.024021148682,1005.3444824219)
(1363.7985839844,-26.058116912842,1005.3444824219)
(1363.7985839844,-30.883451461792,1005.3444824219)
(1363.7985839844,-34.365936279297,1005.3444824219)
(1363.7985839844,-38.639026641846,1005.3444824219)
(1363.7985839844,-43.031181335449,1005.3444824219)
Reply
#2

kra aprenda a usar a wiki samp.
https://sampwiki.blast.hk/wiki/Random


#Edited

pawn Код:
new Float:xSpawn [ ] [ 4 ] =
{
    { 1380.0412597656, -43.031181335449, 1000.9254760742, 250.250 },
    { 1380.0412597656, -38.639026641846, 1000.9254760742, 250.250 },
    { 1380.0412597656, -34.365936279297, 1000.9254760742, 250.250 },
    { 1380.0412597656, -30.123250961304, 1000.9254760742, 250.250 },
    { 1380.0412597656, -26.024021148682, 1000.9254760742, 250.250 },
    { 1363.7985839844, -26.058116912842, 1000.9254760742, 250.250 },
    { 1363.7985839844, -30.883451461792, 1000.9254760742, 250.250 },
    { 1363.7985839844, -34.365936279297, 1000.9254760742, 250.250 },
    { 1363.7985839844, -38.639026641846, 1000.9254760742, 250.250 },
    { 1363.7985839844, -43.031181335449, 1000.9254760742, 250.250 },
    { 1380.0412597656, -43.031181335449, 1005.3444824219, 250.250 },
    { 1380.0412597656, -38.639026641846, 1005.3444824219, 250.250 },
    { 1380.0412597656, -34.365936279297, 1005.3444824219, 250.250 },
    { 1380.0412597656, -30.123250961304, 1005.3444824219, 250.250 },
    { 1380.0412597656, -26.024021148682, 1005.3444824219, 250.250 },
    { 1363.7985839844, -26.058116912842, 1005.3444824219, 250.250 },
    { 1363.7985839844, -30.883451461792, 1005.3444824219, 250.250 },
    { 1363.7985839844, -34.365936279297, 1005.3444824219, 250.250 },
    { 1363.7985839844, -38.639026641846, 1005.3444824219, 250.250 },
    { 1363.7985839844, -43.031181335449, 1005.3444824219, 250.250 }
} ;
pawn Код:
public OnPlayerSpawn ( playerid )
{
    new MyRandom = random ( sizeof ( xSpawn ) ) ;
   
    SetPlayerPos ( playerid, xSpawn [ MyRandom ] [ 0 ], xSpawn [ MyRandom ] [ 1 ], xSpawn [ MyRandom ] [ 2 ] ) ;
   
    SetPlayerFacingAngle ( playerid, xSpawn [ MyRandom ] [ 3 ] ) ;
    return 1;
}
Reply
#3

Quote:
Originally Posted by iSmirnoff
Посмотреть сообщение
kra aprenda a usar a wiki samp.
https://sampwiki.blast.hk/wiki/Random


#Edited

pawn Код:
new Float:xSpawn [ ] [ 4 ] =
{
    { 1380.0412597656, -43.031181335449, 1000.9254760742, 250.250 },
    { 1380.0412597656, -38.639026641846, 1000.9254760742, 250.250 },
    { 1380.0412597656, -34.365936279297, 1000.9254760742, 250.250 },
    { 1380.0412597656, -30.123250961304, 1000.9254760742, 250.250 },
    { 1380.0412597656, -26.024021148682, 1000.9254760742, 250.250 },
    { 1363.7985839844, -26.058116912842, 1000.9254760742, 250.250 },
    { 1363.7985839844, -30.883451461792, 1000.9254760742, 250.250 },
    { 1363.7985839844, -34.365936279297, 1000.9254760742, 250.250 },
    { 1363.7985839844, -38.639026641846, 1000.9254760742, 250.250 },
    { 1363.7985839844, -43.031181335449, 1000.9254760742, 250.250 },
    { 1380.0412597656, -43.031181335449, 1005.3444824219, 250.250 },
    { 1380.0412597656, -38.639026641846, 1005.3444824219, 250.250 },
    { 1380.0412597656, -34.365936279297, 1005.3444824219, 250.250 },
    { 1380.0412597656, -30.123250961304, 1005.3444824219, 250.250 },
    { 1380.0412597656, -26.024021148682, 1005.3444824219, 250.250 },
    { 1363.7985839844, -26.058116912842, 1005.3444824219, 250.250 },
    { 1363.7985839844, -30.883451461792, 1005.3444824219, 250.250 },
    { 1363.7985839844, -34.365936279297, 1005.3444824219, 250.250 },
    { 1363.7985839844, -38.639026641846, 1005.3444824219, 250.250 },
    { 1363.7985839844, -43.031181335449, 1005.3444824219, 250.250 }
} ;
pawn Код:
public OnPlayerSpawn ( playerid )
{
    new MyRandom = random ( sizeof ( xSpawn ) ) ;
   
    SetPlayerPos ( playerid, xSpawn [ MyRandom ] [ 0 ], xSpawn [ MyRandom ] [ 1 ], xSpawn [ MyRandom ] [ 2 ] ) ;
   
    SetPlayerFacingAngle ( playerid, xSpawn [ MyRandom ] [ 3 ] ) ;
    return 1;
}
vlw
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)