GTA Közösség - A magyar GTA fórum

Hatalmas Archívum => Fórum Archívum (Témák/Fórumok) => A témát indította: ZyZu. - 2013. július 26. - 16:05:59

Cím: random
Írta: ZyZu. - 2013. július 26. - 16:05:59
Paraméterek:
 
(max)

 
max - Az értéke mindig 0 de van amikor az érték -1.
Return - Ennek a funkciónak random a visszatérése, 0 vagy -1.
Példa:
 
new Float:RandomSpawn[][4] =
{
    {-2796.9854, 1224.8180, 20.5429, 192.0335},
    {-2454.2170, 503.8759, 30.0790, 267.2932},
    {-2669.7322, -6.0874, 6.1328, 89.8853}
};

 

public OnPlayerSpawn(playerid)
{
    new rand = random( sizeof( RandomSpawn ));
    SetPlayerPos( playerid, RandomSpawn[ rand ][ 0 ], RandomSpawn[ rand ][ 1 ],RandomSpawn[ rand ][ 2 ]);
    SetPlayerFacingAngle( playerid, RandomSpawn[ rand ][ 3 ]);
    return 1;
}

 
Eredeti Link: http://wiki.sa-mp.com/wiki/Random
Cím: random
Írta: bbTamas - 2013. július 26. - 21:20:24
http://sampforum.hu/index.php?topic=10816.0
http://sampforum.hu/index.php?topic=8808.0
http://sampforum.hu/index.php?topic=31941.0
http://sampforum.hu/index.php?topic=24081.0
Nem baj, az köszönjük az írást. :D