SA-MP Forums Archive
Проблема с OnPlayerEnterDynamicCP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Русский/Russian (https://sampforum.blast.hk/forumdisplay.php?fid=32)
+---- Thread: Проблема с OnPlayerEnterDynamicCP (/showthread.php?tid=491302)



Проблема с OnPlayerEnterDynamicCP - nikita86826 - 30.01.2014

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

паблик

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 



Re: Проблема с OnPlayerEnterDynamicCP - newbie scripter - 30.01.2014

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



Re: Проблема с OnPlayerEnterDynamicCP - nikita86826 - 30.01.2014

не помогло. 0 действия


Re: Проблема с OnPlayerEnterDynamicCP - Diman777 - 30.01.2014

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



Re: Проблема с OnPlayerEnterDynamicCP - Hawkins - 01.02.2014

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