25.05.2013, 03:00
So I've created a set of random checkpoints. I want it so when a player enters a checkpoint he will get 980$, and it will kill the remaining checkpoints until the player does /startflight again. How would I assign a variable to a set of random checkpoints?
Relevant code:
Relevant code:
pawn Код:
new Float:RandomDropOff[4][] =
{
{1609.1157,1642.1429,10.8203, 10.0},
{404.6019,2483.4902,16.4844, 10.0},
{-1345.8822,-522.7991,14.1484,10.0},
{-1051.5347,-1195.1558,129.0394,10.0}
};
pawn Код:
CMD:startflight(playerid, params[])
{
new rand = random(sizeof(RandomDropOff));
SetPlayerCheckpoint(playerid, RandomDropOff[rand][0], RandomDropOff[rand][1], RandomDropOff[rand][2], RandomDropOff[rand][3]);
return 1;
}
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
//what would i add here?
return 1;
}