mSelection calling OnDialogResponse - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: mSelection calling OnDialogResponse (
/showthread.php?tid=597560)
mSelection calling OnDialogResponse -
TakeiT - 02.01.2016
When there is a response on mSelection (Actually, it seems to be happening on OnPlayerClickTextdraw), OnDialogResponse is called. I have the mSelection piece in a filterscript. It originally called a line under OnDialogResponse that kicked you if you pushed "Quit" on the login screen, I changed that to simply say return 0; and now it brings up the login screen saying incorrect password.
The ids between the two are completely different
I tried changing the id of the login dialog.
OnPlayerModelSelectionEx is also called.
Код:
public OnPlayerModelSelectionEx(playerid, response, extraid, modelid)
{
if(extraid == SearchMenu)
{
if(response)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
GetXYInFrontOfPlayer(playerid, X, Y, 2);
CreateDynamicObject(modelid, X, Y, Z, 0.0, 0.0, 0.0, GetPlayerVirtualWorld(playerid), -1, -1);
SelectObject(playerid);
return 0;
}
}
return 0;
}
Код:
hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case LoginDialog:
{
if(!response) return 0; //KickWithMessage(playerid, COLBLOODRED, "Goodbye!");
KillTimer(LogTimer[playerid]);
new hash[129], query[256];
WP_Hash(hash, sizeof(hash), inputtext);
mysql_format(connection, query, sizeof(query), "SELECT * FROM `users` WHERE `name` = '%s' AND `pass` = '%e'", GetName(playerid), hash);
mysql_pquery(connection, query, "OnPlayerLoginAttempt", "d", playerid);
} //</login>
Код:
CMD:fsearch(playerid, params[])
{
if(GetPVarInt(playerid, "LOGGED") != 1) return 0;
new items, arrSearch[160];
if (isnull(params)) return ErrorMessage(playerid, "Usage: /fsearch [query]");
for(new i = 0; i< sizeof(ObjectList) && items < sizeof(arrSearch); i++)
{
if(strfind(ObjectList[i][oName], params, true) != -1)
{
arrSearch[items++] = ObjectList[i][oID];
}
}
if(items == 0) return ErrorMessage(playerid, "No results were found.");
if(items >= 160) InfoMessage(playerid, "More results were found, please narrow your search.");
ShowModelSelectionMenuEx(playerid, arrSearch, items, "Search Results", SearchMenu, 0.0, 0.0, 45.0);
return 1;
}
Re: mSelection calling OnDialogResponse -
TakeiT - 03.01.2016
bump.