This is not working
#1

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case DIALOG_LOGIN:
        {
            if(!response)
            {
                SendClientMessage(playerid, COLOUR_RED, "Kick due to : Quitted login");
                return Kick(playerid);
            }
            if(CheckUserLogin(playerid, inputtext))
            {
                if( PlayerInfo[playerid][tutorial] >= 1)
                {
                    TogglePlayerSpectating(playerid, false);
                    LoginUser(playerid);
                    SpawnPlayer(playerid);
                }
                if( PlayerInfo[playerid][tutorial] == 0)
                {
                    SendClientMessage(playerid, RED, "You left during the tutorial, not to worry here it is now.
                    ShowPlayerDialog(playerid, 100, DIALOG_STYLE_LIST, "
What is meant by DM", "Deadmen\nDeathmatching\nDeathmaking\nDudemoaning", "Select", "Quit");
                }
            }
            else
            {
                SendClientMessage(playerid, COLOUR_RED, "
Wrong password, please try again");
                return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "
Login", "Type in your password to login", "Login", "Quit");
            }
        }
The tutorial itself works and at the end it sets PlayerInfo[playerid][tutorial] =1;. The idea is that if they log out during the tutorial then they cannot log in and it puts them back into the tutorial. The problem however is that even if tutorial is = to 1 It still puts me in it. Help please.
Reply
#2

In which way do you save the Player Info? File Systems, MySQL.. or other?
Reply
#3

Dini
Reply
#4

Show us your enum..
Reply
#5

Why? I check the user file and tutorial is = to 1
Reply
#6

Quote:
Originally Posted by cloudysky
Посмотреть сообщение
Why? I check the user file and tutorial is = to 1
If you want the tutorial to not repeat when they leave in between. Then change the value to 1 when a player starts the tutorial..
Reply
#7

But i do want it to repeat when they leave thats the point, so they don't skip the tutorial when they log in. If I change it to 1 where your suggesting it, then they can just leave, join again and play without even looking at the tutorial.

EDIT: I dont want it to repeat for those that have already watched it all.
Reply
#8

Ok, add another value then.

Example:
0 - Tutorial not seen.
1 - Left during the tut.
2 - Tutorial seen.

In short, When a player connects [First time], it will be 0.
> Showtutorial & set to 1.
> if player finished tutorial, set to 2.
> if player left in between, then it will remain 1...

So, player reconnecting...
> His value is 1, showtutorial.
> If he already seen, his value will be 2. So, let him continue without tut.
Reply
#9

Ok i see where your coming from i'll try it. But look at my code is there anything wrong with that cause that should be working and it really isn't...
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)