09.04.2013, 21:10
Nice of you to write this tutorial, but a couple of things:
Firstly, you didn't actually randomize anything - you just have a variable called Randoming, which contains junk because you didn't give it any value, and you're trying to switch its value - but it doesn't have any, so you'll have to add this:
Second thing is, you can actually make this far easier with two-dimensional arrays:
This will actually save you up a lot of writing space.
Firstly, you didn't actually randomize anything - you just have a variable called Randoming, which contains junk because you didn't give it any value, and you're trying to switch its value - but it doesn't have any, so you'll have to add this:
pawn Код:
new Randoming;
public OnPlayerSpawn(playerid)
{
Randoming = random(2);
switch(Randoming)
{
//
}
return 1;
}
pawn Код:
new randstuff[2][4] = {
{float: 1305.25, float: 524.19, float: 15.04, 100},
{float: 1240.61, float: 1351.35, float: 12.54, 200}
};
public OnPlayerSpawn(playerid)
{
new RandomIze = random(sizeof(randstuff));
SetPlayerPos(playerid, randstuff[RandomIze][0], randstuff[RandomIze][1], randstuff[RandomIze][2]);
GivePlayerMoney(playerid, randstuff[RandomIze][3]);
return 1;
}