27.11.2012, 18:16
EDIT: Just read your first post again, I didn't read it correctly sorry, this reply may be useless to you.
You can't return more than 1 value of information (I beleive) from a function. This code still works, you just need to create a variable, and this function basically will add values to that variable.
Example:
Add return 1 on to that code of yours. It may also be worth adding an angle.
You can't return more than 1 value of information (I beleive) from a function. This code still works, you just need to create a variable, and this function basically will add values to that variable.
Example:
pawn Код:
new Float:RandomSpawn[3];
GetPlayerRandomSpawn(playerid, RandomSpawn[0], RandomSpawn[1], RandomSpawn[2]);
SetSpawnInfo(playerid, 0, 0, RandomSpawn[0], RandomSpawn[1], RandomSpawn[2], 180.00, 0, 0, 0, 0, 0, 0);
pawn Код:
stock GetPlayerRandomSpawn(playerid, Float:rX, Float:rY, Float:rZ)
{
// --> DO RANDOM SPAWN.
new rnumber = rand(0, 6);
if(rnumber == 0)
{
rX = 0.0;
rY = 0.0;
rZ = 0.0;
}
if(rnumber == 1)
{
rX = 1.0;
rY = 1.0;
rZ = 1.0;
}
if(rnumber == 2)
{
rX = 2.0;
rY = 2.0;
rZ = 2.0;
}
if(rnumber == 3)
{
rX = 3.0;
rY = 3.0;
rZ = 3.0;
}
if(rnumber == 4)
{
rX = 4.0;
rY = 4.0;
rZ = 4.0;
}
if(rnumber == 5)
{
rX = 5.0;
rY = 5.0;
rZ = 5.0;
}
if(rnumber == 6)
{
rX = 6.0;
rY = 6.0;
rZ = 6.0;
}
return 1;
}