Dialogue Problem - 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: Dialogue Problem (
/showthread.php?tid=412557)
Dialogue Problem -
Youice - 02.02.2013
Hello,
Is there anything that affect OnDialogResponse with defects ?
like: makes it not responds to "ShowPlayerDialog" call.
needed codes:
PHP код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) // Player entered a vehicle as a driver
{
new vehid = GetPlayerVehicleID(playerid);
if(IsRentalVeh(vehid)) {
if(GetPVarInt(playerid, "VRenting") == 0 && RentedVeh[playerid][vehid] == 0 && VehtRented[vehid] == 0)//if he entered a rental car and he is not renting
{
if(GetVehicleModel(vehid) == 560) {
ShowPlayerDialog(playerid, DIALOG_ID, DIALOG_STYLE_MSGBOX, "Rental Box:", "Do You Want To Rent This ("COL_RED"Sultan"COL_WHITE")/nFor "COL_GREEN"$500 "COL_WHITE"?", "Rent","No");
}
else if(GetVehicleModel(vehid) == 462) {
ShowPlayerDialog(playerid, DIALOG_ID2, DIALOG_STYLE_MSGBOX, "Rental Box:", "Do You Want To Rent This ("COL_RED"Faggio"COL_WHITE")/nFor "COL_GREEN"$100 "COL_WHITE"?", "Rent","No");
}
}
else if(GetPVarInt(playerid, "VRenting") == 1 && RentedVeh[playerid][vehid] == 0)//if he entered a rental car and he's renting
{
SendClientMessage(playerid, -1, "Manager: Hey Where Is My Vehicle?\nManager:Better To Find It Or I Will Use The Law Force");
RemovePlayerFromVehicleEx(playerid);
}
}
}
return 1;
}
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_ID)
{
if(response)
{
if(GetPlayerMoney(playerid) < 500)
{
SendClientMessage(playerid, -1, "You Don't have that amount of money");
RemovePlayerFromVehicleEx(playerid);
}
else {
SendClientMessage(playerid, -1, "worked");
ShowPlayerDialog(playerid, DIALOG_ID3, DIALOG_STYLE_LIST, "Choose Your Rental Time:","Hour\n\rHalf-Hour\n\rFive Minutes", "Choose", "Cancel");
}
}
else {
RemovePlayerFromVehicleEx(playerid);
SendClientMessage(playerid, -1, "worked");
}
}
if(dialogid == DIALOG_ID2)
{
if(response)
{
if(GetPlayerMoney(playerid) < 100)
{
SendClientMessage(playerid, -1, "You Don't have that amount of money");
RemovePlayerFromVehicleEx(playerid);
}
else {
ShowPlayerDialog(playerid, DIALOG_ID3, DIALOG_STYLE_LIST, "Choose Your Rental Time:","Hour\n\rHalf-Hour\n\rFive Minutes", "Choose", "Cancel");
}
}
else {
RemovePlayerFromVehicleEx(playerid);
}
}
"Worked" messages if for testing the function being called or no, result is: no.
I appreciate any kind of help.
-Thanks-
Re: Dialogue Problem -
Youice - 02.02.2013
any help?
Re: Dialogue Problem -
spedico - 02.02.2013
So what is the problem exactly? Which part doesn't work?
Re: Dialogue Problem -
Youice - 03.02.2013
Quote:
Originally Posted by spedico
So what is the problem exactly? Which part doesn't work?
|
The Dialog. Part...
Re: Dialogue Problem -
Youice - 03.02.2013
any kind of help?