30.01.2014, 19:30
А у меня работает. Попробуй провести дебаг. Протестил сразу на 2-ух чекпоинтах:
pawn Код:
#define max_checkpoint 2
static checkpoint[max_checkpoint][max_players];
pawn Код:
public OnPlayerConnect(playerid)
{
checkpoint[0][playerid] = CreateDynamicCP(2051.7625, -1916.4253, 13.5469, 0.3, -1, -1, playerid, 1.5);// 1
printf("debug: OnPlayerConnect: checkpoint[0][playerid] = %d", checkpoint[0][playerid]);
checkpoint[1][playerid] = CreateDynamicCP(2054.7649, -1911.9695, 13.5469, 0.3, -1, -1, playerid, 1.5);// 2
printf("debug: OnPlayerConnect: checkpoint[1][playerid] = %d", checkpoint[1][playerid]);
return 1;
}
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
printf("debug: OnPlayerEnterDynamicCP: checkpointid = %d", checkpointid);
if(checkpointid == checkpoint[0][playerid]) return SendClientMessage(playerid, -1, "Тест 1");
if(checkpointid == checkpoint[1][playerid]) return SendClientMessage(playerid, -1, "Тест 2");
return 1;
}
/*
Результат дебага:
[00:17:16] debug: OnPlayerConnect: checkpoint[0][playerid] = 1
[00:17:16] debug: OnPlayerConnect: checkpoint[1][playerid] = 2
[00:17:34] debug: OnPlayerEnterDynamicCP: checkpointid = 1
[00:17:42] debug: OnPlayerEnterDynamicCP: checkpointid = 2
[00:17:53] debug: OnPlayerEnterDynamicCP: checkpointid = 1
[00:18:00] debug: OnPlayerEnterDynamicCP: checkpointid = 2
[00:18:03] debug: OnPlayerEnterDynamicCP: checkpointid = 2
[00:18:04] debug: OnPlayerEnterDynamicCP: checkpointid = 2
[00:18:06] debug: OnPlayerEnterDynamicCP: checkpointid = 2
[00:18:10] debug: OnPlayerEnterDynamicCP: checkpointid = 1
[00:18:12] debug: OnPlayerEnterDynamicCP: checkpointid = 1
[00:18:13] debug: OnPlayerEnterDynamicCP: checkpointid = 1
*/