SetPlayerPos not always working
#5

Quote:
Originally Posted by Dokins
Посмотреть сообщение
Change
pawn Код:
random(10);
to
pawn Код:
random(9);
- remember, computers start at 0. It doesn't work each time because if 10 was selected there is no definition of it, so it panics and doesn't know what to do.
That's what he did, there's 10 digits, 0 = 1, 1 = 2..There would still be 10 numbers


Maybe this would work better;
pawn Код:
new Float:HydraSpawns[10][4] = {
    {307.7739,1805.6658,18.5583,2},
    {309.0186,2054.4512,18.5585,179},
    //The rest of them
}

public OnPlayerSpawn(playerid)
{
    if(IsInVDM[playerid] == 1)
    {
        new rand = random(sizeof(HydraSpawns));
        SetPlayerPos(playerid, HydraSpawns[rand][0], HydraSpawns[rand][1], HydraSpawns[rand][2]);
        SetPlayerFacingAngle(playerid, HydraSpawns[rand][3]);
        SetCameraBehindPlayer(playerid);
    }
}
Reply


Messages In This Thread
SetPlayerPos not always working - by McCarthy - 20.01.2012, 18:00
Re: SetPlayerPos not always working - by Dokins - 20.01.2012, 18:02
Re: SetPlayerPos not always working - by McCarthy - 20.01.2012, 18:03
Re: SetPlayerPos not always working - by Dokins - 20.01.2012, 18:06
Re: SetPlayerPos not always working - by [ABK]Antonio - 20.01.2012, 18:24

Forum Jump:


Users browsing this thread: 3 Guest(s)