All dialogs not showing up
#1

Hey all.
I have seen that all my server dialogs not showing up !!
the login and register one don't show up !!
But in other gamemodes it show up !
can ya help me ?
Reply
#2

Maybe show us when and how you show the player the dialogs, and explain what exactly happens?
Reply
#3

if you expect us to help then you need to show the code or explain it properly.
Reply
#4

If you've '' return 1; '' in your gamemode dialog and also '' return 1; '' in filterscript one, it wont appear,
Please change your gamemode return to '' return 1; '' and filterscript one to '' return 0; '',
If not work then please show us the code.
Reply
#5

Код:
//---------------------------------------------------------
#include <a_samp>
#include <easyDialog>
#include <sscanf2>
#include <zcmd>					
#include <FCNPC>
native WP_Hash(buffer[], len, const str[]);					
//---------------------------------------------------------
#define 		COLOR_WHITE 		0xFFFFFFAA
#define 		COLOR_BLACK 		0x000000FF
#define 		COLOR_GREY			0xB4B5B7FF
#define 		COLOR_YELLOW 		0xFFFF00AA
#define 		COLOR_RED 			0xAA3333AA
#define 		COLOR_ORANGE 		0xF69521AA
#define 		COLOR_GREEN 		0x33AA33AA
#define 		COLOR_PURPLE 		0xC2A2DAAA
#define			COLOR_CYAN 			0x00FFFFFF
#define 		COLOR_GOLD	 		0xFFD700FF
#define 		COLOR_LIME 			0x00FF00FF
#define 		COLOR_TEAL          0x008080AA
#define 		COLOR_HOTPINK 		0xFF69B4FF
#define 		COLOR_LAVENDER 		0xE6E6FAFF
#define 		COLOR_LIGHTRED 		0xFF6347AA
#define 		COLOR_CYANBLUE	 	0x01FCFFC8
#define 		COLOR_LIGHTBLUE 	0x33CCFFAA
//---------------------------------------------------------
enum pinfo
{
	pID,
	pName[24],
	pPass[129],
	pKills,
	pDeaths,
	pRescues,
	pMoney,
	pScore,
	pAdmin,
	pVIP,
	pHelper,
	pJailed,
	pFrozen,
	pMuted
};
new pInfo[MAX_PLAYERS][pinfo];
new DB:db;
new IsRescuing[MAX_PLAYERS];
enum hostageinfo
{
	Boubo,
	Gage,
	Tim,
	Nike
};
new hInfo[hostageinfo];
//---------------------------------------------------------
public OnGameModeInit()
{
	new Tick = GetTickCount();
	if((db = db_open("database.db")) == DB: 0)
	{
		print("The connection to Database failed");
		SendRconCommand("exit");
	}
	else
	{
		print("The connection to Database Was successfully");
	}
	db_query(db, "CREATE TABLE IF NOT EXISTS `Users` (ID INTEGER PRIMARY KEY AUTOINCREMENT, Username VARCHAR(24), Password VARCHAR(129), Kills INTEGER DEFAULT 0 NOT NULL, \
	Deaths INTEGER DEFAULT 0 NOT NULL, Rescues INTEGER DEFAULT 0 NOT NULL, Money INTEGER DEFAULT 0 NOT NULL, Score INTEGER DEFAULT 0 NOT NULL, Admin INTEGER DEFAULT 0 NOT NULL, \
	VIP INTEGER DEFAULT 0 NOT NULL, Helper INTEGER DEFAULT 0 NOT NULL)");
	db_query(db, "CREATE TABLE IF NOT EXISTS `Bans` (ID INTEGER PRIMARY KEY AUTOINCREMENT, Username VARCHAR(24), Admin VARCHAR(24), Reason VARCHAR(64))");
	Hostage_Load();
	print("\n----------------------------------------------------------");
	printf("Counter Strike Hostage Rescue has been loaded  in %i millisecond !!", GetTickCount() - Tick);
	print("------------------------------------------------------------\n");
	return 1;
}			
public OnGameModeExit()
{
	db_close(db);
}	
//---------------------------------------------------------
public OnPlayerConnect(playerid)
{
	if(IsPlayerNPC(playerid)) return 1;
	TogglePlayerSpectating(playerid, true);
	new DBResult:rows, query[256];
	GetPlayerName(playerid, pInfo[playerid][pName], 24);
	format(query, 256, "SELECT Password FROM Users WHERE Username = '%q' LIMIT 1", pInfo[playerid][pName]);
	rows = db_query(db, query);
	if(db_num_rows(rows))
	{
		db_get_field_assoc(rows, "Password", pInfo[playerid][pPass], 129);
		Dialog_Show(playerid, LoginDialog, DIALOG_STYLE_PASSWORD, "Login...", "Welcome back on the server ! Please input your password below in order to login", "Login", "Quit");
		return 1;
	}
	else
	{
		Dialog_Show(playerid, RegisterDialog, DIALOG_STYLE_PASSWORD, "Register...", "Welcome on the server ! Please input your password to register !", "Register", "Quit");
	}
	db_free_result(rows);
	return 1;
}
public OnPlayerSpawn(playerid)
{
	TogglePlayerSpectating(playerid, false);
}
//---------------------------------------------------------
Dialog:LoginDialog(playerid, response, listitem, inputtext[])
{
	if(!response) return Kick(playerid);
	new buf[129], DBResult:result;
	WP_Hash(buf, 129, inputtext);
	if(strcmp(buf, pInfo[playerid][pPass]))
	{
		SendClientMessage(playerid, COLOR_RED, "[Server]: Incorrect password !");
		Dialog_Show(playerid, LoginDialog, DIALOG_STYLE_PASSWORD, "Login...", "Welcome back on the server ! Please input your password below in order to login", "Login", "Quit");
	}	
	else
	{
		SendClientMessage(playerid, COLOR_GREEN, "You have logged in successfully ! Loading your data...");
		format(buf, 129, "SELECT * FROM Users WHERE Username = '%q'", pInfo[playerid][pName]);
		result = db_query(db, buf);
		if(db_num_rows(result))
		{
			pInfo[playerid][pKills] = db_get_field_assoc_int(result, "Kills");
			pInfo[playerid][pDeaths] = db_get_field_assoc_int(result, "Deaths");
			pInfo[playerid][pRescues] = db_get_field_assoc_int(result, "Rescues");
			pInfo[playerid][pMoney] = db_get_field_assoc_int(result, "Money");
			pInfo[playerid][pScore] = db_get_field_assoc_int(result, "Score");
			pInfo[playerid][pAdmin] = db_get_field_assoc_int(result, "Admin");
			pInfo[playerid][pVIP] = db_get_field_assoc_int(result, "VIP");
			pInfo[playerid][pHelper] = db_get_field_assoc_int(result, "Helper");
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your stats has been loaded successfully");
			Dialog_Show(playerid, ClassSelection, DIALOG_STYLE_LIST, "Select Class", "Swat\nFBI\nTerrorist\nCivilian", "Select", "Quit");
			return 1;
		}
		db_free_result(result);
	}
	return 1;
}
Dialog:RegisterDialog(playerid, response, listitem, inputtext[])
{
	if(!response) return Kick(playerid);
	new buf[129];
	if(strlen(inputtext) < 3 || strlen(inputtext) > 30)
	{
		SendClientMessage(playerid, COLOR_RED, "[Server]: Your password must be atleast 3 characters and no longer than 30 character");
		Dialog_Show(playerid, RegisterDialog, DIALOG_STYLE_PASSWORD, "Register...", "Welcome on the server ! Please input your password to register !", "Register", "Quit");
	}
	WP_Hash(buf, 129, inputtext);
	format(buf, 129, "INSERT INTO Users (Username, Password, Kills, Deaths, Rescues, Money, Score, Admin, VIP, Helper) VALUES ('%q', '%q', 0, 0, 0, 0, 0, 0, 0, 0)", pInfo[playerid][pName], buf);
	db_query(db, buf);
	SendClientMessage(playerid, COLOR_GREEN, "Your account have been registered to our database !");
	Dialog_Show(playerid, ClassSelection, DIALOG_STYLE_LIST, "Select Class", "Swat\nFBI\nTerrorist\nCivilian", "Select", "Quit");
	return 1;
}
Dialog:ClassSelection(playerid, response, listitem, inputtext[])
{
	if(!response) return Kick(playerid);
	switch (listitem)
	{
		case 0:
		{
			SetSpawnInfo(playerid, 0, 285, 113.0274,1817.4178,17.6406,6.1685, 24, 250, 31, 500, 349, 250);
			SpawnPlayer(playerid);
			SetPlayerColor(playerid, COLOR_LIGHTBLUE);
			return 1;
		}
		case 1:
		{
			SetSpawnInfo(playerid, 0, 286, 139.5702,1831.3447,17.6481,178.5035, 24, 250, 31, 500, 349, 250);
			SpawnPlayer(playerid);
			SetPlayerColor(playerid, COLOR_CYANBLUE);
			return 1;
		}
		case 2:
		{
			SetSpawnInfo(playerid, 0, 136, 246.6212,1838.1112,7.5547,181.0105, 24, 250, 30, 500, 349, 250);
			SpawnPlayer(playerid);
			SetPlayerColor(playerid, COLOR_RED);
			return 1;
		}
		case 3:
		{
			SetSpawnInfo(playerid, 0, 210, 248.0576,1827.7900,7.5547,273.7347, 24, 250, 30, 500, 349, 250);
			SpawnPlayer(playerid);
			SetPlayerColor(playerid, COLOR_LIGHTRED);
			return 1;
		}
	}
	return 1;
}
//---------------------------------------------------------
stock Hostage_Load()
{
	hInfo[Boubo] = FCNPC_Create("Boubo");
	hInfo[Gage] = FCNPC_Create("Gage");
	hInfo[Tim] = FCNPC_Create("Tim");
	hInfo[Nike] = FCNPC_Create("Nike");
	FCNPC_Spawn(hInfo[Boubo], 7, 263.0442,1851.0674,8.7578);
	FCNPC_Spawn(hInfo[Gage], 7, 263.0663,1852.0133,8.7578);
	FCNPC_Spawn(hInfo[Tim], 15, 262.9948,1857.0647,8);
	FCNPC_Spawn(hInfo[Nike], 15, 263.1034,1860.6825,8);
	return 1;
}
stock randomEx(min, max)
{    
    //Credits to ******    
    new rand = random(max-min)+min;    
    return rand;
}
This is all my gamemode !
The dialogs is not showing
even if i converted the EasyDialog to ShowPlayerDialog it don't work !
Reply
#6

are you using any sort of filterscript hah, if yes then show it, it might be conflicting with this one
Reply
#7

Quote:
Originally Posted by FuNkYTheGreat
Посмотреть сообщение
are you using any sort of filterscript hah, if yes then show it, it might be conflicting with this one
No i'm not using any sort of filterscript
Reply
#8

I tested your gamemode and its working fine.

the register dialog also shows up,
Reply
#9

Quote:
Originally Posted by FuNkYTheGreat
Посмотреть сообщение
I tested your gamemode and its working fine.

the register dialog also shows up,
So why he don't work for me
Reply
#10

Quote:
Originally Posted by HoussemGaming
Посмотреть сообщение
So why he don't work for me
Show us your server.cfg and do you see dialogs in other servers?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)