SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Русский/Russian

Reply
 
Thread Tools Display Modes
Old 15/05/2017, 04:46 PM   #1
Surprice
Big Clucker
 
Join Date: Mar 2015
Posts: 103
Reputation: 0
Default Неработает функция

Приветствую форумчан.

Сложилась проблема, реализована система ограбления Магазинов одежды, при наведении прицела на актёра (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;
        }
    }

Surprice is offline   Reply With Quote
Old 15/05/2017, 05:23 PM   #2
Mutha_X
Gangsta
 
Join Date: Sep 2009
Location: recursion
Posts: 621
Reputation: 24
Default Re: Неработает функция

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

У вас на проекте личный индус работает?
__________________
Russian forums: asking question - taking grammar notations.
Учитесь задавать вопросы по существу и изучать матчасть: иначе приобретайте лекарство "НИБОМБИН".
Mutha_X is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Функция dimon199862 Русский/Russian 1 01/05/2016 02:51 PM
Функция IsCoordinatesLand kennydalglish Русский/Russian 12 24/05/2015 06:32 PM
Массивы, функция mxstr Русский/Russian 16 30/12/2013 07:43 AM
Неработает механик riddik123 Русский/Russian 1 25/02/2013 11:17 PM
функция random() Crystal_Speed Русский/Russian 8 18/01/2011 12:14 PM


All times are GMT. The time now is 03:37 PM.


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