Dialog wont show up
#1

Well the registration/login dialog wont show up.
Have i done anything wrong with this code?
Код:
public OnPlayerConnect(playerid)
{
    new str[500];
	new PlayerText:playertextid;
	new rows, fields;
    cache_get_data(rows, fields, dbHandle);
    if(rows)
    if(CheckingBot{playerid})
    {
        format(msg, sizeof(msg), "Welcome to Havana Roleplay, %s\nThis user was found in our database, please enter your password below to login.\n\nYou have 60 seconds to login.", GetName(playerid));
        ShowDialog(playerid, Show:<Login>, DIALOG_STYLE_INPUT, ""EMBED_YELLOW"Havana Roleplay Login"EMBED_WHITE"", msg, "Login", "Quit");
        LoginTimer{playerid} = SetTimerEx("CheckPlayerLogged", 60000, 0, "i", playerid);
    }
    else
 	{
		for(new i = 4; i < sizeof(Captcha); i++)
		{
			if(playertextid == Captcha[i])
			{
				new step = GetIntVar(playerid, "CaptchaStep"), sstring[96];
				GetPVarString(playerid, "CaptchaText", sstring, sizeof(sstring));
				switch(step)
				{
					case 0: format(sstring, sizeof(sstring), "%c", TextArray[i - 4]), strcat(sstring, "----"), SetPVarString(playerid, "CaptchaText", sstring);
					case 1: format(sstring, sizeof(sstring), "%s%c", sstring, TextArray[i - 4]), strdel(sstring, 1, 5), strcat(sstring, "---"), SetPVarString(playerid, "CaptchaText", sstring);
					case 2: format(sstring, sizeof(sstring), "%s%c", sstring, TextArray[i - 4]), strdel(sstring, 2, 5), strcat(sstring, "--"), SetPVarString(playerid, "CaptchaText", sstring);
					case 3: format(sstring, sizeof(sstring), "%s%c", sstring, TextArray[i - 4]), strdel(sstring, 3, 5), strcat(sstring, "-"), SetPVarString(playerid, "CaptchaText", sstring);
					case 4:
					{
						strdel(sstring, 4, 5);
						format(sstring, sizeof(sstring), "%s%c", sstring, TextArray[i - 4]);
						PlayerTextDrawSetString(playerid, Captcha[3], sstring);
						new cstring[24];
						GetPVarString(playerid, "CaptchaCode", cstring, sizeof(cstring));
						if(strcmp(cstring, sstring) != 0)
						{
							format(cstring, sizeof(cstring), "%c%c%c%c%c", TextArray[random(sizeof(TextArray) - 1)], TextArray[random(sizeof(TextArray) - 1)], TextArray[random(sizeof(TextArray) - 1)], TextArray[random(sizeof(TextArray) - 1)], TextArray[random(sizeof(TextArray) - 1)]);
							PlayerTextDrawSetString(playerid, Captcha[1], cstring);
							SetStringVar(playerid, "CaptchaCode", cstring);
							PlayerTextDrawSetString(playerid, Captcha[3], "-----");
							//If they we're wrong
							SCM(playerid, 0xFF0000FF, "Wrong anti-bot capthcha! Try again...");
							//If they we're wrong
							RemoveVar(playerid, "CaptchaStep");
							RemoveVar(playerid, "CaptchaText");
							return 1;
						}
						else
						{
							for(new l = 0; l < sizeof(Captcha); l++) PlayerTextDrawHide(playerid, Captcha[l]);
							RemoveVar(playerid, "CaptchaStep");
							RemoveVar(playerid, "CaptchaCode");
							RemoveVar(playerid, "CaptchaText");
							SetIntVar(playerid, "CaptchaPass", 1);
							CancelSelectTextDraw(playerid);
							//Send registration dialog
							ShowTextDraw(playerid, WelcomeDraw);
							CheckingBot{playerid} = false;
							SCM(playerid, COLOR_LIGHTRED, "You passed the anti-bot capthcha!");
							SetIntVar(playerid, "RegisterPart", 1);
							format(str, sizeof(str), ""EMBED_WHITE"Welcome to Havana Roleplay, "EMBED_RED"%s\n"EMBED_WHITE"This user was not found in our database, please enter a password below to register.", GetName(playerid));
							ShowDialog(playerid, Show:<Register>, DIALOG_STYLE_INPUT, ""EMBED_YELLOW"Havana Roleplay Registration"EMBED_WHITE"", str, "Register", "Quit");
							//Send registration dialog
							return 1;
						}
					}
				}
				SetIntVar(playerid, "CaptchaStep", step + 1);
				PlayerTextDrawSetString(playerid, Captcha[3], sstring);
			}
		}
	}
	if(GetIntVar(playerid, "SelectingUniform") == 1)
	{
		if(playertextid == NextButton[playerid])
		{
			if(SkinSlot[playerid] >= sizeof(LSPDSkins)-1) return 1;
			SkinSlot[playerid]++;
			SetPlayerSkin(playerid, LSPDSkins[SkinSlot[playerid]]);
			SetIntVar(playerid, "SkinChosen", LSPDSkins[SkinSlot[playerid]]);
			OnPlayAnim(playerid,"DEALER","DEALER_IDLE",4.0,1,0,0,0,0);
		}
		if(playertextid == PrevButton[playerid])
		{
			if(SkinSlot[playerid] == 0) return 1;
			SkinSlot[playerid]--;
			SetPlayerSkin(playerid, LSPDSkins[SkinSlot[playerid]]);
			SetIntVar(playerid, "SkinChosen", LSPDSkins[SkinSlot[playerid]]);
			OnPlayAnim(playerid,"DEALER","DEALER_IDLE",4.0,1,0,0,0,0);
		}
		if(playertextid == WearButton[playerid])
		{
			new skin = GetIntVar(playerid, "SkinChosen");
			if(skin == 281)
			{
				SetPlayerSkin(playerid, skin);
				SetCameraBehindPlayer(playerid);
				CancelSelectTextDraw(playerid);
				PlayerTextDrawHide(playerid, NextButton[playerid]);
				PlayerTextDrawHide(playerid, PrevButton[playerid]);
				PlayerTextDrawHide(playerid, WearButton[playerid]);
				UnFreezePlayer(playerid);
				StopPlayerAnims(playerid);
			}
			else if(skin == 265 || skin == 266 || skin == 267 || skin == 280 || skin == 284)
			{
				if(PlayerInfo[playerid][pRank] < 2) return SCM(playerid, COLOR_LIGHTRED, "You are not authorized to wear this skin at your current rank.");
				SetPlayerSkin(playerid, skin);
				SetCameraBehindPlayer(playerid);
				CancelSelectTextDraw(playerid);
				PlayerTextDrawHide(playerid, NextButton[playerid]);
				PlayerTextDrawHide(playerid, PrevButton[playerid]);
				PlayerTextDrawHide(playerid, WearButton[playerid]);
				UnFreezePlayer(playerid);
				StopPlayerAnims(playerid);
			}
		}
	}
	if(GetIntVar(playerid, "SelectingUniform") == 2)
	{
		if(playertextid == NextButton[playerid])
		{
			if(SkinSlot[playerid] >= sizeof(LSFDSkins)-1) return 1;
			SkinSlot[playerid]++;
			SetPlayerSkin(playerid, LSFDSkins[SkinSlot[playerid]]);
			SetIntVar(playerid, "SkinChosen", LSFDSkins[SkinSlot[playerid]]);
			OnPlayAnim(playerid,"DEALER","DEALER_IDLE",4.0,1,0,0,0,0);
		}
		if(playertextid == PrevButton[playerid])
		{
			if(SkinSlot[playerid] == 0) return 1;
			SkinSlot[playerid]--;
			SetPlayerSkin(playerid, LSFDSkins[SkinSlot[playerid]]);
			SetIntVar(playerid, "SkinChosen", LSFDSkins[SkinSlot[playerid]]);
			OnPlayAnim(playerid,"DEALER","DEALER_IDLE",4.0,1,0,0,0,0);
		}
		if(playertextid == WearButton[playerid])
		{
			new skin = GetIntVar(playerid, "SkinChosen");
			SetPlayerSkin(playerid, skin);
			SetCameraBehindPlayer(playerid);
			CancelSelectTextDraw(playerid);
			PlayerTextDrawHide(playerid, NextButton[playerid]);
			PlayerTextDrawHide(playerid, PrevButton[playerid]);
			PlayerTextDrawHide(playerid, WearButton[playerid]);
			UnFreezePlayer(playerid);
			StopPlayerAnims(playerid);
		}
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)