Random Request Class Locations?
#1

Hi,

How do I create random Class Section Locations?



Thanks
Reply
#2

Create an array/enum structure to store all the possible locations, then use random().

enum should include

- Playerpos (x y z angle)
- Interior
- Camera pos (x y z)
- Camera 'lookat' pos (x y z)

Do you want it random for every skin, or do you mean a set skin for every class? If you mean random every time use ^
Reply
#3

Top Of GameMode
pawn Код:
new Float:Locations[4][10] =
{
    {PlayerPosX, PlayerPosY, PlayerPosZ, CamPosX, CamPosY, CamPosZ, LookPosX, LookPosY, LookPosZ, Angle},
    {PlayerPosX, PlayerPosY, PlayerPosZ, CamPosX, CamPosY, CamPosZ, LookPosX, LookPosY, LookPosZ, Angle},
    {PlayerPosX, PlayerPosY, PlayerPosZ, CamPosX, CamPosY, CamPosZ, LookPosX, LookPosY, LookPosZ, Angle},
    {PlayerPosX, PlayerPosY, PlayerPosZ, CamPosX, CamPosY, CamPosZ, LookPosX, LookPosY, LookPosZ, Angle},
    {PlayerPosX, PlayerPosY, PlayerPosZ, CamPosX, CamPosY, CamPosZ, LookPosX, LookPosY, LookPosZ, Angle}
};
[b]In OnPlayerRequestClass
pawn Код:
new rand = random(sizeof(Locations));
    SetPlayerPos(playerid, Locations[rand][0], Locations[rand][1], Locations[rand][2]);
    SetPlayerCameraPos(playerid, Locations[rand][3], Locations[rand][4], Locations[rand][5]);
    SetPlayerCameraLookAt(playerid, Locations[rand][6],Locations[rand][7], Locations[rand][8]);
    SetPlayerFacingAngle(playerid, Locations[rand][9]);
Reply
#4

I mean, Different Locations on every connection. Not by skin changes.

@DarkScripter, It works but once again I wanted it ^^

Thanks
Reply
#5

Bump, Anyone?
Reply
#6

Try to paste DarkScripter's code in callback OnPlayerSpawn it's should work
Reply
#7

there is not way that would work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)