06.08.2010, 00:12
Here are some examples, hope they help you...
pawn Код:
new ExCPS[6];
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
for(new x=0; x<sizeof(ExCPS)-1, x++)
{
if(checkpointid == ExCPS[x])
{
new str[40];
format(str, sizeof(str), "You entered CP ID %d", x);
SendClientMessage(playerid, 0xFAFAFAFA, str);
break;
}
}
return 1;
}
pawn Код:
new ExCPS[6];
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == ExCPS[0])
{
SendClientMessage(playerid, 0xFAFAFAFA, "You entered a checkpoint");
}
else if(checkpointid == ExCPS[1])
{
SendClientMessage(playerid, 0xFAFAFAFA, "You entered a checkpoint");
}
else if(checkpointid == ExCPS[2])
{
SendClientMessage(playerid, 0xFAFAFAFA, "You entered a checkpoint");
}
else if(checkpointid == ExCPS[3])
{
SendClientMessage(playerid, 0xFAFAFAFA, "You entered a checkpoint");
}
//And so on...
return 1;
}

