19.06.2014, 05:09
Well i have setted up a command that sets players on random vehicles, but i can't understand exactly how "random" works beyond setting up random positions. I've searched the wiki and tutorials, sadly all of them only shows how to use random on that specific case. What i want to do is, when a player uses /join, he gets set inside one of these vehicles, and eliminate the risk of players being choosen by occupied cars, this is how i am trying to do it:
pawn Код:
new eventcars[][8] =
{
{517, 494, 504, 525},
{588, 524, 495, 543} //
};
CMD:join(playerid, params[]) // this code is down below the entire script.
{
else // some code lines on top of else.
{
if(derbydm[playerid] == true)
{
new randcar = random(sizeof(eventcars));
SendClientMessage(playerid, -1, "You have joined the derby DM!");
playingderbydm[playerid]++;
PutPlayerInVehicle(playerid, eventcars[randcar][0], 0);
}
}
return 1;
}