Propper spawning and class selection help
#2

But interior must be 0. If you want to change the interior, then add it to the array.

That should work I guess, change the data to the array. I've added:
X, Y, Z, Angle, Camera Pos X, Camera Pos Y, Camera Pos Z, Camera Look At X, Camera Look At Y, Camera Look At Z.
pawn Код:
new
    Player_RS[ MAX_PLAYERS ],
   
    Float: RandomSpawn[ ][ 10 ] =
    {
        { X, Y, Z, Angle, CameraPos_X, CameraPos_Y, CameraPos_Z, CameraLookAt_X, CameraLookAt_Y, CameraLookAt_Z }, // CHANGE ME!
        { X, Y, Z, Angle, CameraPos_X, CameraPos_Y, CameraPos_Z, CameraLookAt_X, CameraLookAt_Y, CameraLookAt_Z }, // CHANGE ME!
        { X, Y, Z, Angle, CameraPos_X, CameraPos_Y, CameraPos_Z, CameraLookAt_X, CameraLookAt_Y, CameraLookAt_Z } // CHANGE ME!
    }
;
pawn Код:
public OnGameModeInit( )
{
    AddPlayerClass( 5, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0 );
    return 1;
}
pawn Код:
public OnPlayerRequestClass( playerid, classid )
{
    Player_RS = random( sizeof( RandomSpawn ) );
   
    SetPlayerPos( playerid, RandomSpawn[ Player_RS ][ 0 ], RandomSpawn[ Player_RS ][ 1 ], RandomSpawn[ Player_RS ][ 2 ] );
    SetPlayerCameraPos( playerid, RandomSpawn[ Player_RS ][ 4 ], RandomSpawn[ Player_RS ][ 5 ], RandomSpawn[ Player_RS ][ 6 ] );
    SetPlayerCameraLookAt( playerid, RandomSpawn[ Player_RS ][ 7 ], RandomSpawn[ Player_RS ][ 8 ], RandomSpawn[ Player_RS ][ 9 ] );
    return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerPos( playerid, RandomSpawn[ Player_RS ][ 0 ], RandomSpawn[ Player_RS ][ 1 ], RandomSpawn[ Player_RS ][ 2 ] );
    SetPlayerFacingAngle( playerid, RandomSpawn[ Player_RS ][ 3 ] );
    return 1;
}
Reply


Messages In This Thread
Propper spawning and class selection help - by knackworst - 03.09.2013, 17:54
Re: Propper spawning and class selection help - by Konstantinos - 03.09.2013, 18:26

Forum Jump:


Users browsing this thread: 1 Guest(s)