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

Проблема в том, что когда я встаю на чекпоинт действие которое должно проводится не проводится

паблик

PHP код:
public OnPlayerEnterDynamicCP(playerid,checkpointid)
{
    if(
checkpointid == NarkotikFabrikaChekpoint[0][playerid]) // ñòîë 1
    
{
        
SendClientMessage(playerid,-1,"12345");
        return 
true;
    }
    return 
true;

создание

PHP код:
NarkotikFabrikaChekpoint[0][playerid] = CreateDynamicCP(1980.3737,-1932.3616,-74.1,0.3,1,1,playerid,1.5);// ñòîë 1 
Reply
#2

pawn Код:
NarkotikFabrikaChekpoint[playerid][0] = CreateDynamicCP(1980.3737,-1932.3616,-74.1,0.3,1,1,playerid,1.5);// стол 1  
if(checkpointid == NarkotikFabrikaChekpoint[playerid][0])
Reply
#3

не помогло. 0 действия
Reply
#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
#5

Используй стандартные функции, через стримерные чекпоинты, тоже было много проблем
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)