random check points
#4

pawn Код:
#include <a_samp>
#include <YSI\y_iterate>

public OnGameModeInit( )
{
    SetTimer( "RandomCheckPoint" , 20000, true );
    return true;
}

forward RandomCheckPoint( );

new Float:RandomCP[  ][ 4 ] = // change this to 4, number starts from 0 not 1
{
    { 2798.1702,-1576.2926,10.9272, 10.0 },
    { 2060.4375,-2091.2126,13.5469, 10.0 },
    { 070.8125,-2384.6160,13.5469, 10.0 },
    { 900.7358,-1204.0779,16.9832, 10.0 },
    { 800.1103,-1542.8258,13.5526, 10.0 }
};


public RandomCheckPoint()
{
    foreach(Player, i)
    {
        if(!IsPlayerConnected(i)) continue;
       
        new rand = random( sizeof( RandomCP ) );
        SetPlayerCheckpoint( i, RandomCP[rand][0], RandomCP[rand][1], RandomCP[rand][2], RandomCP[rand][3] ); // this aswell
    }
    return 1;
}
The code above explains

Remember this, everyone you create an array it always STARTS at Null = 0
Reply


Messages In This Thread
random check points - by Voxel - 26.11.2013, 16:43
Re: random check points - by Dragonsaurus - 26.11.2013, 16:50
Re: random check points - by Voxel - 26.11.2013, 16:54
Re: random check points - by Patrick - 26.11.2013, 16:55
Re: random check points - by Dragonsaurus - 26.11.2013, 16:58
Re: random check points - by Voxel - 26.11.2013, 16:59

Forum Jump:


Users browsing this thread: 1 Guest(s)