SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Русский/Russian (https://forum.sa-mp.com/forumdisplay.php?f=32)
-   -   Неработает функция (https://forum.sa-mp.com/showthread.php?t=634243)

Surprice 15/05/2017 04:46 PM

Неработает функция
 
Приветствую форумчан.

Сложилась проблема, реализована система ограбления Магазинов одежды, при наведении прицела на актёра (npc бота) ничего не происходит.

Вызываю функцию - таймером. Как бы не вызывал, пробовал и через команду - ничего не происходит. Крашдетект - молчит.
В чём может быть проблема?
PHP Code:

public RobbingTimer()
{
    for(new 
ac 0ac 5ac++) SetActorHealth(ActorsRob[ac], 255);
    new 
pl[5][8];
    foreach(
i)
    {
        if(
GetPlayerInterior(i) == 5)
        {
            if(
PlayerToPoint(30,i,204.8515,-8.1603,1001.2109) && RobInts[i] == 3)
            {
                    if(
cdrob[1] == false)
                {
                    switch(
PTEMP[i][pMember])
                    {
                        case 
12pl[1][0]++;
                        case 
13pl[1][1]++;
                        case 
15pl[1][2]++;
                        case 
17pl[1][3]++;
                        case 
18pl[1][4]++;
                        default: continue;
                    }
                    new 
PTA GetPlayerCameraTargetActor(i),
                        
keys,
                        
updown,
                        
leftright;
                    
GetPlayerKeys(ikeysupdownleftright);
                    if(
PTA != INVALID_ACTOR_ID && keys KEY_AIM)
                    {
                        if(
PTA != ActorsRob[4]) continue;
                        new 
PW GetPlayerWeapon(i);
                        if(
PW == 23 || PW == 24 || PW == 25 || PW == 29 || PW == 30 || PW == 31 || PW == 32)
                        {
                            if(
pl[1][0] > 1)
                            {
                                
ApplyActorAnimation(PTA"SHOP""SHP_HandsUp_Scr",4.1,0,0,0,1,0);
                                
cdrob[1] = true;
                                
SetTimerEx("RobsEnabledCD"1800000false"d",1);
                                
RobTickRTC[i] = 30;
                                
robscdtimer[i] = SetTimerEx("RobTickRTSC"1000true"ddddi"i0PTEMP[i][pMember], 3ActorsRob[4]);
                                
wantedsrobfriend(PTEMP[i][pMember], 13);
                            }
                            else if(
pl[1][1] > 1)
                            {
                                
ApplyActorAnimation(PTA"SHOP""SHP_HandsUp_Scr",4.1,0,0,0,1,0);
                                
cdrob[1] = true;
                                
SetTimerEx("RobsEnabledCD"1800000false"d",1);
                                
RobTickRTC[i] = 30;
                                
robscdtimer[i] = SetTimerEx("RobTickRTSC"1000true"ddddi"i0PTEMP[i][pMember], 3ActorsRob[4]);
                                
wantedsrobfriend(PTEMP[i][pMember], 13);
                            }
                            else if(
pl[1][2] > 1)
                            {
                                
ApplyActorAnimation(PTA"SHOP""SHP_HandsUp_Scr",4.1,0,0,0,1,0);
                                
cdrob[1] = true;
                                
SetTimerEx("RobsEnabledCD"1800000false"d",1);
                                
RobTickRTC[i] = 30;
                                
robscdtimer[i] = SetTimerEx("RobTickRTSC"1000true"ddddi"i0PTEMP[i][pMember], 3ActorsRob[4]);
                                
wantedsrobfriend(PTEMP[i][pMember], 13);
                            }
                            else if(
pl[1][3] > 1)
                            {
                                
ApplyActorAnimation(PTA"SHOP""SHP_HandsUp_Scr",4.1,0,0,0,1,0);
                                
cdrob[1] = true;
                                
SetTimerEx("RobsEnabledCD"1800000false"d",1);
                                
RobTickRTC[i] = 30;
                                
robscdtimer[i] = SetTimerEx("RobTickRTSC"1000true"ddddi"i0PTEMP[i][pMember], 3ActorsRob[4]);
                                
wantedsrobfriend(PTEMP[i][pMember], 13);
                            }
                            else if(
pl[1][4] > 1)
                            {
                                
ApplyActorAnimation(PTA"SHOP""SHP_HandsUp_Scr",4.1,0,0,0,1,0);
                                
cdrob[1] = true;
                                
SetTimerEx("RobsEnabledCD"1800000false"d",1);
                                
RobTickRTC[i] = 30;
                                
robscdtimer[i] = SetTimerEx("RobTickRTSC"1000true"ddddi"i0PTEMP[i][pMember], 3ActorsRob[4]);
                                
wantedsrobfriend(PTEMP[i][pMember], 13);
                            }
                            else
                            {
                                
SendClientMessage(iCOLOR_GREY"Для начала ограбления нужно минимум 2 напарника");
                            }
                        }
                    }
                }
                continue;
            }
            else if(
PlayerToPoint(30,i,204.8515,-8.1603,1001.2109) && RobInts[i] == 4)
            {
                if(
cdrob[0] == false)
                {
                    switch(
PTEMP[i][pMember])
                    {
                        case 
12pl[0][0]++;
                        case 
13pl[0][1]++;
                        case 
15pl[0][2]++;
                        case 
17pl[0][3]++;
                        case 
18pl[0][4]++;
                        default: continue;
                    }
                    new 
PTA GetPlayerCameraTargetActor(i),
                        
keys,
                        
updown,
                        
leftright;
                    
GetPlayerKeys(ikeysupdownleftright);
                    if(
PTA != INVALID_ACTOR_ID && keys KEY_AIM)
                    {
                        if(
PTA != ActorsRob[3]) continue;
                        new 
PW GetPlayerWeapon(i);
                        if(
PW == 23 || PW == 24 || PW == 25 || PW == 29 || PW == 30 || PW == 31 || PW == 32)
                        {
                            if(
pl[0][0] > 1)
                            {
                                
ApplyActorAnimation(PTA"SHOP""SHP_HandsUp_Scr",4.1,0,0,0,1,0);
                                
cdrob[0] = true;
                                
SetTimerEx("RobsEnabledCD"1800000false"d",0);
                                
RobTickRTC[i] = 30;
                                
robscdtimer[i] = SetTimerEx("RobTickRTSC"1000true"ddddi"i0PTEMP[i][pMember], 4ActorsRob[3]);
                                
wantedsrobfriend(PTEMP[i][pMember], 04);
                            }
                            else if(
pl[0][1] > 1)
                            {
                                
ApplyActorAnimation(PTA"SHOP""SHP_HandsUp_Scr",4.1,0,0,0,1,0);
                                
cdrob[0] = true;
                                
SetTimerEx("RobsEnabledCD"1800000false"d",0);
                                
RobTickRTC[i] = 30;
                                
robscdtimer[i] = SetTimerEx("RobTickRTSC"1000true"ddddi"i0PTEMP[i][pMember], 4ActorsRob[3]);
                                
wantedsrobfriend(PTEMP[i][pMember], 04);
                            }
                            else if(
pl[0][2] > 1)
                            {
                                
ApplyActorAnimation(PTA"SHOP""SHP_HandsUp_Scr",4.1,0,0,0,1,0);
                                
cdrob[0] = true;
                                
SetTimerEx("RobsEnabledCD"1800000false"d",0);
                                
RobTickRTC[i] = 30;
                                
robscdtimer[i] = SetTimerEx("RobTickRTSC"1000true"ddddi"i0PTEMP[i][pMember], 4ActorsRob[3]);
                                
wantedsrobfriend(PTEMP[i][pMember], 04);
                            }
                            else if(
pl[0][3] > 1)
                            {
                                
ApplyActorAnimation(PTA"SHOP""SHP_HandsUp_Scr",4.1,0,0,0,1,0);
                                
cdrob[0] = true;
                                
SetTimerEx("RobsEnabledCD"1800000false"d",0);
                                
RobTickRTC[i] = 30;
                                
robscdtimer[i] = SetTimerEx("RobTickRTSC"1000true"ddddi"i0PTEMP[i][pMember], 4ActorsRob[3]);
                                
wantedsrobfriend(PTEMP[i][pMember], 04);
                            }
                            else if(
pl[0][4] > 1)
                            {
                                
ApplyActorAnimation(PTA"SHOP""SHP_HandsUp_Scr",4.1,0,0,0,1,0);
                                
cdrob[0] = true;
                                
SetTimerEx("RobsEnabledCD"1800000false"d",0);
                                
RobTickRTC[i] = 30;
                                
robscdtimer[i] = SetTimerEx("RobTickRTSC"1000true"ddddi"i0PTEMP[i][pMember], 4ActorsRob[3]);
                                
wantedsrobfriend(PTEMP[i][pMember], 04);
                            }
                            else
                            {
                                
SendClientMessage(iCOLOR_GREY"Для начала ограбления нужно минимум 2 напарника");
                            }
                        }
                    }
                }
                continue;
            }
        }
        else if(
PlayerToPoint(30,i,316.1089,-133.7254,999.6016) && RobInts[i] == 0)
        {
            if(
cdrob[2] == false)
            {
                switch(
PTEMP[i][pMember])
                {
                    case 
5pl[2][5]++;
                    case 
6pl[2][6]++;
                    case 
14pl[2][7]++;
                    default: continue;
                }
                new 
PTA GetPlayerCameraTargetActor(i),
                    
keys,
                    
updown,
                    
leftright;
                
GetPlayerKeys(ikeysupdownleftright);
                if(
PTA != INVALID_ACTOR_ID && keys KEY_AIM)
                {
                    if(
PTA != ActorsRob[2]) continue;
                    new 
PW GetPlayerWeapon(i);
                    if(
PW == 23 || PW == 24 || PW == 25 || PW == 29 || PW == 30 || PW == 31 || PW == 32)
                    {
                        if(
pl[2][5] > 1)
                        {
                            
ApplyActorAnimation(PTA"SHOP""SHP_HandsUp_Scr",4.1,0,0,0,1,0);
                            
cdrob[2] = true;
                            
SetTimerEx("RobsEnabledCD"1800000false"d",2);
                            
RobTickRTC[i] = 30;
                            
robscdtimer[i] = SetTimerEx("RobTickRTSC"1000true"ddddi"i1PTEMP[i][pMember], 0ActorsRob[2]);
                            
wantedsrobfriend(PTEMP[i][pMember], 20);
                        }
                        else if(
pl[2][6] > 1)
                        {
                            
ApplyActorAnimation(PTA"SHOP""SHP_HandsUp_Scr",4.1,0,0,0,1,0);
                            
cdrob[2] = true;
                            
SetTimerEx("RobsEnabledCD"1800000false"d",2);
                            
RobTickRTC[i] = 30;
                            
robscdtimer[i] = SetTimerEx("RobTickRTSC"1000true"ddddi"i1PTEMP[i][pMember], 0ActorsRob[2]);
                            
wantedsrobfriend(PTEMP[i][pMember], 20);
                        }
                        else if(
pl[2][7] > 1)
                        {
                            
ApplyActorAnimation(PTA"SHOP""SHP_HandsUp_Scr",4.1,0,0,0,1,0);
                            
cdrob[2] = true;
                            
SetTimerEx("RobsEnabledCD"1800000false"d",2);
                            
RobTickRTC[i] = 30;
                            
robscdtimer[i] = SetTimerEx("RobTickRTSC"1000true"ddddi"i1PTEMP[i][pMember], 0ActorsRob[2]);
                            
wantedsrobfriend(PTEMP[i][pMember], 20);
                        }
                        else
                        {
                            
SendClientMessage(iCOLOR_GREY"Для начала ограбления нужно минимум 2 напарника");
                        }
                    }
                }
            }
            continue;
        }
        else if(
PlayerToPoint(30,i,295.4810,-40.2167,1001.5156) && RobInts[i] == 1)
        {
            if(
cdrob[3] == false)
            {
                switch(
PTEMP[i][pMember])
                {
                    case 
5pl[3][5]++;
                    case 
6pl[3][6]++;
                    case 
14pl[3][7]++;
                    default: continue;
                }
                new 
PTA GetPlayerCameraTargetActor(i),
                    
keys,
                    
updown,
                    
leftright;
                
GetPlayerKeys(ikeysupdownleftright);
                if(
PTA != INVALID_ACTOR_ID && keys KEY_AIM)
                {
                    if(
PTA != ActorsRob[1]) continue;
                    new 
PW GetPlayerWeapon(i);
                    if(
PW == 23 || PW == 24 || PW == 25 || PW == 29 || PW == 30 || PW == 31 || PW == 32)
                    {
                        if(
pl[3][5] > 1)
                        {
                            
ApplyActorAnimation(PTA"SHOP""SHP_HandsUp_Scr",4.1,0,0,0,1,0);
                            
cdrob[3] = true;
                            
SetTimerEx("RobsEnabledCD"1800000false"d",3);
                            
RobTickRTC[i] = 30;
                            
robscdtimer[i] = SetTimerEx("RobTickRTSC"1000true"ddddi"i1PTEMP[i][pMember], 1ActorsRob[1]);
                            
wantedsrobfriend(PTEMP[i][pMember], 31);
                        }
                        else if(
pl[3][6] > 1)
                        {
                            
ApplyActorAnimation(PTA"SHOP""SHP_HandsUp_Scr",4.1,0,0,0,1,0);
                            
cdrob[3] = true;
                            
SetTimerEx("RobsEnabledCD"1800000false"d",3);
                            
RobTickRTC[i] = 30;
                            
robscdtimer[i] = SetTimerEx("RobTickRTSC"1000true"ddddi"i1PTEMP[i][pMember], 1ActorsRob[1]);
                            
wantedsrobfriend(PTEMP[i][pMember], 31);
                        }
                        else if(
pl[3][7] > 1)
                        {
                            
ApplyActorAnimation(PTA"SHOP""SHP_HandsUp_Scr",4.1,0,0,0,1,0);
                            
cdrob[3] = true;
                            
SetTimerEx("RobsEnabledCD"1800000false"d",3);
                            
RobTickRTC[i] = 30;
                            
robscdtimer[i] = SetTimerEx("RobTickRTSC"1000true"ddddi"i1PTEMP[i][pMember], 1ActorsRob[1]);
                            
wantedsrobfriend(PTEMP[i][pMember], 31);
                        }
                        else
                        {
                            
SendClientMessage(iCOLOR_GREY"Для начала ограбления нужно минимум 2 напарника");
                        }
                    }
                }
            }
            continue;
        }
        else if(
PlayerToPoint(30,i,296.8526,-82.5276,1001.5156) && RobInts[i] == 2)
        {
            if(
cdrob[4] == false)
            {
                switch(
PTEMP[i][pMember])
                {
                    case 
5pl[4][5]++;
                    case 
6pl[4][6]++;
                    case 
14pl[4][7]++;
                    default: continue;
                }
                new 
PTA GetPlayerCameraTargetActor(i),
                    
keys,
                    
updown,
                    
leftright;
                
GetPlayerKeys(ikeysupdownleftright);
                if(
PTA != INVALID_ACTOR_ID && keys KEY_AIM)
                {
                    if(
PTA != ActorsRob[0]) continue;
                    new 
PW GetPlayerWeapon(i);
                    if(
PW == 23 || PW == 24 || PW == 25 || PW == 29 || PW == 30 || PW == 31 || PW == 32)
                    {
                        if(
pl[4][5] > 1)
                        {
                            
ApplyActorAnimation(PTA"SHOP""SHP_HandsUp_Scr",4.1,0,0,0,1,0);
                            
cdrob[4] = true;
                            
SetTimerEx("RobsEnabledCD"1800000false"d",4);
                            
RobTickRTC[i] = 30;
                            
robscdtimer[i] = SetTimerEx("RobTickRTSC"1000true"ddddi"i1PTEMP[i][pMember], 2ActorsRob[0]);
                            
wantedsrobfriend(PTEMP[i][pMember], 42);
                        }
                        else if(
pl[4][6] > 1)
                        {
                            
ApplyActorAnimation(PTA"SHOP""SHP_HandsUp_Scr",4.1,0,0,0,1,0);
                            
cdrob[4] = true;
                            
SetTimerEx("RobsEnabledCD"1800000false"d",4);
                            
RobTickRTC[i] = 30;
                            
robscdtimer[i] = SetTimerEx("RobTickRTSC"1000true"ddddi"i1PTEMP[i][pMember], 2ActorsRob[0]);
                            
wantedsrobfriend(PTEMP[i][pMember], 42);
                        }
                        else if(
pl[4][7] > 1)
                        {
                            
ApplyActorAnimation(PTA"SHOP""SHP_HandsUp_Scr",4.1,0,0,0,1,0);
                            
cdrob[4] = true;
                            
SetTimerEx("RobsEnabledCD"1800000false"d",4);
                            
RobTickRTC[i] = 30;
                            
robscdtimer[i] = SetTimerEx("RobTickRTSC"1000true"ddddi"i1PTEMP[i][pMember], 2ActorsRob[0]);
                            
wantedsrobfriend(PTEMP[i][pMember], 42);
                        }
                        else
                        {
                            
SendClientMessage(iCOLOR_GREY"Для начала ограбления нужно минимум 2 напарника");
                        }
                    }
                }
            }
            continue;
        }
    }



Mutha_X 15/05/2017 05:23 PM

Re: Неработает функция
 
Если нужно именно по прицелу оружия GetPlayerCameraTargetActor -> GetPlayerTargetActor
Если нужно по центру экрана EnablePlayerCameraTarget

У вас на проекте личный индус работает?


All times are GMT. The time now is 12:44 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.