Проблема с OnPlayerEnterDynamicCP
#4

А у меня работает. Попробуй провести дебаг. Протестил сразу на 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
*/
Reply


Messages In This Thread
Проблема с OnPlayerEnterDynamicCP - by nikita86826 - 30.01.2014, 06:47
Re: Проблема с OnPlayerEnterDynamicCP - by newbie scripter - 30.01.2014, 07:33
Re: Проблема с OnPlayerEnterDynamicCP - by nikita86826 - 30.01.2014, 09:18
Re: Проблема с OnPlayerEnterDynamicCP - by Diman777 - 30.01.2014, 19:30
Re: Проблема с OnPlayerEnterDynamicCP - by Hawkins - 01.02.2014, 08:31

Forum Jump:


Users browsing this thread: 1 Guest(s)