help me Random Checkpoint
#1

i have a code
Код:
new Float:RandomCP[3][4] =
{
    // Positions, (X, Y, Z and Facing Angle)
    {1271.8822,-1250.7874,14.1605,0.8398},
    {1281.0437,-1241.8680,13.8490,5.6676},
    {1228.8048,-1269.2982,13.5563,358.2112}
};
Код:
new rand = random(sizeof(RandomCP));
			SetPlayerCheckpoint(playerid, RandomCP1[rand][0], RandomCP1[rand][1],RandomCP1[rand][2],3.0);
And now, I want to set proviso for a part (RandomCP1 [rand] [0]), what should I do?

Ex for my words:
Код:
public OnPlayerEnterCheckpoint(playerid)
{
	//randomcheckpoints
	// if checkpoints is RandomCP1 [rand] [0]
	if ... ( what is this line ) xD
Please Help meeee !
Reply
#2

If you have playerinfo / playervalue enum do like

add here
Код:
new rand = random(sizeof(RandomCP));
			SetPlayerCheckpoint(playerid, RandomCP1[rand][0], RandomCP1[rand][1],RandomCP1[rand][2],3.0);
PlayerInfo[playerid][checkpointone]=1;
then do

Код:
public OnPlayerEnterCheckpoint(playerid)
{
	//randomcheckpoints
	// if checkpoints is RandomCP1 [rand] [0]
	if( PlayerInfo[playerid][checkpointone]==1)
        {
              //code here
              PlayerInfo[playerid][checkpointone]=0;
         }
    return 1;
}
Reply
#3

Quote:
Originally Posted by BlueGames
Посмотреть сообщение
If you have playerinfo / playervalue enum do like

add here
Код:
new rand = random(sizeof(RandomCP));
			SetPlayerCheckpoint(playerid, RandomCP1[rand][0], RandomCP1[rand][1],RandomCP1[rand][2],3.0);
PlayerInfo[playerid][checkpointone]=1;
then do

Код:
public OnPlayerEnterCheckpoint(playerid)
{
	//randomcheckpoints
	// if checkpoints is RandomCP1 [rand] [0]
	if( PlayerInfo[playerid][checkpointone]==1)
        {
              //code here
              PlayerInfo[playerid][checkpointone]=0;
         }
    return 1;
}
yeahh , I have succeeded and thanks very much
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)