Код:
#undef MAX_PLAYERS
#define MAX_PLAYERS 100
new PizzaCheckpointP[MAX_PLAYERS][2];
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == PizzaCheckpointP[playerid][0])
{
DestroyDynamicCP(PizzaCheckpointP[playerid][0]);
SCM(playerid,-1,"Welcome");
return 1;
}
if(checkpointid == PizzaCheckpointP[playerid][1])
{
DestroyDynamicCP(PizzaCheckpointP[playerid][1]);
SCM(playerid,-1,"Welcome again.");
}
return 1;
}
CMD:pizza(playerid)
{
switch(random(2))
{
case 0:
{
PizzaCheckpointP[playerid][0] = CreateDynamicCP(1830.7069,-1842.7400,13.5781,4,5,0,playerid,100);
SetPlayerMapIcon(playerid, 1, 1830.7069,-1842.7400,13.5781, 19, 0, MAPICON_GLOBAL);
}
case 1:
{
PizzaCheckpointP[playerid][1] = CreateDynamicCP(1135.1553,-2035.6575,69.0078,4,5,0,playerid,100);
SetPlayerMapIcon(playerid, 1, 1135.1553,-2035.6575,69.0078, 19, 0, MAPICON_GLOBAL);
}
}
return 1;
}
Anyone knows what's wrong in this code, it usually work fine but later when people start going in and out of checkpoint for minutes, it becomes unusable and disappears.