Save floats to array? [REP]
#3

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Store the coordinates in the array "aRandomSpawns" and do as followed:

pawn Код:
// ** INCLUDES

#include <a_samp>

// ** ARRAYS AND ENUMERATORS

enum eRandomSpawns
{
    Float:random_spawn_x,
    Float:random_spawn_y,
    Float:random_spawn_z,
    Float:random_spawn_angle
};

new aRandomSpawns[][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;
}
Ty but i store like this now:
aRandomSpawns[random_spawn_x] = mapValues1[pMXs1];

But i got an error.
array sizes do not match, or destination array is too small
Reply


Messages In This Thread
Save floats to array? [REP] - by TobsenMTA - 17.12.2015, 21:31
Re: Save floats to array? [REP] - by SickAttack - 17.12.2015, 21:57
Re: Save floats to array? [REP] - by TobsenMTA - 17.12.2015, 22:47
Re: Save floats to array? [REP] - by SickAttack - 17.12.2015, 22:51
Re: Save floats to array? [REP] - by TobsenMTA - 18.12.2015, 00:28
Re: Save floats to array? [REP] - by SickAttack - 18.12.2015, 01:35

Forum Jump:


Users browsing this thread: 1 Guest(s)