10.08.2016, 10:50
I have posted @ Twizted's thread about this issue (re-using his thread) but since it's being ignored, I have decided to create a separated one.
I am using mSelection on my RP script (which I worked on since April 2016). It was working fine until today, It stopped working. The textdraws aren't responding, and when I press ESC the menu closes (I have scripted it that when player pressed ESC the menu will pop-up again, Preventing the player from avoiding that menu). I have added something from the script that might have caused something from mSelection to stop working, though as far as I remember I never scripted any textdraw related functions so I don't think it was the cause of the problem.
Here is how I process and use mSelection on my RP script;
After selecting gender (DIALOG_STYLE_LIST), Player are proceeded to mSelection's menu (Skins, Depending on the gender. Male or Female) after choosing the skin, They are moved to the Origin's dialog (DIALOG_STYLE_INPUT).
Later on in the script, they are used again on buying clothes (/buyclothes).
Other than that, It wasn't used again.
How can I fix this? Is there any possible way to make mSelection work again?
Code:
I am using mSelection on my RP script (which I worked on since April 2016). It was working fine until today, It stopped working. The textdraws aren't responding, and when I press ESC the menu closes (I have scripted it that when player pressed ESC the menu will pop-up again, Preventing the player from avoiding that menu). I have added something from the script that might have caused something from mSelection to stop working, though as far as I remember I never scripted any textdraw related functions so I don't think it was the cause of the problem.
Here is how I process and use mSelection on my RP script;
After selecting gender (DIALOG_STYLE_LIST), Player are proceeded to mSelection's menu (Skins, Depending on the gender. Male or Female) after choosing the skin, They are moved to the Origin's dialog (DIALOG_STYLE_INPUT).
Later on in the script, they are used again on buying clothes (/buyclothes).
Other than that, It wasn't used again.
How can I fix this? Is there any possible way to make mSelection work again?
Code:
PHP код:
new reg_male_skin = mS_INVALID_LISTID;
new reg_female_skin = mS_INVALID_LISTID;
new clothing_male_skin = mS_INVALID_LISTID;
new clothing_female_skin = mS_INVALID_LISTID;
// OnGameModeInit
reg_male_skin = LoadModelSelectionMenu("renegade/males.txt");
reg_female_skin = LoadModelSelectionMenu("renegade/females.txt");
clothing_male_skin = LoadModelSelectionMenu("renegade/clothing_males.txt");
clothing_female_skin = LoadModelSelectionMenu("renegade/clothing_females.txt");
// Callback
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
new query[130];
if(listid == reg_male_skin)
{
if(response)
{
PlayerInfo[playerid][pModel] = modelid;
format(query, sizeof(query), "UPDATE `users` SET `model` = %d WHERE `username` = '%s'", PlayerInfo[playerid][pModel], DB_Escape(GetPlayersName(playerid)));
db_query(database, query);
ClearChatbox(playerid);
SendClientMessage(playerid, -1, "* You have chosen your character's clothes.");
SendClientMessage(playerid, COLOR_LIGHTRED, "[ ! ] Type your character's origin (Birth Place).");
SendClientMessage(playerid, COLOR_CLIENT, "Example;{FFFFFF} Origin is your character's birthplace - EX; Los Angeles, California");
ShowPlayerDialog(playerid, DIALOG_RORIGIN, DIALOG_STYLE_INPUT, "Character's Origin", "Type in your character's origin (Birthplace)\n\n* Ex; Los Angeles, California\n\n* DO NOT troll with the origin.", "Set", "");
}
else
{
ShowModelSelectionMenu(playerid, reg_male_skin, "Character Clothes");
}
}
else if(listid == reg_female_skin)
{
if(response)
{
PlayerInfo[playerid][pModel] = modelid;
format(query, sizeof(query), "UPDATE `users` SET `model` = %d WHERE `username` = '%s'", PlayerInfo[playerid][pModel], DB_Escape(GetPlayersName(playerid)));
db_query(database, query);
SendClientMessage(playerid, -1, "* You have chosen your character's clothes.");
SendClientMessage(playerid, COLOR_LIGHTRED, "[ ! ] Type your character's origin (Birth Place).");
SendClientMessage(playerid, COLOR_CLIENT, "Example;{FFFFFF} Origin is your character's birthplace - EX; Los Angeles, California");
ShowPlayerDialog(playerid, DIALOG_RORIGIN, DIALOG_STYLE_INPUT, "Character's Origin", "Type in your character's origin (Birthplace)\n\n* Ex; Los Angeles, California\n\n* DO NOT troll with the origin.", "Set", "");
}
else
{
ShowModelSelectionMenu(playerid, reg_female_skin, "Character Clothes");
}
}
else if(listid == clothing_male_skin || listid == clothing_female_skin)
{
if(response)
{
new
bizid = -1,
price;
if ((bizid = Biz_Inside(playerid)) == -1 || BizInfo[bizid][bType] != 3)
return 0;
if (BizInfo[bizid][bProducts] < 1)
return SendError(playerid, "This business is out of stock.");
price = BizInfo[bizid][bizPrice][0];
if (GetPlayerCash(playerid) < price)
return SendError(playerid, "You have insufficient funds for to purchase this clothes.");
GivePlayerCash(playerid, -price);
BizInfo[bizid][bProducts]--;
BizInfo[bizid][bVault] += Tax_Percent(price);
Biz_Save(bizid);
Tax_AddPercent(price);
PlayerInfo[playerid][pModel] = modelid;
SetPlayerSkin(playerid, modelid);
format(query, sizeof(query), "has paid $%s and received the clothes they bought.", AddComma(price));
cmd_me(playerid, query);
format(query, sizeof(query), "~w~$%s~n~~g~Purchased!", AddComma(price));
GameTextForPlayer(playerid, query, 5000, 1);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
}
}
return 1;
}