Quote:
Originally Posted by CaptainBoi
PHP код:
new const Float:g_SpawnGroves[][4] = {
{2495.9788,-1709.5435,1014.7422,359.6140, interiorid},
{2495.9788,-1709.5435,1014.7422,359.6140, interiorid},
{2495.9788,-1709.5435,1014.7422,359.6140, interiorid}
};
its ezy make it like this
PHP код:
new rpos = random(sizeof(g_SpawnGroves));
SetPlayerPos(playerid, g_SpawnGroves[rpos][0], g_SpawnGroves[rpos][1], g_SpawnGroves[rpos][2]);
SetPlayerInterior(playerid, g_SpawnGroves[rpos][3]);
Try it will work as u want
|
Not with the code you have provided! For a start you'll get an error if you insert the interior ID, which is an integer value into the array because the array is for floating point numbers. SetPlayerInterior will also only accept an integer value.
Код:
new Float:g_SpawnGroves[][4] = {
{2495.9788, -1709.5435, 1014.7422, 359.6140}, // X, Y, Z, Angle
{2495.9788, -1709.5435, 1014.7422, 359.6140},
{2495.9788, -1709.5435, 1014.7422, 359.6140}
};
Код:
new rpos = random(sizeof(g_SpawnGroves));
SetPlayerPos(playerid, g_SpawnGroves[rpos][0], g_SpawnGroves[rpos][1], g_SpawnGroves[rpos][2]); // X, Y, Z
SetPlayerFacingAngle(playerid, g_SpawnGroves[rpos][3]); // Angle
SetPlayerInterior(playerid, 3); // set the interior