27.11.2012, 18:04
Hello, I have a stock
GetPlayerRandomSpawn(playerid, Float:rX, Float:rY, Float:rZ)
When it makes the random and says the right coords
I want it to return it to the given float's
like GetPlayerPos(playerid, x, y, z);
meaning:
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z); // Returns coords to X, Y, Z
GetPlayerRandomSpawn(playerid, X, Y, Z); // How to make it return coords to X, Y, Z ?
the stock:
This is my long version, to understand
I dont have a return because I know thats not the way, so what is it ?
Thank you.
GetPlayerRandomSpawn(playerid, Float:rX, Float:rY, Float:rZ)
When it makes the random and says the right coords
I want it to return it to the given float's
like GetPlayerPos(playerid, x, y, z);
meaning:
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z); // Returns coords to X, Y, Z
GetPlayerRandomSpawn(playerid, X, Y, Z); // How to make it return coords to X, Y, Z ?
the stock:
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;
}
// --> HERE HOW TO MAKE IT RETURN TO rX, rY, rZ ?
}
I dont have a return because I know thats not the way, so what is it ?
Thank you.