Timer problem
#1

PHP код:
public CourseTimer(playerid)
{
    if(
PlayerInfo[playerid][oncourse] == 1)
    {
        new 
string[512];
        if(
coursestep[playerid] == 1)
        {
            if(
PlayerInfo[playerid][pLanguage] == 1)
            {
                
strcat(string""COL_LIGHTBLUE"LESSON 1:\n"sizeof(string));
                
strcat(string""COL_RED"SPEED LIMITS\n\n"sizeof(string));
                
strcat(string""COL_GREEN"You should always follow those speed limits\n"sizeof(string));
                
strcat(string""COL_GREEN"CITY/TOWN: "COL_WHITE"80KM/H "COL_GREEN"| 4-lane Roads CITY: "COL_WHITE"100 KM/H "COL_GREEN"| Outside CITY/TOWN: "COL_WHITE"150 KM/H "COL_GREEN"| HIGHWAY: "COL_WHITE"NO LIMIT\n"sizeof(string));
                
strcat(string""COL_GREEN"There are hidden speed traps around the map, so pay attention!\n"sizeof(string));
                
strcat(string""COL_RED"Most of the car accidents happen due to speed, take care of your life\n"sizeof(string));
                
Update3DTextLabelText(texttable, -1string);
                
coursestep[playerid] = 2;
            }
            else
            {
                
strcat(string""COL_LIGHTBLUE"LECTIA 1:\n"sizeof(string));
                
strcat(string""COL_RED"LIMITELE DE VITEZA\n\n"sizeof(string));
                
strcat(string""COL_GREEN"Esti obligat sa respecti aceste limite tot timpul\n"sizeof(string));
                
strcat(string""COL_GREEN"ORAS/SAT: "COL_WHITE"80 KM/H "COL_GREEN"| 4 benzi - ORAS: "COL_WHITE"100 KM/H "COL_GREEN"| in afara Orasului/Satului: "COL_WHITE"150 KM/H "COL_GREEN"| AUTOSTRADA: "COL_WHITE"Nu e limita\n"sizeof(string));
                
strcat(string""COL_GREEN"Sunt radare ascunse peste tot pe harta, ai grija la ele!\n"sizeof(string));
                
strcat(string""COL_RED"Majoritatea accidentelor se intampla din cauza vitezei asa ca ai grija!\n"sizeof(string));
                
Update3DTextLabelText(texttable, -1string);
                
coursestep[playerid] = 2;
            }
        }
        else if(
coursestep[playerid] == 2)
        {
            if(
PlayerInfo[playerid][pLanguage] == 1)
            {
                
strcat(string""COL_LIGHTBLUE"LESSON 2:\n"sizeof(string));
                
strcat(string""COL_RED"ABOUT CARS\n\n"sizeof(string));
                
strcat(string""COL_GREEN"We'll teach you few usefull car commands\n"sizeof(string));
                
strcat(string""COL_WHITE"/engine or KEY 2 "COL_GREEN"- This will start the engine of the car\n"sizeof(string));
                
strcat(string""COL_WHITE"/carlights or KEY CTRL "COL_GREEN"- This will turn on the headlights\n"sizeof(string));
                
strcat(string""COL_WHITE"/lock or KEY N "COL_GREEN"- This will lock your car, keep it safe\n"sizeof(string));
                
strcat(string""COL_GREEN"For more car commands type "COL_WHITE"/help "COL_GREEN" and select Cars"sizeof(string));
                
Update3DTextLabelText(texttable, -1string);
                
coursestep[playerid] = 3;
            }
            else
            {
                
strcat(string""COL_LIGHTBLUE"LECTIA 2:\n"sizeof(string));
                
strcat(string""COL_RED"DESPRE VEHICULE\n\n"sizeof(string));
                
strcat(string""COL_GREEN"Te vom invata cateva comenzi folositoare pentru vehicule\n"sizeof(string));
                
strcat(string""COL_WHITE"/engine sau TASTA 2 "COL_GREEN"- Aceste doua lucruri vor porni motorul masini\n"sizeof(string));
                
strcat(string""COL_WHITE"/carlights sau TASTA CTRL "COL_GREEN"- Aceste doua lucruri vor porni farurile masini\n"sizeof(string));
                
strcat(string""COL_WHITE"/lock sau TASTA N "COL_GREEN"- Aceste doua lucruri iti vor incuia masina, ai grija de masina ta\n"sizeof(string));
                
strcat(string""COL_GREEN"Pentru mai multe comenzi tasteaza "COL_WHITE"/help "COL_GREEN" si click pe Cars"sizeof(string));
                
Update3DTextLabelText(texttable, -1string);
                
coursestep[playerid] = 3;
            }
        }
        else if(
coursestep[playerid] == 3)
        {
            if(
PlayerInfo[playerid][pLanguage] == 1)
            {
                
strcat(string""COL_LIGHTBLUE"LESSON 3:\n"sizeof(string));
                
strcat(string""COL_RED"HOW TO PARK YOUR CAR\n\n"sizeof(string));
                
strcat(string""COL_GREEN"If you don't park your car properly it will get towed\n"sizeof(string));
                
strcat(string""COL_GREEN"This lesson is mostly for those who are VIP as normal players are not able to park their cars\n"sizeof(string));
                
strcat(string""COL_GREEN"There are various parking spots around the map so make sure you park your car at one of those\n"sizeof(string));
                
strcat(string""COL_GREEN"If your car gets towed you will have to pay for it, if you fail to do so it will be destroyed\n"sizeof(string));
                
strcat(string""COL_GREEN"To find the impound lot type "COL_WHITE"/findimpound"sizeof(string));
                
Update3DTextLabelText(texttable, -1string);
                
coursestep[playerid] = 4;
            }
            else
            {
                
strcat(string""COL_LIGHTBLUE"LECTIA 3:\n"sizeof(string));
                
strcat(string""COL_RED"CUM SA-TI PARCHEZI MASINA\n\n"sizeof(string));
                
strcat(string""COL_GREEN"Daca nu iti parchezi masina regulamentar aceasta va fi tractata\n"sizeof(string));
                
strcat(string""COL_GREEN"Aceasta lectia este mai mult pentru VIP deoarce playeri normali nu-si pot parca masina\n"sizeof(string));
                
strcat(string""COL_GREEN"Sunt destule parcari pe harta unde iti poti lasa masina asa ca nu bloca strada\n"sizeof(string));
                
strcat(string""COL_GREEN"Daca parchezi neregulamentar si iti este tractata masina va trebui sa platesti ca sa o iei inapoi sau resti sa fie tractata\n"sizeof(string));
                
strcat(string""COL_GREEN"Pentru a gasi locul unde este tractata masina tasteaza "COL_WHITE"/findimpound"sizeof(string));
                
Update3DTextLabelText(texttable, -1string);
                
coursestep[playerid] = 4;
            }
        }
        else if(
coursestep[playerid] == 4)
        {
            if(
PlayerInfo[playerid][pLanguage] == 1)
            {
                
strcat(string""COL_LIGHTBLUE"LESSON 4:\n"sizeof(string));
                
strcat(string""COL_RED"LANES\n\n"sizeof(string));
                
strcat(string""COL_GREEN"You must drive on the right lane\n"sizeof(string));
                
strcat(string""COL_GREEN"You can use other lanes to overtake vehicles or if the right lane is blocked\n"sizeof(string));
                
strcat(string""COL_GREEN"You can go on the wrong lane only if the right lane is blocked\n"sizeof(string));
                
strcat(string""COL_GREEN"Make sure you don't block the road because you put others and yourself in danger\n"sizeof(string));
                
strcat(string""COL_GREEN"If you fail to follow this rule you will receive a big ticket from "COL_WHITE"police"sizeof(string));
                
Update3DTextLabelText(texttable, -1string);
                
coursestep[playerid] = 5;
            }
            else
            {
                
strcat(string""COL_LIGHTBLUE"LECTIA 4:\n"sizeof(string));
                
strcat(string""COL_RED"BENZILE\n\n"sizeof(string));
                
strcat(string""COL_GREEN"Tine minte ca trebuie sa conduci pe partea dreapta\n"sizeof(string));
                
strcat(string""COL_GREEN"Ai voie sa folosesti celelalte benzi pentru a depasi vehicule sau daca banda ta este blocata\n"sizeof(string));
                
strcat(string""COL_GREEN"Ai voie sa mergi pe partea stanga a drumului doar daca partea dreapta este blocata\n"sizeof(string));
                
strcat(string""COL_GREEN"Asigurate ca nu blochezi drumul deoarece te pui pe tine si pe ceilalti in pericol\n"sizeof(string));
                
strcat(string""COL_GREEN"Daca nu respecti aceasta regula risti sa primesti o amenda destul de mare de la "COL_WHITE"politie"sizeof(string));
                
Update3DTextLabelText(texttable, -1string);
                
coursestep[playerid] = 5;
            }
        }
        else if(
coursestep[playerid] == 5)
        {
            if(
PlayerInfo[playerid][pLanguage] == 1)
            {
                
strcat(string""COL_LIGHTBLUE"LESSON 5:\n"sizeof(string));
                
strcat(string""COL_RED"INTERSECTIONS\n\n"sizeof(string));
                
strcat(string""COL_GREEN"If you arrive at a intersection with 4 ways...\n"sizeof(string));
                
strcat(string""COL_GREEN"If the intersection has no road sign then the driver on the right has the right of way\n"sizeof(string));
                
strcat(string""COL_GREEN"Also keep in mind that you should never block the intersection\n"sizeof(string));
                
Update3DTextLabelText(texttable, -1string);
                
coursestep[playerid] = 6;
            }
            else
            {
                
strcat(string""COL_LIGHTBLUE"LECTIA 5:\n"sizeof(string));
                
strcat(string""COL_RED"INTERSECTIILE\n\n"sizeof(string));
                
strcat(string""COL_GREEN"Daca ajungi la o intersectie cu 4 intrari...\n"sizeof(string));
                
strcat(string""COL_GREEN"Daca intersectia nu are nici un semn rutier atunci soferul din dreapta are prioritate\n"sizeof(string));
                
strcat(string""COL_GREEN"Tine minte ca nu ai voie sa blochezi intersectiile\n"sizeof(string));
                
Update3DTextLabelText(texttable, -1string);
                
coursestep[playerid] = 6;
            }
        }
        else if(
coursestep[playerid] == 6)
        {
            if(
PlayerInfo[playerid][pLanguage] == 1)
            {
                
strcat(string""COL_LIGHTBLUE"LESSON 6:\n"sizeof(string));
                
strcat(string""COL_RED"EMERGENCY VEHICLES\n\n"sizeof(string));
                
strcat(string""COL_GREEN"You should ALWAYS yeld to the emergency vehicles\n"sizeof(string));
                
strcat(string""COL_GREEN"If a emergency vehicle is aproaching you with sirens on then you should...\n"sizeof(string));
                
strcat(string""COL_GREEN"... slow down and pull over.\n"sizeof(string));
                
strcat(string""COL_GREEN"Don't follow emergency vehicles, you can get arrested for this\n"sizeof(string));
                
Update3DTextLabelText(texttable, -1string);
                
coursestep[playerid] = 7;
            }
            else
            {
                
strcat(string""COL_LIGHTBLUE"LECTIA 6:\n"sizeof(string));
                
strcat(string""COL_RED"VEHICULELE GUVERNAMENTALE\n\n"sizeof(string));
                
strcat(string""COL_GREEN"Esti obligat mereu sa-i dai prioritate la un vehicul cu sirenele pornite\n"sizeof(string));
                
strcat(string""COL_GREEN"Daca auzi sirenele unui vehicule guvernamental care se aproprie va trebui sa...\n"sizeof(string));
                
strcat(string""COL_GREEN"... incetinesti si sa tragi pe partea dreapta.\n"sizeof(string));
                
strcat(string""COL_GREEN"Nu urmari vehiculele guvernamentale, poti fi arestat pentru lucrul asta!\n"sizeof(string));
                
Update3DTextLabelText(texttable, -1string);
                
coursestep[playerid] = 7;
            }
        }
    }
    return 
1;

PHP код:
ctimer SetTimerEx("CourseTimer"14000true"i"playerid); 
Why this timer only reaches coursestep 3?
Reply
#2

Do you kill the timer anywhere?
Reply
#3

Quote:
Originally Posted by Hansrutger
Посмотреть сообщение
Do you kill the timer anywhere?
I do, when the player disconnects

KillTimer(ctimer);

But it is not the case here? The timer just stops at stage 3..
Reply
#4

try this

PHP код:
new ctimer[MAX_PLAYERS]; // define to player, is sent to one player and not all players.
new coursestep[MAX_PLAYERS];
public 
CourseTimer(playerid

    if(
PlayerInfo[playerid][oncourse] == 1
    { 
        new 
string[512]; 
        if(
coursestep[playerid] == 1
        { 
            if(
PlayerInfo[playerid][pLanguage] == 1
            { 
                
strcat(string""COL_LIGHTBLUE"LESSON 1:\n"sizeof(string)); 
                
strcat(string""COL_RED"SPEED LIMITS\n\n"sizeof(string)); 
                
strcat(string""COL_GREEN"You should always follow those speed limits\n"sizeof(string)); 
                
strcat(string""COL_GREEN"CITY/TOWN: "COL_WHITE"80KM/H "COL_GREEN"| 4-lane Roads CITY: "COL_WHITE"100 KM/H "COL_GREEN"| Outside CITY/TOWN: "COL_WHITE"150 KM/H "COL_GREEN"| HIGHWAY: "COL_WHITE"NO LIMIT\n"sizeof(string)); 
                
strcat(string""COL_GREEN"There are hidden speed traps around the map, so pay attention!\n"sizeof(string)); 
                
strcat(string""COL_RED"Most of the car accidents happen due to speed, take care of your life\n"sizeof(string));
            } 
            else 
            { 
                
strcat(string""COL_LIGHTBLUE"LECTIA 1:\n"sizeof(string)); 
                
strcat(string""COL_RED"LIMITELE DE VITEZA\n\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Esti obligat sa respecti aceste limite tot timpul\n"sizeof(string)); 
                
strcat(string""COL_GREEN"ORAS/SAT: "COL_WHITE"80 KM/H "COL_GREEN"| 4 benzi - ORAS: "COL_WHITE"100 KM/H "COL_GREEN"| in afara Orasului/Satului: "COL_WHITE"150 KM/H "COL_GREEN"| AUTOSTRADA: "COL_WHITE"Nu e limita\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Sunt radare ascunse peste tot pe harta, ai grija la ele!\n"sizeof(string)); 
                
strcat(string""COL_RED"Majoritatea accidentelor se intampla din cauza vitezei asa ca ai grija!\n"sizeof(string));
            } 
            
coursestep[playerid] = 2
            
Update3DTextLabelText(texttable, -1string); 
        } 
        else if(
coursestep[playerid] == 2
        { 
            if(
PlayerInfo[playerid][pLanguage] == 1
            { 
                
strcat(string""COL_LIGHTBLUE"LESSON 2:\n"sizeof(string)); 
                
strcat(string""COL_RED"ABOUT CARS\n\n"sizeof(string)); 
                
strcat(string""COL_GREEN"We'll teach you few usefull car commands\n"sizeof(string)); 
                
strcat(string""COL_WHITE"/engine or KEY 2 "COL_GREEN"- This will start the engine of the car\n"sizeof(string)); 
                
strcat(string""COL_WHITE"/carlights or KEY CTRL "COL_GREEN"- This will turn on the headlights\n"sizeof(string)); 
                
strcat(string""COL_WHITE"/lock or KEY N "COL_GREEN"- This will lock your car, keep it safe\n"sizeof(string)); 
                
strcat(string""COL_GREEN"For more car commands type "COL_WHITE"/help "COL_GREEN" and select Cars"sizeof(string));
            } 
            else 
            { 
                
strcat(string""COL_LIGHTBLUE"LECTIA 2:\n"sizeof(string)); 
                
strcat(string""COL_RED"DESPRE VEHICULE\n\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Te vom invata cateva comenzi folositoare pentru vehicule\n"sizeof(string)); 
                
strcat(string""COL_WHITE"/engine sau TASTA 2 "COL_GREEN"- Aceste doua lucruri vor porni motorul masini\n"sizeof(string)); 
                
strcat(string""COL_WHITE"/carlights sau TASTA CTRL "COL_GREEN"- Aceste doua lucruri vor porni farurile masini\n"sizeof(string)); 
                
strcat(string""COL_WHITE"/lock sau TASTA N "COL_GREEN"- Aceste doua lucruri iti vor incuia masina, ai grija de masina ta\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Pentru mai multe comenzi tasteaza "COL_WHITE"/help "COL_GREEN" si click pe Cars"sizeof(string));
            } 
            
coursestep[playerid] = 3
            
Update3DTextLabelText(texttable, -1string); 
        } 
        else if(
coursestep[playerid] == 3
        { 
            if(
PlayerInfo[playerid][pLanguage] == 1
            { 
                
strcat(string""COL_LIGHTBLUE"LESSON 3:\n"sizeof(string)); 
                
strcat(string""COL_RED"HOW TO PARK YOUR CAR\n\n"sizeof(string)); 
                
strcat(string""COL_GREEN"If you don't park your car properly it will get towed\n"sizeof(string)); 
                
strcat(string""COL_GREEN"This lesson is mostly for those who are VIP as normal players are not able to park their cars\n"sizeof(string)); 
                
strcat(string""COL_GREEN"There are various parking spots around the map so make sure you park your car at one of those\n"sizeof(string)); 
                
strcat(string""COL_GREEN"If your car gets towed you will have to pay for it, if you fail to do so it will be destroyed\n"sizeof(string)); 
                
strcat(string""COL_GREEN"To find the impound lot type "COL_WHITE"/findimpound"sizeof(string)); 
            } 
            else 
            { 
                
strcat(string""COL_LIGHTBLUE"LECTIA 3:\n"sizeof(string)); 
                
strcat(string""COL_RED"CUM SA-TI PARCHEZI MASINA\n\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Daca nu iti parchezi masina regulamentar aceasta va fi tractata\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Aceasta lectia este mai mult pentru VIP deoarce playeri normali nu-si pot parca masina\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Sunt destule parcari pe harta unde iti poti lasa masina asa ca nu bloca strada\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Daca parchezi neregulamentar si iti este tractata masina va trebui sa platesti ca sa o iei inapoi sau resti sa fie tractata\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Pentru a gasi locul unde este tractata masina tasteaza "COL_WHITE"/findimpound"sizeof(string)); 
            } 
            
coursestep[playerid] = 4
            
Update3DTextLabelText(texttable, -1string); 
        } 
        else if(
coursestep[playerid] == 4
        { 
            if(
PlayerInfo[playerid][pLanguage] == 1
            { 
                
strcat(string""COL_LIGHTBLUE"LESSON 4:\n"sizeof(string)); 
                
strcat(string""COL_RED"LANES\n\n"sizeof(string)); 
                
strcat(string""COL_GREEN"You must drive on the right lane\n"sizeof(string)); 
                
strcat(string""COL_GREEN"You can use other lanes to overtake vehicles or if the right lane is blocked\n"sizeof(string)); 
                
strcat(string""COL_GREEN"You can go on the wrong lane only if the right lane is blocked\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Make sure you don't block the road because you put others and yourself in danger\n"sizeof(string)); 
                
strcat(string""COL_GREEN"If you fail to follow this rule you will receive a big ticket from "COL_WHITE"police"sizeof(string)); 
            } 
            else 
            { 
                
strcat(string""COL_LIGHTBLUE"LECTIA 4:\n"sizeof(string)); 
                
strcat(string""COL_RED"BENZILE\n\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Tine minte ca trebuie sa conduci pe partea dreapta\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Ai voie sa folosesti celelalte benzi pentru a depasi vehicule sau daca banda ta este blocata\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Ai voie sa mergi pe partea stanga a drumului doar daca partea dreapta este blocata\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Asigurate ca nu blochezi drumul deoarece te pui pe tine si pe ceilalti in pericol\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Daca nu respecti aceasta regula risti sa primesti o amenda destul de mare de la "COL_WHITE"politie"sizeof(string)); 
            } 
            
coursestep[playerid] = 5
            
Update3DTextLabelText(texttable, -1string); 
        } 
        else if(
coursestep[playerid] == 5
        { 
            if(
PlayerInfo[playerid][pLanguage] == 1
            { 
                
strcat(string""COL_LIGHTBLUE"LESSON 5:\n"sizeof(string)); 
                
strcat(string""COL_RED"INTERSECTIONS\n\n"sizeof(string)); 
                
strcat(string""COL_GREEN"If you arrive at a intersection with 4 ways...\n"sizeof(string)); 
                
strcat(string""COL_GREEN"If the intersection has no road sign then the driver on the right has the right of way\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Also keep in mind that you should never block the intersection\n"sizeof(string)); 
            } 
            else 
            { 
                
strcat(string""COL_LIGHTBLUE"LECTIA 5:\n"sizeof(string)); 
                
strcat(string""COL_RED"INTERSECTIILE\n\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Daca ajungi la o intersectie cu 4 intrari...\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Daca intersectia nu are nici un semn rutier atunci soferul din dreapta are prioritate\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Tine minte ca nu ai voie sa blochezi intersectiile\n"sizeof(string)); 
            } 
            
coursestep[playerid] = 6
            
Update3DTextLabelText(texttable, -1string); 
        } 
        else if(
coursestep[playerid] == 6
        { 
            if(
PlayerInfo[playerid][pLanguage] == 1
            { 
                
strcat(string""COL_LIGHTBLUE"LESSON 6:\n"sizeof(string)); 
                
strcat(string""COL_RED"EMERGENCY VEHICLES\n\n"sizeof(string)); 
                
strcat(string""COL_GREEN"You should ALWAYS yeld to the emergency vehicles\n"sizeof(string)); 
                
strcat(string""COL_GREEN"If a emergency vehicle is aproaching you with sirens on then you should...\n"sizeof(string)); 
                
strcat(string""COL_GREEN"... slow down and pull over.\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Don't follow emergency vehicles, you can get arrested for this\n"sizeof(string));
            } 
            else 
            { 
                
strcat(string""COL_LIGHTBLUE"LECTIA 6:\n"sizeof(string)); 
                
strcat(string""COL_RED"VEHICULELE GUVERNAMENTALE\n\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Esti obligat mereu sa-i dai prioritate la un vehicul cu sirenele pornite\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Daca auzi sirenele unui vehicule guvernamental care se aproprie va trebui sa...\n"sizeof(string)); 
                
strcat(string""COL_GREEN"... incetinesti si sa tragi pe partea dreapta.\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Nu urmari vehiculele guvernamentale, poti fi arestat pentru lucrul asta!\n"sizeof(string)); 
            }
            
Update3DTextLabelText(texttable, -1string);
            
PlayerInfo[playerid][oncourse] = 2// set if player already in course
            
coursestep[playerid] = 0// set cour to 0.
            
KillTimer("ctimer[playerid]");
        }
    } 
    return 
1
}  
CMD:coursestep(playeridparams[])
{
    if(
PlayerInfo[playerid][oncourse] == )
    {
        
ctimer[playerid] = SetTimerEx("CourseTimer"14000true"i"playerid);
    }
    else if(
PlayerInfo[playerid][oncourse] == )
    {
        
SCM(playerid, -1"You Have passed coursestep");
    }
    return 
1;

Reply
#5

What is the difference? I have the same
Reply
#6

Debug the script like this and show what is printing on log.
PHP код:
public CourseTimer(playerid

    static 
timer_count=1;
    
printf("timer count %d coursestep[%d] = %d ",timer_count,playerid,coursestep[playerid] );
    if(
PlayerInfo[playerid][oncourse] == 1
    { 
        new 
string[512]; 
        if(
coursestep[playerid] == 1
        { 
            if(
PlayerInfo[playerid][pLanguage] == 1
            { 
                
strcat(string""COL_LIGHTBLUE"LESSON 1:\n"sizeof(string)); 
                
strcat(string""COL_RED"SPEED LIMITS\n\n"sizeof(string)); 
                
strcat(string""COL_GREEN"You should always follow those speed limits\n"sizeof(string)); 
                
strcat(string""COL_GREEN"CITY/TOWN: "COL_WHITE"80KM/H "COL_GREEN"| 4-lane Roads CITY: "COL_WHITE"100 KM/H "COL_GREEN"| Outside CITY/TOWN: "COL_WHITE"150 KM/H "COL_GREEN"| HIGHWAY: "COL_WHITE"NO LIMIT\n"sizeof(string)); 
                
strcat(string""COL_GREEN"There are hidden speed traps around the map, so pay attention!\n"sizeof(string)); 
                
strcat(string""COL_RED"Most of the car accidents happen due to speed, take care of your life\n"sizeof(string)); 
                
Update3DTextLabelText(texttable, -1string); 
                
coursestep[playerid] = 2
            } 
            else 
            { 
                
strcat(string""COL_LIGHTBLUE"LECTIA 1:\n"sizeof(string)); 
                
strcat(string""COL_RED"LIMITELE DE VITEZA\n\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Esti obligat sa respecti aceste limite tot timpul\n"sizeof(string)); 
                
strcat(string""COL_GREEN"ORAS/SAT: "COL_WHITE"80 KM/H "COL_GREEN"| 4 benzi - ORAS: "COL_WHITE"100 KM/H "COL_GREEN"| in afara Orasului/Satului: "COL_WHITE"150 KM/H "COL_GREEN"| AUTOSTRADA: "COL_WHITE"Nu e limita\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Sunt radare ascunse peste tot pe harta, ai grija la ele!\n"sizeof(string)); 
                
strcat(string""COL_RED"Majoritatea accidentelor se intampla din cauza vitezei asa ca ai grija!\n"sizeof(string)); 
                
Update3DTextLabelText(texttable, -1string); 
                
coursestep[playerid] = 2
            } 
        } 
        else if(
coursestep[playerid] == 2
        { 
            if(
PlayerInfo[playerid][pLanguage] == 1
            { 
                
strcat(string""COL_LIGHTBLUE"LESSON 2:\n"sizeof(string)); 
                
strcat(string""COL_RED"ABOUT CARS\n\n"sizeof(string)); 
                
strcat(string""COL_GREEN"We'll teach you few usefull car commands\n"sizeof(string)); 
                
strcat(string""COL_WHITE"/engine or KEY 2 "COL_GREEN"- This will start the engine of the car\n"sizeof(string)); 
                
strcat(string""COL_WHITE"/carlights or KEY CTRL "COL_GREEN"- This will turn on the headlights\n"sizeof(string)); 
                
strcat(string""COL_WHITE"/lock or KEY N "COL_GREEN"- This will lock your car, keep it safe\n"sizeof(string)); 
                
strcat(string""COL_GREEN"For more car commands type "COL_WHITE"/help "COL_GREEN" and select Cars"sizeof(string)); 
                
Update3DTextLabelText(texttable, -1string); 
                
coursestep[playerid] = 3
            } 
            else 
            { 
                
strcat(string""COL_LIGHTBLUE"LECTIA 2:\n"sizeof(string)); 
                
strcat(string""COL_RED"DESPRE VEHICULE\n\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Te vom invata cateva comenzi folositoare pentru vehicule\n"sizeof(string)); 
                
strcat(string""COL_WHITE"/engine sau TASTA 2 "COL_GREEN"- Aceste doua lucruri vor porni motorul masini\n"sizeof(string)); 
                
strcat(string""COL_WHITE"/carlights sau TASTA CTRL "COL_GREEN"- Aceste doua lucruri vor porni farurile masini\n"sizeof(string)); 
                
strcat(string""COL_WHITE"/lock sau TASTA N "COL_GREEN"- Aceste doua lucruri iti vor incuia masina, ai grija de masina ta\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Pentru mai multe comenzi tasteaza "COL_WHITE"/help "COL_GREEN" si click pe Cars"sizeof(string)); 
                
Update3DTextLabelText(texttable, -1string); 
                
coursestep[playerid] = 3
            } 
        } 
        else if(
coursestep[playerid] == 3
        { 
            if(
PlayerInfo[playerid][pLanguage] == 1
            { 
                
strcat(string""COL_LIGHTBLUE"LESSON 3:\n"sizeof(string)); 
                
strcat(string""COL_RED"HOW TO PARK YOUR CAR\n\n"sizeof(string)); 
                
strcat(string""COL_GREEN"If you don't park your car properly it will get towed\n"sizeof(string)); 
                
strcat(string""COL_GREEN"This lesson is mostly for those who are VIP as normal players are not able to park their cars\n"sizeof(string)); 
                
strcat(string""COL_GREEN"There are various parking spots around the map so make sure you park your car at one of those\n"sizeof(string)); 
                
strcat(string""COL_GREEN"If your car gets towed you will have to pay for it, if you fail to do so it will be destroyed\n"sizeof(string)); 
                
strcat(string""COL_GREEN"To find the impound lot type "COL_WHITE"/findimpound"sizeof(string)); 
                
Update3DTextLabelText(texttable, -1string); 
                
coursestep[playerid] = 4
            } 
            else 
            { 
                
strcat(string""COL_LIGHTBLUE"LECTIA 3:\n"sizeof(string)); 
                
strcat(string""COL_RED"CUM SA-TI PARCHEZI MASINA\n\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Daca nu iti parchezi masina regulamentar aceasta va fi tractata\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Aceasta lectia este mai mult pentru VIP deoarce playeri normali nu-si pot parca masina\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Sunt destule parcari pe harta unde iti poti lasa masina asa ca nu bloca strada\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Daca parchezi neregulamentar si iti este tractata masina va trebui sa platesti ca sa o iei inapoi sau resti sa fie tractata\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Pentru a gasi locul unde este tractata masina tasteaza "COL_WHITE"/findimpound"sizeof(string)); 
                
Update3DTextLabelText(texttable, -1string); 
                
coursestep[playerid] = 4
            } 
        } 
        else if(
coursestep[playerid] == 4
        { 
            if(
PlayerInfo[playerid][pLanguage] == 1
            { 
                
strcat(string""COL_LIGHTBLUE"LESSON 4:\n"sizeof(string)); 
                
strcat(string""COL_RED"LANES\n\n"sizeof(string)); 
                
strcat(string""COL_GREEN"You must drive on the right lane\n"sizeof(string)); 
                
strcat(string""COL_GREEN"You can use other lanes to overtake vehicles or if the right lane is blocked\n"sizeof(string)); 
                
strcat(string""COL_GREEN"You can go on the wrong lane only if the right lane is blocked\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Make sure you don't block the road because you put others and yourself in danger\n"sizeof(string)); 
                
strcat(string""COL_GREEN"If you fail to follow this rule you will receive a big ticket from "COL_WHITE"police"sizeof(string)); 
                
Update3DTextLabelText(texttable, -1string); 
                
coursestep[playerid] = 5
            } 
            else 
            { 
                
strcat(string""COL_LIGHTBLUE"LECTIA 4:\n"sizeof(string)); 
                
strcat(string""COL_RED"BENZILE\n\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Tine minte ca trebuie sa conduci pe partea dreapta\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Ai voie sa folosesti celelalte benzi pentru a depasi vehicule sau daca banda ta este blocata\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Ai voie sa mergi pe partea stanga a drumului doar daca partea dreapta este blocata\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Asigurate ca nu blochezi drumul deoarece te pui pe tine si pe ceilalti in pericol\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Daca nu respecti aceasta regula risti sa primesti o amenda destul de mare de la "COL_WHITE"politie"sizeof(string)); 
                
Update3DTextLabelText(texttable, -1string); 
                
coursestep[playerid] = 5
            } 
        } 
        else if(
coursestep[playerid] == 5
        { 
            if(
PlayerInfo[playerid][pLanguage] == 1
            { 
                
strcat(string""COL_LIGHTBLUE"LESSON 5:\n"sizeof(string)); 
                
strcat(string""COL_RED"INTERSECTIONS\n\n"sizeof(string)); 
                
strcat(string""COL_GREEN"If you arrive at a intersection with 4 ways...\n"sizeof(string)); 
                
strcat(string""COL_GREEN"If the intersection has no road sign then the driver on the right has the right of way\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Also keep in mind that you should never block the intersection\n"sizeof(string)); 
                
Update3DTextLabelText(texttable, -1string); 
                
coursestep[playerid] = 6
            } 
            else 
            { 
                
strcat(string""COL_LIGHTBLUE"LECTIA 5:\n"sizeof(string)); 
                
strcat(string""COL_RED"INTERSECTIILE\n\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Daca ajungi la o intersectie cu 4 intrari...\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Daca intersectia nu are nici un semn rutier atunci soferul din dreapta are prioritate\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Tine minte ca nu ai voie sa blochezi intersectiile\n"sizeof(string)); 
                
Update3DTextLabelText(texttable, -1string); 
                
coursestep[playerid] = 6
            } 
        } 
        else if(
coursestep[playerid] == 6
        { 
            if(
PlayerInfo[playerid][pLanguage] == 1
            { 
                
strcat(string""COL_LIGHTBLUE"LESSON 6:\n"sizeof(string)); 
                
strcat(string""COL_RED"EMERGENCY VEHICLES\n\n"sizeof(string)); 
                
strcat(string""COL_GREEN"You should ALWAYS yeld to the emergency vehicles\n"sizeof(string)); 
                
strcat(string""COL_GREEN"If a emergency vehicle is aproaching you with sirens on then you should...\n"sizeof(string)); 
                
strcat(string""COL_GREEN"... slow down and pull over.\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Don't follow emergency vehicles, you can get arrested for this\n"sizeof(string)); 
                
Update3DTextLabelText(texttable, -1string); 
                
coursestep[playerid] = 7
            } 
            else 
            { 
                
strcat(string""COL_LIGHTBLUE"LECTIA 6:\n"sizeof(string)); 
                
strcat(string""COL_RED"VEHICULELE GUVERNAMENTALE\n\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Esti obligat mereu sa-i dai prioritate la un vehicul cu sirenele pornite\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Daca auzi sirenele unui vehicule guvernamental care se aproprie va trebui sa...\n"sizeof(string)); 
                
strcat(string""COL_GREEN"... incetinesti si sa tragi pe partea dreapta.\n"sizeof(string)); 
                
strcat(string""COL_GREEN"Nu urmari vehiculele guvernamentale, poti fi arestat pentru lucrul asta!\n"sizeof(string)); 
                
Update3DTextLabelText(texttable, -1string); 
                
coursestep[playerid] = 7
            } 
        } 
    } 
    
timer_count++;
    return 
1

Reply
#7

Quote:
Originally Posted by AndreiWow
Посмотреть сообщение
What is the difference? I have the same
I think he meant that you have to make "ctimer" per-player variable. And also, a simple correction on his code.
Код:
KillTimer("ctimer[playerid]");
Should be
Код:
KillTimer(ctimer[playerid]);
Reply
#8

Uh, the timer worked perfectly now, but earlier it didn't.. I will keep testing this and see if it will bug again.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)