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);
public OnPlayerEnterCheckpoint(playerid)
{
//randomcheckpoints
// if checkpoints is RandomCP1 [rand] [0]
if ... ( what is this line ) xD
new rand = random(sizeof(RandomCP)); SetPlayerCheckpoint(playerid, RandomCP1[rand][0], RandomCP1[rand][1],RandomCP1[rand][2],3.0); PlayerInfo[playerid][checkpointone]=1;
public OnPlayerEnterCheckpoint(playerid)
{
//randomcheckpoints
// if checkpoints is RandomCP1 [rand] [0]
if( PlayerInfo[playerid][checkpointone]==1)
{
//code here
PlayerInfo[playerid][checkpointone]=0;
}
return 1;
}
|
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; Код:
public OnPlayerEnterCheckpoint(playerid)
{
//randomcheckpoints
// if checkpoints is RandomCP1 [rand] [0]
if( PlayerInfo[playerid][checkpointone]==1)
{
//code here
PlayerInfo[playerid][checkpointone]=0;
}
return 1;
}
|