Tutorial Bug
#1

Hello guys,

I was trying to edit LA-RP's tutorial to make a new one and put it to my own RPG gamemode. But seems like i messed with something. I guess I have to put a timer instead of TutTime. Nvm here are the codes, where is the wrong thing ? :/


pawn Код:
// at the top :

new TutTime[MAX_PLAYERS];
I want to connect it to a command called /tutorialbasla. So here are the command's script:

pawn Код:
if (strcmp("/tutorialbasla", cmdtext, true, 10) == 0)
 {
 if(TutTime[playerid] >= 1)
            {
                TutTime[playerid] += 1;
                if(TutTime[playerid] == 3)
                {
                    SendClientMessage(playerid, COLOR_WHITE, "So you are new here? We'll show you some places and give you some tips.");
                    SendClientMessage(playerid, COLOR_WHITE, "If you don't know how to RP, then leave this server.");
                    SendClientMessage(playerid, COLOR_WHITE, " ");
                    SetPlayerCameraPos(playerid, 2247.0215,-1655.0173,17.2856);
                    SetPlayerCameraLookAt(playerid, 2244.6536,-1663.9304,15.4766);
                    SetPlayerInterior(playerid, 0);
                    SetPlayerVirtualWorld(playerid, 99);
                    SetPlayerPos(playerid, 2256.3555,-1646.6377,15.4959);
                    SendClientMessage(playerid, COLOR_YELLOW, ":: CLOTHES SHOP ::");
                    SendClientMessage(playerid, COLOR_WHITE, " ");
                    SendClientMessage(playerid, COLOR_YELLOW2, "First of all you'll need some clothes, you can buy them at any clothes shop.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "When you're in the shop type /clothes and then type next untill you find the clothes that you like.");
                }
                else if(TutTime[playerid] == 16)
                {
                    SetPlayerPos(playerid, 2089.6624,-1901.7891,13.5469);
                    SetPlayerCameraPos(playerid, 2070.8093,-1914.6747,18.5469);
                    SetPlayerCameraLookAt(playerid, 2055.2405,-1906.4608,13.5469);
                    SetPlayerInterior(playerid, 0);
                    SendClientMessage(playerid, COLOR_YELLOW, ":: DRIVING SCHOOL ::");
                    SendClientMessage(playerid, COLOR_WHITE, " ");
                    SendClientMessage(playerid, COLOR_YELLOW2, "You still have no driving license? Shame on you!");
                    SendClientMessage(playerid, COLOR_YELLOW2, "You need to pass a driving test first to get a license.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "You can see the list of licensers by just typing /licensers.");
                }
                else if(TutTime[playerid] == 32)
                {
                    SetPlayerPos(playerid, 1514.3059,-1667.8116,14.0469);
                    SetPlayerCameraPos(playerid, 1535.9584,-1676.1428,18.3828);
                    SetPlayerCameraLookAt(playerid, 1553.7861,-1676.4270,16.1953);
                    SetPlayerInterior(playerid, 0);
                    SendClientMessage(playerid, COLOR_YELLOW, ":: LOS ANGELES POLICE DEPARTMENT ::");
                    SendClientMessage(playerid, COLOR_WHITE, " ");
                    SendClientMessage(playerid, COLOR_YELLOW2, "The Los Angeles Police Department and FBI are in the city for your protection.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "People who commit crimes will dealt with swiftly and with force if necessary.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "To call a police officer, call the emergency hotline using /call 911.");
                }
                else if(TutTime[playerid] == 54)
                {
                    SetPlayerPos(playerid, 1221.7010,-1328.6449,13.4821);
                    SetPlayerCameraPos(playerid, 1204.3781,-1313.3323,16.3984);
                    SetPlayerCameraLookAt(playerid, 1174.7167,-1323.4485,14.5938);
                    SetPlayerInterior(playerid, 0);
                    SendClientMessage(playerid, COLOR_YELLOW, ":: ALL SAINTS GENERAL HOSPITAL ::");
                    SendClientMessage(playerid, COLOR_WHITE, " ");
                    SendClientMessage(playerid, COLOR_YELLOW2, "Feeling sick? You need to see the doctor of Los Angeles.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "To call a paramedic, call the emergency hotline using /call 911");
                    SendClientMessage(playerid, COLOR_YELLOW2, "You'll spawn here after death");
                }
                else if(TutTime[playerid] == 76)
                {
                    SetPlayerPos(playerid, 1786.1758,-1258.4976,13.6417);
                    SetPlayerCameraPos(playerid, 1779.4259,-1275.1025,15.6328);
                    SetPlayerCameraLookAt(playerid, 1785.7263,-1296.0200,13.4213);
                    SetPlayerInterior(playerid, 0);
                    SendClientMessage(playerid, COLOR_YELLOW, ":: ABC STUDIO ::");
                    SendClientMessage(playerid, COLOR_WHITE, " ");
                    SendClientMessage(playerid, COLOR_YELLOW2, "Got some fresh news to announce? Go to the ABC Studio reporters and ask them to do it.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "You can also post your advertisment at local newspaper.");
                }
                else if(TutTime[playerid] == 98)
                {
                    SetPlayerPos(playerid, 1475.7020,-1050.9489,23.8246);
                    SetPlayerCameraPos(playerid, 1458.3872,-1042.2423,24.8281);
                    SetPlayerCameraLookAt(playerid, 1458.5930,-1019.9205,24.5264);
                    SetPlayerInterior(playerid, 0);
                    SendClientMessage(playerid, COLOR_YELLOW, ":: BANK OF THE STATE ::");
                    SendClientMessage(playerid, COLOR_WHITE, " ");
                    SendClientMessage(playerid, COLOR_YELLOW2, "You won't keep all your money in your pocket, someone will try to steal it.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "You can /deposit, or /withdraw your money at the bank.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "You'll get you payday at your bank account too.");
                }
                else if(TutTime[playerid] == 110)
                {
                    SetPlayerInterior(playerid, 3);
                    SetPlayerPos(playerid, 330.6825,163.6688,1014.1875);
                    SetCameraBehindPlayer(playerid);
                    SetPlayerVirtualWorld(playerid, 0);
                    SendClientMessage(playerid, COLOR_YELLOW, ":: END OF TUTORIAL ::");
                    SendClientMessage(playerid, COLOR_WHITE, " ");
                    SendClientMessage(playerid, COLOR_YELLOW2, "There are a lot of places in Los Angeles, but you need to discover them on your own.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "Don't forget Role-Play rules, because non-rping causes warns and bans!");
                    SendClientMessage(playerid, COLOR_YELLOW2, "Greetings from: Los Angeles Roleplay admin team.");
                }
                else if(TutTime[playerid] == 119)
                {
                    SendClientMessage(playerid, COLOR_YELLOW2, "Welcome to the Los Angeles.");
                    SendClientMessage(playerid, COLOR_GRAD1, "Hint: To call a taxi or bus use /call 444 or /call 222");
                    SendClientMessage(playerid, COLOR_GRAD1, "Hint: To change your outfit you have to go to clothes shop");
                    SendClientMessage(playerid, COLOR_GRAD1, " ");
                    SetPlayerSpawn(playerid);
                   
                }
            }
 return 1;
 }


I didn't edit it as it didn't work.

edit: I guess I found the bug. Let's test. lol

edit 2: no I didn't. I just added TutTime[playerid] = 0; to OnPlayerConnect.

edit 3: Found another bug. Let's test again. ^^

edit 4: Nope. Didn't work. Just edited TutTime >= 1 to >= 0.
Reply
#2

pawn Код:
if (strcmp("/tutorialbasla", cmdtext, true, 10) == 0)
 {
            if(TutTime[playerid] >= 1)
            {
                TutTime[playerid] += 1;
                if(TutTime[playerid] == 3)
                {
                    SendClientMessage(playerid, COLOR_WHITE, "So you are new here? We'll show you some places and give you some tips.");
                    SendClientMessage(playerid, COLOR_WHITE, "If you don't know how to RP, then leave this server.");
                    SendClientMessage(playerid, COLOR_WHITE, " ");
                    SetPlayerCameraPos(playerid, 2247.0215,-1655.0173,17.2856);
                    SetPlayerCameraLookAt(playerid, 2244.6536,-1663.9304,15.4766);
                    SetPlayerInterior(playerid, 0);
                    SetPlayerVirtualWorld(playerid, 99);
                    SetPlayerPos(playerid, 2256.3555,-1646.6377,15.4959);
                    SendClientMessage(playerid, COLOR_YELLOW, ":: CLOTHES SHOP ::");
                    SendClientMessage(playerid, COLOR_WHITE, " ");
                    SendClientMessage(playerid, COLOR_YELLOW2, "First of all you'll need some clothes, you can buy them at any clothes shop.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "When you're in the shop type /clothes and then type next untill you find the clothes that you like.");
                }
                else if(TutTime[playerid] == 16)
                {
                    SetPlayerPos(playerid, 2089.6624,-1901.7891,13.5469);
                    SetPlayerCameraPos(playerid, 2070.8093,-1914.6747,18.5469);
                    SetPlayerCameraLookAt(playerid, 2055.2405,-1906.4608,13.5469);
                    SetPlayerInterior(playerid, 0);
                    SendClientMessage(playerid, COLOR_YELLOW, ":: DRIVING SCHOOL ::");
                    SendClientMessage(playerid, COLOR_WHITE, " ");
                    SendClientMessage(playerid, COLOR_YELLOW2, "You still have no driving license? Shame on you!");
                    SendClientMessage(playerid, COLOR_YELLOW2, "You need to pass a driving test first to get a license.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "You can see the list of licensers by just typing /licensers.");
                }
                else if(TutTime[playerid] == 32)
                {
                    SetPlayerPos(playerid, 1514.3059,-1667.8116,14.0469);
                    SetPlayerCameraPos(playerid, 1535.9584,-1676.1428,18.3828);
                    SetPlayerCameraLookAt(playerid, 1553.7861,-1676.4270,16.1953);
                    SetPlayerInterior(playerid, 0);
                    SendClientMessage(playerid, COLOR_YELLOW, ":: LOS ANGELES POLICE DEPARTMENT ::");
                    SendClientMessage(playerid, COLOR_WHITE, " ");
                    SendClientMessage(playerid, COLOR_YELLOW2, "The Los Angeles Police Department and FBI are in the city for your protection.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "People who commit crimes will dealt with swiftly and with force if necessary.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "To call a police officer, call the emergency hotline using /call 911.");
                }
                else if(TutTime[playerid] == 54)
                {
                    SetPlayerPos(playerid, 1221.7010,-1328.6449,13.4821);
                    SetPlayerCameraPos(playerid, 1204.3781,-1313.3323,16.3984);
                    SetPlayerCameraLookAt(playerid, 1174.7167,-1323.4485,14.5938);
                    SetPlayerInterior(playerid, 0);
                    SendClientMessage(playerid, COLOR_YELLOW, ":: ALL SAINTS GENERAL HOSPITAL ::");
                    SendClientMessage(playerid, COLOR_WHITE, " ");
                    SendClientMessage(playerid, COLOR_YELLOW2, "Feeling sick? You need to see the doctor of Los Angeles.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "To call a paramedic, call the emergency hotline using /call 911");
                    SendClientMessage(playerid, COLOR_YELLOW2, "You'll spawn here after death");
                }
                else if(TutTime[playerid] == 76)
                {
                    SetPlayerPos(playerid, 1786.1758,-1258.4976,13.6417);
                    SetPlayerCameraPos(playerid, 1779.4259,-1275.1025,15.6328);
                    SetPlayerCameraLookAt(playerid, 1785.7263,-1296.0200,13.4213);
                    SetPlayerInterior(playerid, 0);
                    SendClientMessage(playerid, COLOR_YELLOW, ":: ABC STUDIO ::");
                    SendClientMessage(playerid, COLOR_WHITE, " ");
                    SendClientMessage(playerid, COLOR_YELLOW2, "Got some fresh news to announce? Go to the ABC Studio reporters and ask them to do it.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "You can also post your advertisment at local newspaper.");
                }
                else if(TutTime[playerid] == 98)
                {
                    SetPlayerPos(playerid, 1475.7020,-1050.9489,23.8246);
                    SetPlayerCameraPos(playerid, 1458.3872,-1042.2423,24.8281);
                    SetPlayerCameraLookAt(playerid, 1458.5930,-1019.9205,24.5264);
                    SetPlayerInterior(playerid, 0);
                    SendClientMessage(playerid, COLOR_YELLOW, ":: BANK OF THE STATE ::");
                    SendClientMessage(playerid, COLOR_WHITE, " ");
                    SendClientMessage(playerid, COLOR_YELLOW2, "You won't keep all your money in your pocket, someone will try to steal it.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "You can /deposit, or /withdraw your money at the bank.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "You'll get you payday at your bank account too.");
                }
                else if(TutTime[playerid] == 110)
                {
                    SetPlayerInterior(playerid, 3);
                    SetPlayerPos(playerid, 330.6825,163.6688,1014.1875);
                    SetCameraBehindPlayer(playerid);
                    SetPlayerVirtualWorld(playerid, 0);
                    SendClientMessage(playerid, COLOR_YELLOW, ":: END OF TUTORIAL ::");
                    SendClientMessage(playerid, COLOR_WHITE, " ");
                    SendClientMessage(playerid, COLOR_YELLOW2, "There are a lot of places in Los Angeles, but you need to discover them on your own.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "Don't forget Role-Play rules, because non-rping causes warns and bans!");
                    SendClientMessage(playerid, COLOR_YELLOW2, "Greetings from: Los Angeles Roleplay admin team.");
                }
                else if(TutTime[playerid] == 119)
                {
                    SendClientMessage(playerid, COLOR_YELLOW2, "Welcome to the Los Angeles.");
                    SendClientMessage(playerid, COLOR_GRAD1, "Hint: To call a taxi or bus use /call 444 or /call 222");
                    SendClientMessage(playerid, COLOR_GRAD1, "Hint: To change your outfit you have to go to clothes shop");
                    SendClientMessage(playerid, COLOR_GRAD1, " ");
                    SetPlayerSpawn(playerid);
                    }
              }
        }
        return 1;
 }
Why do you have you're code so spaced from eachother get them to stuck with eachother liike this.
Reply
#3

You know your code is the same... right ... ?


Edit: and also you have got a mistake. You putted one more } which is nonless...
Reply
#4

You can try this,
pawn Код:
forward TutorialTimer(playerid);
public TutorialTimer(playerid)
{
TutTime[playerid] += 1;
return 1;
}

if (strcmp("/tutorialbasla", cmdtext, true, 10) == 0)
{
SetTimer("TutorialTimer", 1000, true);//Will repeat 1 second.
            if(TutTime[playerid] >= 1)
            {
                TutTime[playerid] += 1;
                if(TutTime[playerid] == 3)
                {
                    SendClientMessage(playerid, COLOR_WHITE, "So you are new here? We'll show you some places and give you some tips.");
                    SendClientMessage(playerid, COLOR_WHITE, "If you don't know how to RP, then leave this server.");
                    SendClientMessage(playerid, COLOR_WHITE, " ");
                    SetPlayerCameraPos(playerid, 2247.0215,-1655.0173,17.2856);
                    SetPlayerCameraLookAt(playerid, 2244.6536,-1663.9304,15.4766);
                    SetPlayerInterior(playerid, 0);
                    SetPlayerVirtualWorld(playerid, 99);
                    SetPlayerPos(playerid, 2256.3555,-1646.6377,15.4959);
                    SendClientMessage(playerid, COLOR_YELLOW, ":: CLOTHES SHOP ::");
                    SendClientMessage(playerid, COLOR_WHITE, " ");
                    SendClientMessage(playerid, COLOR_YELLOW2, "First of all you'll need some clothes, you can buy them at any clothes shop.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "When you're in the shop type /clothes and then type next untill you find the clothes that you like.");
                }
                else if(TutTime[playerid] == 16)
                {
                    SetPlayerPos(playerid, 2089.6624,-1901.7891,13.5469);
                    SetPlayerCameraPos(playerid, 2070.8093,-1914.6747,18.5469);
                    SetPlayerCameraLookAt(playerid, 2055.2405,-1906.4608,13.5469);
                    SetPlayerInterior(playerid, 0);
                    SendClientMessage(playerid, COLOR_YELLOW, ":: DRIVING SCHOOL ::");
                    SendClientMessage(playerid, COLOR_WHITE, " ");
                    SendClientMessage(playerid, COLOR_YELLOW2, "You still have no driving license? Shame on you!");
                    SendClientMessage(playerid, COLOR_YELLOW2, "You need to pass a driving test first to get a license.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "You can see the list of licensers by just typing /licensers.");
                }
                else if(TutTime[playerid] == 32)
                {
                    SetPlayerPos(playerid, 1514.3059,-1667.8116,14.0469);
                    SetPlayerCameraPos(playerid, 1535.9584,-1676.1428,18.3828);
                    SetPlayerCameraLookAt(playerid, 1553.7861,-1676.4270,16.1953);
                    SetPlayerInterior(playerid, 0);
                    SendClientMessage(playerid, COLOR_YELLOW, ":: LOS ANGELES POLICE DEPARTMENT ::");
                    SendClientMessage(playerid, COLOR_WHITE, " ");
                    SendClientMessage(playerid, COLOR_YELLOW2, "The Los Angeles Police Department and FBI are in the city for your protection.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "People who commit crimes will dealt with swiftly and with force if necessary.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "To call a police officer, call the emergency hotline using /call 911.");
                }
                else if(TutTime[playerid] == 54)
                {
                    SetPlayerPos(playerid, 1221.7010,-1328.6449,13.4821);
                    SetPlayerCameraPos(playerid, 1204.3781,-1313.3323,16.3984);
                    SetPlayerCameraLookAt(playerid, 1174.7167,-1323.4485,14.5938);
                    SetPlayerInterior(playerid, 0);
                    SendClientMessage(playerid, COLOR_YELLOW, ":: ALL SAINTS GENERAL HOSPITAL ::");
                    SendClientMessage(playerid, COLOR_WHITE, " ");
                    SendClientMessage(playerid, COLOR_YELLOW2, "Feeling sick? You need to see the doctor of Los Angeles.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "To call a paramedic, call the emergency hotline using /call 911");
                    SendClientMessage(playerid, COLOR_YELLOW2, "You'll spawn here after death");
                }
                else if(TutTime[playerid] == 76)
                {
                    SetPlayerPos(playerid, 1786.1758,-1258.4976,13.6417);
                    SetPlayerCameraPos(playerid, 1779.4259,-1275.1025,15.6328);
                    SetPlayerCameraLookAt(playerid, 1785.7263,-1296.0200,13.4213);
                    SetPlayerInterior(playerid, 0);
                    SendClientMessage(playerid, COLOR_YELLOW, ":: ABC STUDIO ::");
                    SendClientMessage(playerid, COLOR_WHITE, " ");
                    SendClientMessage(playerid, COLOR_YELLOW2, "Got some fresh news to announce? Go to the ABC Studio reporters and ask them to do it.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "You can also post your advertisment at local newspaper.");
                }
                else if(TutTime[playerid] == 98)
                {
                    SetPlayerPos(playerid, 1475.7020,-1050.9489,23.8246);
                    SetPlayerCameraPos(playerid, 1458.3872,-1042.2423,24.8281);
                    SetPlayerCameraLookAt(playerid, 1458.5930,-1019.9205,24.5264);
                    SetPlayerInterior(playerid, 0);
                    SendClientMessage(playerid, COLOR_YELLOW, ":: BANK OF THE STATE ::");
                    SendClientMessage(playerid, COLOR_WHITE, " ");
                    SendClientMessage(playerid, COLOR_YELLOW2, "You won't keep all your money in your pocket, someone will try to steal it.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "You can /deposit, or /withdraw your money at the bank.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "You'll get you payday at your bank account too.");
                }
                else if(TutTime[playerid] == 110)
                {
                    SetPlayerInterior(playerid, 3);
                    SetPlayerPos(playerid, 330.6825,163.6688,1014.1875);
                    SetCameraBehindPlayer(playerid);
                    SetPlayerVirtualWorld(playerid, 0);
                    SendClientMessage(playerid, COLOR_YELLOW, ":: END OF TUTORIAL ::");
                    SendClientMessage(playerid, COLOR_WHITE, " ");
                    SendClientMessage(playerid, COLOR_YELLOW2, "There are a lot of places in Los Angeles, but you need to discover them on your own.");
                    SendClientMessage(playerid, COLOR_YELLOW2, "Don't forget Role-Play rules, because non-rping causes warns and bans!");
                    SendClientMessage(playerid, COLOR_YELLOW2, "Greetings from: Los Angeles Roleplay admin team.");
                }
                else if(TutTime[playerid] == 119)
                {
                    SendClientMessage(playerid, COLOR_YELLOW2, "Welcome to the Los Angeles.");
                    SendClientMessage(playerid, COLOR_GRAD1, "Hint: To call a taxi or bus use /call 444 or /call 222");
                    SendClientMessage(playerid, COLOR_GRAD1, "Hint: To change your outfit you have to go to clothes shop");
                    SendClientMessage(playerid, COLOR_GRAD1, " ");
                    SetPlayerSpawn(playerid);
                    }
              }
        }
//Here you can destroy the timer
        return 1;
 }
Reply
#5

Thank you. Will try tomorrow. Will edit here if it works ^^
Reply
#6

Quote:
Originally Posted by Rufio
Посмотреть сообщение
You know your code is the same... right ... ?


Edit: and also you have got a mistake. You putted one more } which is nonless...
My code isent like yours smartass you're code was fucked up. AND i was just trieing to help-_-
Reply
#7

Quote:
Originally Posted by Wizza
Посмотреть сообщение
My code isent like yours smartass you're code was fucked up. AND i was just trieing to help-_-
Then dont try to help unless you know what you are doing. You have just added a } which is an extra thing. And which will give error. Please grow up then we can try talking again.

Edit: Plus i didn't insult you. Go and grow up.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)