23.12.2015, 12:34
OK... so you want to be a CJ and spawn in some random positons? If yes then follow my steps...
1. First we are going to make a variable! Just add this near the function OnGameModeInIt just like this:
2. Now go to the function OnPlayerSpawn and add this:
And also ignore the warning! It doesn't affect anything! xD
1. First we are going to make a variable! Just add this near the function OnGameModeInIt just like this:
PHP код:
new Float:Positions[][] =
{
{404.0729, 2464.5574, 16.5000, 356.6976},
{-1353.3026, -235.7281, 14.1440, 315.7605},
{1319.9559, 1269.4812, 10.8203, 0.2658},
{-2329.2629, -1626.5853, 483.7054, 331.0678},
{-302.0363, 1525.2842, 75.3594, 358.8640},
{1422.1212, -2541.3335, 13.5469, 270.1175}
};
public OnGameModeInIt()
{
//Your code.
}
PHP код:
public OnPlayerSpawn(playerid)
{
new Random = random(sizeof(Positions));
SetPlayerPos(playerid, Positions[Random][0], Positions[Random][1],Positions[Random][2],Positions[Random][3]);
//Your other code...
}