enum checkCPinfo
{
cpID,
Float:x,
Float:y,
Float:z,
Float:cpSize,
Float:ViewDistance
}
//rest of the code
static const server_CreateCheckpoints[][checkCPinfo] =
{
{1,2159.2742,943.1719,10.8203,1.0,100.0},//Ammunation 4Dragons Entrance
{2,2539.4631,2084.0339,10.8203,1.0,100.0},//Ammunation Emerald Isle Entrance
{3,2286.9143,2432.3669,10.8203,1.0,100.0},//LVPD Entrance
{4,285.7855,-86.7201,1001.5229,1.0,100.0}//Ammunation 4Dragons Exit
/*{5,2286.8674,2431.7437,10.8203,1.0,100.0},
{6,238.7121,139.5305,1003.0234,1.0,100.0}*/
};
stock server_CreateAllCheckpoints()
{
for(new i; i < sizeof(server_CreateCheckpoints); i++)
{
CreateDynamicCP(server_CreateCheckpoints[i][x],server_CreateCheckpoints[i][y],server_CreateCheckpoints[i][z],server_CreateCheckpoints[i][cpSize],-1,-1,-1,server_CreateCheckpoints[i][ViewDistance]);
}
return 1;
}
public OnPlayerEnterDynamicCP(playerid,checkpointid)
{
for(new i=0; i < sizeof(server_CreateCheckpoints); i++) //
{
if(server_CreateCheckpoints[i][cpID] == 0)//Ammunation 4Dragons Entrance
{
SetPlayerPos(playerid,286.4219,-82.7033,1001.5156);
SetPlayerFacingAngle(playerid,293.4572);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid,4);
}
{1,2159.2742,943.1719,10.8203,1.0,100.0},//Ammunation 4Dragons Entrance
if(server_CreateCheckpoints[i][cpID] == 0)//Ammunation 4Dragons Entrance The number 1 and 0 is two different ones. Is that maybe the problem ? |
stock server_CreateAllCheckpoints()
{
for(new i; i < sizeof(server_CreateCheckpoints); i++)
{
server_CreateCheckpoints[i][serverCPiD] = CreateDynamicCP(server_CreateCheckpoints[i][x],server_CreateCheckpoints[i][y],server_CreateCheckpoints[i][z],server_CreateCheckpoints[i][cpSize],-1,-1,-1,server_CreateCheckpoints[i][ViewDistance]);
}
return 1;
}
//--- later
public OnPlayerEnterDynamicCP(playerid,checkpointid)
{
for(new i=0; i < sizeof(server_CreateCheckpoints); i++) //
{
if(server_CreateCheckpoints[i][serverCPiD] == checkpointid)
{
switch( server_CreateCheckpoints[i][cpID] )
{
case 1:
{
// do for cpID = 1
}
case 2:
{
// do for cpID = 2
}
//and so on..
}
break; // not necessarily needed here
}
}
}