Stock returns 3 different float's
#2

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:

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);
Add return 1 on to that code of yours. It may also be worth adding an angle.

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;
}
Reply


Messages In This Thread
Stock returns 3 different float's - by gold - 27.11.2012, 18:04
Re: Stock returns 3 different float's - by Bicentric - 27.11.2012, 18:16
Re: Stock returns 3 different float's - by gold - 27.11.2012, 18:19
Re: Stock returns 3 different float's - by Bicentric - 27.11.2012, 18:22
Re: Stock returns 3 different float's - by gold - 27.11.2012, 18:32
Re: Stock returns 3 different float's - by gold - 28.11.2012, 11:10
AW: Stock returns 3 different float's - by Skimmer - 28.11.2012, 13:39
Re: Stock returns 3 different float's - by gold - 29.11.2012, 11:06

Forum Jump:


Users browsing this thread: 1 Guest(s)