Random spawn issues
#2

Try this out, make sure the numbers shown match the one in the array, also try /test if it didn't work..
pawn Код:
new const Float:RandomSpawn[][] =
{
    {2306.0535, -1446.5651, 24.0000,    75.8864},
    {1970.6683, -1157.1238, 20.9617,    90.8634},
    {1390.2864, -1897.6819, 13.4965,    82.2570},
    {387.0234-1883.5343, 2.3005,     95.0150},
    {416.5878-1226.4982, 51.5078,    219.0017},
    {1163.1176, -557.0670104.9141,   169.7962},
    {2683.5549, -1013.8604, 86.5123,    169.4265},
    {2898.0034, -2050.8911, 3.5724,     93.5175},
    {987.4784-2104.3362, 13.0938,    10.2801},
    {812.7135-1205.9515, 16.9766,    263.7184},
    {1153.7455, -1180.6028, 32.8187,    103.9484},
    {1513.1530, -1385.2484, 14.0391,    263.7637}
};
   
public OnPlayerSpawn(playerid)
{
    new Random = random(sizeof(RandomSpawn));
    SetPlayerPos(playerid, RandomSpawn[Random][0], RandomSpawn[Random][1], RandomSpawn[Random][2]);
    SetPlayerFacingAngle(playerid,RandomSpawn[Random][3]);
   
    format(string, sizeof(string), "%d| %f, %f, %f", Random, RandomSpawn[Random][0], RandomSpawn[Random][1], RandomSpawn[Random][2]);
    SendClientMessage(playerid, -1, string);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/test", true))
    {
        new Random = random(sizeof(RandomSpawn));
        SetPlayerPos(playerid, RandomSpawn[Random][0], RandomSpawn[Random][1], RandomSpawn[Random][2]);
        SetPlayerFacingAngle(playerid,RandomSpawn[Random][3]);

        format(string, sizeof(string), "%d| %f, %f, %f", Random, RandomSpawn[Random][0], RandomSpawn[Random][1], RandomSpawn[Random][2]);
        SendClientMessage(playerid, -1, string);

        return 1;
    }
    return 0;
}
Reply


Messages In This Thread
Random spawn issues - by Hybris - 20.09.2015, 15:03
Re: Random spawn issues - by xVIP3Rx - 20.09.2015, 16:11
Re: Random spawn issues - by Hybris - 20.09.2015, 16:33

Forum Jump:


Users browsing this thread: 1 Guest(s)