Error with Tutorial
#1

I am having some weird issue with my script.
When I person enters the the tutorial, the whole server does...

Anyone can see the issue why this happens to me?


pawn Код:
public PutPlayerInTutorial(playerid)
    {
        TogglePlayerControllable(playerid, 0);

        TutStep[playerid] = 1;
        ClearPlayerChat(playerid);
       
        SendClientMessage(playerid, LIBLUE, "Intro");
        SendClientMessage(playerid, RED, "{FFFFFF}Welcome to Los Angeles Roleplay. This tutorial will benefit you by explaining various parts of our server.");
        SendClientMessage(playerid, RED, "{FFFFFF}If you didn't already know this server is role-play, meaning you take on the role of a character.");
        SendClientMessage(playerid, RED, "{FFFFFF}LARP is no place for deathmatching or stunting. We give the exception of racing if it is RP'ed properly and it is");
        SendClientMessage(playerid, RED, "{FFFFFF}authorised by an administrator/moderator. Here at Los Angeles ROleplay you are expected to roleplay as much as you can, this includes");
        SendClientMessage(playerid, RED, "{FFFFFF}roleplaying accidents, crashes, fear, deaths, jobs, shooting and whatever else your character is doing.");
       
        SetTimer("TutStep2", 25000, 0);
        return 1;
    }
   
    forward TutStep2(playerid);
    public TutStep2(playerid)
    {
        TogglePlayerControllable(playerid, 0);

        TutStep[playerid] = 2;
        ClearPlayerChat(playerid);
       
        SendClientMessage(playerid, LIBLUE, "House System");
        SendClientMessage(playerid, RED, "{FFFFFF}You might be happy to hear that we bring to you a completely unique and dynamic housing system, not like any other!");
        SendClientMessage(playerid, RED, "{FFFFFF}Buying a house is simple. All you need to do is /buyhouse next to a house (if you have the money) and wolla! You have a house!");
        SendClientMessage(playerid, RED, "{FFFFFF}You can store various items in your house, such as money, guns, drugs, clothes and much more!");
        SendClientMessage(playerid, RED, "{FFFFFF}You may not rob houses here at TL-RP as they are too expensive to cost a robbery. It's to keep fairness for poorer players.");
        SendClientMessage(playerid, RED, "{FFFFFF}Though if both parties and an administrator agree, you may rob a house under limited circumstances.");
       
        SetTimer("TutStep3", 25000, 0);
        return 1;
    }
   
    forward TutStep3(playerid);
    public TutStep3(playerid)
    {
        TogglePlayerControllable(playerid, 0);

        TutStep[playerid] = 3;
        ClearPlayerChat(playerid);
       
        SendClientMessage(playerid, LIBLUE, "Vehicle System");
        SendClientMessage(playerid, RED, "{FFFFFF}Vehicles here at LA-RP are vital and key to success and getting around here.");
        SendClientMessage(playerid, RED, "{FFFFFF}Buying a vehicle is straight forward. You can /viewcars at a dealership or you can");
        SendClientMessage(playerid, RED, "{FFFFFF}/buyvehicle at any owned vehicle that is for sale. Vehicles provide you transportation and ");
        SendClientMessage(playerid, RED, "{FFFFFF}we have included more advanced features. You can find them out yourself!");
        SendClientMessage(playerid, RED, "{FFFFFF}You can't rob vehicles physically but you can always RP robbing it if both parties and an admin agrees.");
       
        SetTimer("TutStep4", 25000, 0);
        return 1;
    }
   
    forward TutStep4(playerid);
    public TutStep4(playerid)
    {
        TogglePlayerControllable(playerid, 0);

        TutStep[playerid] = 4;
        ClearPlayerChat(playerid);
       
        SendClientMessage(playerid, LIBLUE, "Business System");
        SendClientMessage(playerid, RED, "{FFFFFF}Businesses here at TL-RP are just as simple as houses and vehicles. You /buybizz next to a forsale business and you have a bizz!");
        SendClientMessage(playerid, RED, "{FFFFFF}Bizzes are an excellent and efficient method of bringing in more income for your character.");
        SendClientMessage(playerid, RED, "{FFFFFF}To collect your payments, you receive it every payday. Some businesses allow you to /collectearnings to receive it instantly.");
        SendClientMessage(playerid, RED, "{FFFFFF}Everything a player buys in your shop gets added on to your final income, there are also entrance fees to boost your income.");
       
        SetTimer("TutStep5", 25000, 0);
        return 1;
    }
   
    forward TutStep5(playerid);
    public TutStep5(playerid)
    {
        TogglePlayerControllable(playerid, 0);

        TutStep[playerid] = 5;
        ClearPlayerChat(playerid);
       
        SendClientMessage(playerid, LIBLUE, "Faction System");
        SendClientMessage(playerid, RED, "{FFFFFF}Here are LARP there are different kinds of factions. From Law Enforcement to Illegal Roleplay.");
        SendClientMessage(playerid, RED, "{FFFFFF}The faction system is fully dynamic and it's all worked out with MySQL and everything can be added in-game.");
        SendClientMessage(playerid, RED, "{FFFFFF}The Police Department (LAPD) is located in Los Angeles, and it is being controlled by the faction leaders of it.");
        SendClientMessage(playerid, RED, "{FFFFFF}There is only one way or starting a new unofficial legal and illegal faction, which is to make a thread on the forums.");
       
        SetTimer("TutStep6", 1000*25, 0);
        return 1;
    }
   
    forward TutStep6(playerid);
    public TutStep6(playerid)
    {
        TutStep[playerid] = 5;
        ClearPlayerChat(playerid);
       
        TogglePlayerControllable(playerid, 0);
        SendClientMessage(playerid, LIBLUE, "Ending");
        SendClientMessage(playerid, RED, "{FFFFFF}We have decided to put as little effort into the tutorial as possible, because you will be able to read the rest on the forums.");
        SendClientMessage(playerid, RED, "{FFFFFF}We hope this helped you out a lot, and the Administration Team wishes you the best of luck!");
       
        SetTimer("TutorialComplete11", 1000*25, 0);
    }
   
    forward TutorialComplete11(playerid);
    public TutorialComplete11(playerid)
    {
        TutStep[playerid] = 0;
        Player[playerid][TutorialComplete] = 1;
        Player[playerid][Money] = 1000;
        Player[playerid][BankMoney] = 2500;
        Player[playerid][Clothes1] = 1;
        Player[playerid][ClothesSlot] = 1;
        Player[playerid][Health] = 100;
        Player[playerid][Armour] = 0;
        Player[playerid][NoobSpawnType] = 0;
        Player[playerid][SpawnType] = 1;
        SetPlayerHealth(playerid, 100);
        SetSpawnInfo(playerid, 0, Player[playerid][Clothes1], 1742.7489, -1860.6775, 13.5784, 1.1766, 0, 0, 0, 0, 0, 0); //Montgomery
        SpawnPlayer(playerid);
        TogglePlayerControllable(playerid, 1);
        TogglePlayerSpectating(playerid, 0);
        SaveStats(playerid);
    }
pawn Код:
SetTimerEx("PutPlayerInTutorial", 5000, false, "i", playerid);
Reply
#2

Hi,

Your SetTimerEx() is maybe called for everyone. Could you show us the code around SetTimerEx() ?
Reply
#3

Is "PutPlayerInTutorial" forwarded?
Reply
#4

Yes it is forwarded.

I don't know what you mean with called for everyone, when it is playerid.... But it must be it somewhere. Can someone help me with this on teamviewer?
Reply
#5

Replace your
pawn Код:
SetTimer("TutStep2", 25000, 0);
with
pawn Код:
SetTimerEx("TutStep2", 25000, 0, "i",playerid);
and continue it through your tutorial code; so for:
pawn Код:
SetTimer("TutStep3", 25000, 0);
SetTimer("TutStep4", 25000, 0);
SetTimer("TutStep5", 25000, 0);
SetTimer("TutStep6", 25000, 0);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)