17.12.2015, 21:57
(
Последний раз редактировалось SickAttack; 17.12.2015 в 22:50.
)
Store the coordinates in the array "aRandomSpawns" and do as followed:
pawn Код:
// ** INCLUDES
#include <a_samp>
// ** DEFINES
// *** GENERAL
#define MAX_POSITIONS 100
// ** ARRAYS AND ENUMERATORS
enum eRandomSpawns
{
Float:random_spawn_x,
Float:random_spawn_y,
Float:random_spawn_z,
Float:random_spawn_angle
};
new aRandomSpawns[MAX_POSITIONS][eRandomSpawns];
// ** MAIN
main()
{
print("Loaded \"random_spawns.amx\".");
}
// ** CALLBACKS
public OnGameModeInit()
{
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerSpawn(playerid)
{
new selected = random(sizeof(aRandomSpawns));
SetPlayerPos(playerid, aRandomSpawns[selected][random_spawn_x], aRandomSpawns[selected][random_spawn_y], aRandomSpawns[selected][random_spawn_z]);
SetPlayerFacingAngle(playerid, aRandomSpawns[selected][random_spawn_angle]);
SetCameraBehindPlayer(playerid);
return 1;
}