Checkpoint
#1

So, I want to make some random checkpoints out of variable. A random checkpoint to a business location.
PHP код:
for(new b=0;b<MAX_STORES;b++) if(stores[b][savings] == 1)
    {
        
stores[b][sx],stores[b][sy],stores[b][sz//To do [random checkpoint]
    

Got any idea? To set a random checkpoint to any business's location.
Reply
#2

Something like ?

pawn Код:
new Float: b_Checkpoints[ ][ 3 ] =
{
    { 0.0, 0.0, 0.0 },
    { 0.0, 0.0, 0.0 },
    { 0.0, 0.0, 0.0 },
    { 0.0, 0.0, 0.0 },
    { 0.0, 0.0, 0.0 }
};

new rand = random( sizeof( b_Checkpoints ) );
SetPlayerCheckpoint( playerid,  stores[b][sx],stores[b][sy],stores[b][sz], 2.0 );
Reply
#3

Well I figured it out.
PHP код:
new count;
for(new 
0;i<MAX_STORES;i++) if(stores[i][savings] == 1)
{
        
count++;
}
new 
random(count);
SetPlayerCheckpointplayerid,  stores[b][sx],stores[b][sy],stores[b][sz], 2.0 ); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)