PDA

View Full Version : Help About OnDialogResponse !!! Help


xganyx
20/06/2013, 07:31 AM
code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response == 1)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "gCars", "Bikes\nBoats\nCars\nFactionCars\nFlans\nRC", "Select", "Close");
}
if(listitem == 1)
{
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "gWeapons", "9mm\ns9mm\nDesert Eagle\nShotgun\nSawoffShotgun\nCombat Shotgun\nUzi\nMp5\nAK-47\nM4\nTec-9\nCountry Rifle\nSniper Rifle\nCamera\nParachute", "Select", "Close");
}
}
}
if(dialogid == 2)
{
if(response == 1)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Bikes", "NRG-500\nPCJ-600\nFreeway", "Select", "Close");
}
if(listitem == 1)
{
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Boats", "Speeder\nVortex", "Select", "Close");
}
if(listitem == 2)
{
ShowPlayerDialog(playerid, 6, DIALOG_STYLE_LIST, "Cars", "Landstalker\nBravura\nBuffalo\nLinerunner\nPerenni el\nSentinel\nDumper\nTrashmaster\nStretch\nManana \nNext Page", "Select", "Close");
}
if(listitem == 3)
{
ShowPlayerDialog(playerid, 7, DIALOG_STYLE_LIST, "F Cars", "Firetruck\nAmbulance\nTaxi\nCabbie\nEnforcer\nSecu ricar\nBus\nRhino\nCoach\nNext Page", "Select", "Close");
}
if(listitem == 4)
{
ShowPlayerDialog(playerid, 8, DIALOG_STYLE_LIST, "Flans", "Laviathan\nHunter\nSeasparrow\nSkimmer\nSparrow\nR ustler\nMaverick\nSAN News Maverick\nPolice Maverick\nNext Page", "Select", "Close");
}
if(listitem == 5)
{
ShowPlayerDialog(playerid, 9, DIALOG_STYLE_LIST, "RC", "RC Baron\nRC Raider\nRC Goblin\nRC Tiger\nRC Cam", "Select", "Close");
}
}
}
if(dialogid == 3)
{
if(response == 1)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid, 22, 9999);
GivePlayerMoney(playerid, -5000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With 9mm. Price Is 5000$!!");
}
if(listitem == 1)
{
GivePlayerWeapon(playerid, 23, 9999);
GivePlayerMoney(playerid, -10000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With s9mm. Price Is 10000$!!");
}
if(listitem == 2)
{
GivePlayerWeapon(playerid, 24, 9999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Desert Eagle. Price Is 30000$!!");
}
if(listitem == 3)
{
GivePlayerWeapon(playerid, 25, 9999);
GivePlayerMoney(playerid, -20000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Shotgun. Price Is 20000$!!");
}
if(listitem == 4)
{
GivePlayerWeapon(playerid, 26, 9999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With SawoffShotgun. Price Is 30000$!!");
}
if(listitem == 5)
{
GivePlayerWeapon(playerid, 27, 9999);
GivePlayerMoney(playerid, -50000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With CombatShotgun. Price Is 50000$!!");
}
if(listitem == 6)
{
GivePlayerWeapon(playerid, 28, 9999);
GivePlayerMoney(playerid, -40000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Uzi. Price Is 40000$!!");
}
if(listitem == 7)
{
GivePlayerWeapon(playerid, 29, 9999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With MP5. Price Is 30000$!!");
}
if(listitem == 8)
{
GivePlayerWeapon(playerid, 30, 9999);
GivePlayerMoney(playerid, -50000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With AK-47. Price Is 50000$!!");
}
if(listitem == 9)
{
GivePlayerWeapon(playerid, 31, 9999);
GivePlayerMoney(playerid, -60000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With M4. Price Is 60000$!!");
}
if(listitem == 10)
{
GivePlayerWeapon(playerid, 32, 9999);
GivePlayerMoney(playerid, -40000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Tec-9. Price Is 40000$!!");
}
if(listitem == 11)
{
GivePlayerWeapon(playerid, 33, 9999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Country Rifle. Price Is 30000$!!");
}
if(listitem == 11)
{
GivePlayerWeapon(playerid, 34, 9999);
GivePlayerMoney(playerid, -100000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Sniper Rifle. Price Is 100000$!!");
}
if(listitem == 12)
{
GivePlayerWeapon(playerid, 43, 9999);
GivePlayerMoney(playerid, -2000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Camera. Price Is 2000$!!");
}
}
}
if(dialogid == 4)
{
if(response == 1)
{
if(listitem == 0)
{
CreateVehicleForPlayer(playerid, 522, 3, 6, 1000);
}
if(listitem == 1)
{
CreateVehicleForPlayer(playerid, 461, 3, 6, 1000);
}
if(listitem == 2)
{
CreateVehicleForPlayer(playerid, 463, 2, 2, 1000);
}
}
return 1;
}
return 0;
}
error :
:\Documents and Settings\hung\Desktop\Server\filterscripts\GSystem .pwn(199) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\hung\Desktop\Server\filterscripts\GSystem .pwn(203) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\hung\Desktop\Server\filterscripts\GSystem .pwn(207) : error 035: argument type mismatch (argument 2)
line error:
if(dialogid == 4)
{
if(response == 1)
{
if(listitem == 0)
{
CreateVehicleForPlayer(playerid, 522, 3, 6, 1000);
}
if(listitem == 1)
{
CreateVehicleForPlayer(playerid, 461, 3, 6, 1000);
}
if(listitem == 2)
{
CreateVehicleForPlayer(playerid, 463, 2, 2, 1000);
}
}
return 1;
}
return 0;
}
help please

Scrillex
20/06/2013, 07:41 AM
LOl it is easy..
if(response == 1) ain't correct..

it's needs to be just if(response)

AdamCooper
20/06/2013, 07:46 AM
Use cases its much simpler.
Example :
if(dialogid == 4 && response)
{
switch(listitem)
{
case 0: //
{
'create vehicle' /// your CreateVehicle function
}
case 1:
{
'create vehicle' /// your CreateVehicle function
}
}
return 1;
}

You can choose to add it or not.
else if(dialogid == 4 && response == 0) return SendClientMessage(playerid, COLOR_RED, "Cancelled.");

xganyx
20/06/2013, 07:54 AM
LOl it is easy..
if(response == 1) ain't correct..

it's needs to be just if(response)
not work

IceBilizard
20/06/2013, 07:58 AM
try this

if (dialogid == 4 && response)
{

switch (listitem)
{
case 0:
{
CreateVehicleForPlayer(playerid, 522, 3, 6, 1000);
}

case 1:
{
CreateVehicleForPlayer(playerid, 461, 3, 6, 1000);
}
case 2:
{
CreateVehicleForPlayer(playerid, 463, 2, 2, 1000);
}
return 1;
}

}

Scrillex
20/06/2013, 08:19 AM
What is not working?

SwisherSweet
20/06/2013, 08:23 AM
scrillex ir you response nothing the dialog won't work
it supposed to be response == 1)

Scrillex
20/06/2013, 08:28 AM
Nice tutorial ;) (http://wiki.sa-mp.com/wiki/How_to_Create_a_Dialog)

xganyx
20/06/2013, 10:34 AM
all is not work @@
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response == 1)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "gCars", "Bikes\nBoats\nCars\nFactionCars\nFlans\nRC", "Select", "Close");
}
if(listitem == 1)
{
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "gWeapons", "9mm\ns9mm\nDesert Eagle\nShotgun\nSawoffShotgun\nCombat Shotgun\nUzi\nMp5\nAK-47\nM4\nTec-9\nCountry Rifle\nSniper Rifle\nCamera\nParachute", "Select", "Close");
}
}
}
if(dialogid == 2)
{
if(response == 1)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Bikes", "NRG-500\nPCJ-600\nFreeway", "Select", "Close");
}
if(listitem == 1)
{
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Boats", "Speeder\nVortex", "Select", "Close");
}
if(listitem == 2)
{
ShowPlayerDialog(playerid, 6, DIALOG_STYLE_LIST, "Cars", "Landstalker\nBravura\nBuffalo\nLinerunner\nPerenni el\nSentinel\nDumper\nTrashmaster\nStretch\nManana \nNext Page", "Select", "Close");
}
if(listitem == 3)
{
ShowPlayerDialog(playerid, 7, DIALOG_STYLE_LIST, "F Cars", "Firetruck\nAmbulance\nTaxi\nCabbie\nEnforcer\nSecu ricar\nBus\nRhino\nCoach\nNext Page", "Select", "Close");
}
if(listitem == 4)
{
ShowPlayerDialog(playerid, 8, DIALOG_STYLE_LIST, "Flans", "Laviathan\nHunter\nSeasparrow\nSkimmer\nSparrow\nR ustler\nMaverick\nSAN News Maverick\nPolice Maverick\nNext Page", "Select", "Close");
}
if(listitem == 5)
{
ShowPlayerDialog(playerid, 9, DIALOG_STYLE_LIST, "RC", "RC Baron\nRC Raider\nRC Goblin\nRC Tiger\nRC Cam", "Select", "Close");
}
}
}
if(dialogid == 3)
{
if(response == 1)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid, 22, 9999);
GivePlayerMoney(playerid, -5000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With 9mm. Price Is 5000$!!");
}
if(listitem == 1)
{
GivePlayerWeapon(playerid, 23, 9999);
GivePlayerMoney(playerid, -10000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With s9mm. Price Is 10000$!!");
}
if(listitem == 2)
{
GivePlayerWeapon(playerid, 24, 9999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Desert Eagle. Price Is 30000$!!");
}
if(listitem == 3)
{
GivePlayerWeapon(playerid, 25, 9999);
GivePlayerMoney(playerid, -20000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Shotgun. Price Is 20000$!!");
}
if(listitem == 4)
{
GivePlayerWeapon(playerid, 26, 9999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With SawoffShotgun. Price Is 30000$!!");
}
if(listitem == 5)
{
GivePlayerWeapon(playerid, 27, 9999);
GivePlayerMoney(playerid, -50000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With CombatShotgun. Price Is 50000$!!");
}
if(listitem == 6)
{
GivePlayerWeapon(playerid, 28, 9999);
GivePlayerMoney(playerid, -40000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Uzi. Price Is 40000$!!");
}
if(listitem == 7)
{
GivePlayerWeapon(playerid, 29, 9999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With MP5. Price Is 30000$!!");
}
if(listitem == 8)
{
GivePlayerWeapon(playerid, 30, 9999);
GivePlayerMoney(playerid, -50000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With AK-47. Price Is 50000$!!");
}
if(listitem == 9)
{
GivePlayerWeapon(playerid, 31, 9999);
GivePlayerMoney(playerid, -60000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With M4. Price Is 60000$!!");
}
if(listitem == 10)
{
GivePlayerWeapon(playerid, 32, 9999);
GivePlayerMoney(playerid, -40000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Tec-9. Price Is 40000$!!");
}
if(listitem == 11)
{
GivePlayerWeapon(playerid, 33, 9999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Country Rifle. Price Is 30000$!!");
}
if(listitem == 11)
{
GivePlayerWeapon(playerid, 34, 9999);
GivePlayerMoney(playerid, -100000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Sniper Rifle. Price Is 100000$!!");
}
if(listitem == 12)
{
GivePlayerWeapon(playerid, 43, 9999);
GivePlayerMoney(playerid, -2000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Camera. Price Is 2000$!!");
}
}
}
if(dialogid == 4)
{
if(response == 1)
{
if(listitem == 0)
{
CreateVehicleForPlayer(playerid, 522, 3, 6, 1000);
}
if(listitem == 1)
{
CreateVehicleForPlayer(playerid, 461, 3, 6, 1000);
}
if(listitem == 2)
{
CreateVehicleForPlayer(playerid, 463, 2, 2, 1000);
}
}
return 1;
}
return 0;
}
error :
C:\Documents and Settings\hung\Desktop\Server\filterscripts\GSystem .pwn(199) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\hung\Desktop\Server\filterscripts\GSystem .pwn(203) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\hung\Desktop\Server\filterscripts\GSystem .pwn(207) : error 035: argument type mismatch (argument 2)
the line error is diglogid == 4:
if(dialogid == 3)
{
if(response == 1)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid, 22, 9999);
GivePlayerMoney(playerid, -5000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With 9mm. Price Is 5000$!!");
}
if(listitem == 1)
{
GivePlayerWeapon(playerid, 23, 9999);
GivePlayerMoney(playerid, -10000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With s9mm. Price Is 10000$!!");
}
if(listitem == 2)
{
GivePlayerWeapon(playerid, 24, 9999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Desert Eagle. Price Is 30000$!!");
}
if(listitem == 3)
{
GivePlayerWeapon(playerid, 25, 9999);
GivePlayerMoney(playerid, -20000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Shotgun. Price Is 20000$!!");
}
if(listitem == 4)
{
GivePlayerWeapon(playerid, 26, 9999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With SawoffShotgun. Price Is 30000$!!");
}
if(listitem == 5)
{
GivePlayerWeapon(playerid, 27, 9999);
GivePlayerMoney(playerid, -50000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With CombatShotgun. Price Is 50000$!!");
}
if(listitem == 6)
{
GivePlayerWeapon(playerid, 28, 9999);
GivePlayerMoney(playerid, -40000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Uzi. Price Is 40000$!!");
}
if(listitem == 7)
{
GivePlayerWeapon(playerid, 29, 9999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With MP5. Price Is 30000$!!");
}
if(listitem == 8)
{
GivePlayerWeapon(playerid, 30, 9999);
GivePlayerMoney(playerid, -50000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With AK-47. Price Is 50000$!!");
}
if(listitem == 9)
{
GivePlayerWeapon(playerid, 31, 9999);
GivePlayerMoney(playerid, -60000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With M4. Price Is 60000$!!");
}
if(listitem == 10)
{
GivePlayerWeapon(playerid, 32, 9999);
GivePlayerMoney(playerid, -40000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Tec-9. Price Is 40000$!!");
}
if(listitem == 11)
{
GivePlayerWeapon(playerid, 33, 9999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Country Rifle. Price Is 30000$!!");
}
if(listitem == 11)
{
GivePlayerWeapon(playerid, 34, 9999);
GivePlayerMoney(playerid, -100000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Sniper Rifle. Price Is 100000$!!");
}
if(listitem == 12)
{
GivePlayerWeapon(playerid, 43, 9999);
GivePlayerMoney(playerid, -2000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Camera. Price Is 2000$!!");
}
}
}
if(dialogid == 4)
{
if(response == 1)
{
if(listitem == 0)
{
CreateVehicleForPlayer(playerid, 522, 3, 6, 1000);
}
if(listitem == 1)
{
CreateVehicleForPlayer(playerid, 461, 3, 6, 1000);
}
if(listitem == 2)
{
CreateVehicleForPlayer(playerid, 463, 2, 2, 1000);
}
}
return 1;
}
return 0;
}
Please Help Me I'm Very Need this

AdamCooper
20/06/2013, 01:29 PM
Well it 100% works. You're doing something wrong.

SilverKiller
20/06/2013, 01:37 PM
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response == 1)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "gCars", "Bikes\nBoats\nCars\nFactionCars\nFlans\nRC", "Select", "Close");
}
if(listitem == 1)
{
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "gWeapons", "9mm\ns9mm\nDesert Eagle\nShotgun\nSawoffShotgun\nCombat Shotgun\nUzi\nMp5\nAK-47\nM4\nTec-9\nCountry Rifle\nSniper Rifle\nCamera\nParachute", "Select", "Close");
}
}
}
if(dialogid == 2)
{
if(response == 1)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Bikes", "NRG-500\nPCJ-600\nFreeway", "Select", "Close");
}
if(listitem == 1)
{
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Boats", "Speeder\nVortex", "Select", "Close");
}
if(listitem == 2)
{
ShowPlayerDialog(playerid, 6, DIALOG_STYLE_LIST, "Cars", "Landstalker\nBravura\nBuffalo\nLinerunner\nPerenni el\nSentinel\nDumper\nTrashmaster\nStretch\nManana \nNext Page", "Select", "Close");
}
if(listitem == 3)
{
ShowPlayerDialog(playerid, 7, DIALOG_STYLE_LIST, "F Cars", "Firetruck\nAmbulance\nTaxi\nCabbie\nEnforcer\nSecu ricar\nBus\nRhino\nCoach\nNext Page", "Select", "Close");
}
if(listitem == 4)
{
ShowPlayerDialog(playerid, 8, DIALOG_STYLE_LIST, "Flans", "Laviathan\nHunter\nSeasparrow\nSkimmer\nSparrow\nR ustler\nMaverick\nSAN News Maverick\nPolice Maverick\nNext Page", "Select", "Close");
}
if(listitem == 5)
{
ShowPlayerDialog(playerid, 9, DIALOG_STYLE_LIST, "RC", "RC Baron\nRC Raider\nRC Goblin\nRC Tiger\nRC Cam", "Select", "Close");
}
}
}
if(dialogid == 3)
{
if(response == 1)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid, 22, 9999);
GivePlayerMoney(playerid, -5000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With 9mm. Price Is 5000$!!");
}
if(listitem == 1)
{
GivePlayerWeapon(playerid, 23, 9999);
GivePlayerMoney(playerid, -10000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With s9mm. Price Is 10000$!!");
}
if(listitem == 2)
{
GivePlayerWeapon(playerid, 24, 9999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Desert Eagle. Price Is 30000$!!");
}
if(listitem == 3)
{
GivePlayerWeapon(playerid, 25, 9999);
GivePlayerMoney(playerid, -20000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Shotgun. Price Is 20000$!!");
}
if(listitem == 4)
{
GivePlayerWeapon(playerid, 26, 9999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With SawoffShotgun. Price Is 30000$!!");
}
if(listitem == 5)
{
GivePlayerWeapon(playerid, 27, 9999);
GivePlayerMoney(playerid, -50000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With CombatShotgun. Price Is 50000$!!");
}
if(listitem == 6)
{
GivePlayerWeapon(playerid, 28, 9999);
GivePlayerMoney(playerid, -40000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Uzi. Price Is 40000$!!");
}
if(listitem == 7)
{
GivePlayerWeapon(playerid, 29, 9999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With MP5. Price Is 30000$!!");
}
if(listitem == 8)
{
GivePlayerWeapon(playerid, 30, 9999);
GivePlayerMoney(playerid, -50000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With AK-47. Price Is 50000$!!");
}
if(listitem == 9)
{
GivePlayerWeapon(playerid, 31, 9999);
GivePlayerMoney(playerid, -60000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With M4. Price Is 60000$!!");
}
if(listitem == 10)
{
GivePlayerWeapon(playerid, 32, 9999);
GivePlayerMoney(playerid, -40000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Tec-9. Price Is 40000$!!");
}
if(listitem == 11)
{
GivePlayerWeapon(playerid, 33, 9999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Country Rifle. Price Is 30000$!!");
}
if(listitem == 11)
{
GivePlayerWeapon(playerid, 34, 9999);
GivePlayerMoney(playerid, -100000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Sniper Rifle. Price Is 100000$!!");
}
if(listitem == 12)
{
GivePlayerWeapon(playerid, 43, 9999);
GivePlayerMoney(playerid, -2000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Camera. Price Is 2000$!!");
}
}
}
if(dialogid == 4)
{
if(response == 1)
{
if(listitem == 0)
{
CreateVehicleForPlayer(playerid, "522", 3, 6, 1000);
}
if(listitem == 1)
{
CreateVehicleForPlayer(playerid, "461", 3, 6, 1000);
}
if(listitem == 2)
{
CreateVehicleForPlayer(playerid, "463", 2, 2, 1000);
}
}
return 1;
}
return 0;
}

You forgot " " in CreateVehicleForPlayer (http://forum.sa-mp.com/showthread.php?t=264591), if you look at the examples, you will know what i meant.

@Scrillex: Both if(response) and if(response == 1) are working.

Josh_Main
20/06/2013, 02:21 PM
all is not work @@
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response == 1)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "gCars", "Bikes\nBoats\nCars\nFactionCars\nFlans\nRC", "Select", "Close");
}
if(listitem == 1)
{
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "gWeapons", "9mm\ns9mm\nDesert Eagle\nShotgun\nSawoffShotgun\nCombat Shotgun\nUzi\nMp5\nAK-47\nM4\nTec-9\nCountry Rifle\nSniper Rifle\nCamera\nParachute", "Select", "Close");
}
}
}
if(dialogid == 2)
{
if(response == 1)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Bikes", "NRG-500\nPCJ-600\nFreeway", "Select", "Close");
}
if(listitem == 1)
{
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Boats", "Speeder\nVortex", "Select", "Close");
}
if(listitem == 2)
{
ShowPlayerDialog(playerid, 6, DIALOG_STYLE_LIST, "Cars", "Landstalker\nBravura\nBuffalo\nLinerunner\nPerenni el\nSentinel\nDumper\nTrashmaster\nStretch\nManana \nNext Page", "Select", "Close");
}
if(listitem == 3)
{
ShowPlayerDialog(playerid, 7, DIALOG_STYLE_LIST, "F Cars", "Firetruck\nAmbulance\nTaxi\nCabbie\nEnforcer\nSecu ricar\nBus\nRhino\nCoach\nNext Page", "Select", "Close");
}
if(listitem == 4)
{
ShowPlayerDialog(playerid, 8, DIALOG_STYLE_LIST, "Flans", "Laviathan\nHunter\nSeasparrow\nSkimmer\nSparrow\nR ustler\nMaverick\nSAN News Maverick\nPolice Maverick\nNext Page", "Select", "Close");
}
if(listitem == 5)
{
ShowPlayerDialog(playerid, 9, DIALOG_STYLE_LIST, "RC", "RC Baron\nRC Raider\nRC Goblin\nRC Tiger\nRC Cam", "Select", "Close");
}
}
}
if(dialogid == 3)
{
if(response == 1)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid, 22, 9999);
GivePlayerMoney(playerid, -5000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With 9mm. Price Is 5000$!!");
}
if(listitem == 1)
{
GivePlayerWeapon(playerid, 23, 9999);
GivePlayerMoney(playerid, -10000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With s9mm. Price Is 10000$!!");
}
if(listitem == 2)
{
GivePlayerWeapon(playerid, 24, 9999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Desert Eagle. Price Is 30000$!!");
}
if(listitem == 3)
{
GivePlayerWeapon(playerid, 25, 9999);
GivePlayerMoney(playerid, -20000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Shotgun. Price Is 20000$!!");
}
if(listitem == 4)
{
GivePlayerWeapon(playerid, 26, 9999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With SawoffShotgun. Price Is 30000$!!");
}
if(listitem == 5)
{
GivePlayerWeapon(playerid, 27, 9999);
GivePlayerMoney(playerid, -50000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With CombatShotgun. Price Is 50000$!!");
}
if(listitem == 6)
{
GivePlayerWeapon(playerid, 28, 9999);
GivePlayerMoney(playerid, -40000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Uzi. Price Is 40000$!!");
}
if(listitem == 7)
{
GivePlayerWeapon(playerid, 29, 9999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With MP5. Price Is 30000$!!");
}
if(listitem == 8)
{
GivePlayerWeapon(playerid, 30, 9999);
GivePlayerMoney(playerid, -50000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With AK-47. Price Is 50000$!!");
}
if(listitem == 9)
{
GivePlayerWeapon(playerid, 31, 9999);
GivePlayerMoney(playerid, -60000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With M4. Price Is 60000$!!");
}
if(listitem == 10)
{
GivePlayerWeapon(playerid, 32, 9999);
GivePlayerMoney(playerid, -40000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Tec-9. Price Is 40000$!!");
}
if(listitem == 11)
{
GivePlayerWeapon(playerid, 33, 9999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Country Rifle. Price Is 30000$!!");
}
if(listitem == 11)
{
GivePlayerWeapon(playerid, 34, 9999);
GivePlayerMoney(playerid, -100000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Sniper Rifle. Price Is 100000$!!");
}
if(listitem == 12)
{
GivePlayerWeapon(playerid, 43, 9999);
GivePlayerMoney(playerid, -2000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Camera. Price Is 2000$!!");
}
}
}
if(dialogid == 4)
{
if(response == 1)
{
if(listitem == 0)
{
CreateVehicleForPlayer(playerid, 522, 3, 6, 1000);
}
if(listitem == 1)
{
CreateVehicleForPlayer(playerid, 461, 3, 6, 1000);
}
if(listitem == 2)
{
CreateVehicleForPlayer(playerid, 463, 2, 2, 1000);
}
}
return 1;
}
return 0;
}
error :
C:\Documents and Settings\hung\Desktop\Server\filterscripts\GSystem .pwn(199) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\hung\Desktop\Server\filterscripts\GSystem .pwn(203) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\hung\Desktop\Server\filterscripts\GSystem .pwn(207) : error 035: argument type mismatch (argument 2)
the line error is diglogid == 4:
if(dialogid == 3)
{
if(response == 1)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid, 22, 9999);
GivePlayerMoney(playerid, -5000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With 9mm. Price Is 5000$!!");
}
if(listitem == 1)
{
GivePlayerWeapon(playerid, 23, 9999);
GivePlayerMoney(playerid, -10000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With s9mm. Price Is 10000$!!");
}
if(listitem == 2)
{
GivePlayerWeapon(playerid, 24, 9999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Desert Eagle. Price Is 30000$!!");
}
if(listitem == 3)
{
GivePlayerWeapon(playerid, 25, 9999);
GivePlayerMoney(playerid, -20000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Shotgun. Price Is 20000$!!");
}
if(listitem == 4)
{
GivePlayerWeapon(playerid, 26, 9999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With SawoffShotgun. Price Is 30000$!!");
}
if(listitem == 5)
{
GivePlayerWeapon(playerid, 27, 9999);
GivePlayerMoney(playerid, -50000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With CombatShotgun. Price Is 50000$!!");
}
if(listitem == 6)
{
GivePlayerWeapon(playerid, 28, 9999);
GivePlayerMoney(playerid, -40000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Uzi. Price Is 40000$!!");
}
if(listitem == 7)
{
GivePlayerWeapon(playerid, 29, 9999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With MP5. Price Is 30000$!!");
}
if(listitem == 8)
{
GivePlayerWeapon(playerid, 30, 9999);
GivePlayerMoney(playerid, -50000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With AK-47. Price Is 50000$!!");
}
if(listitem == 9)
{
GivePlayerWeapon(playerid, 31, 9999);
GivePlayerMoney(playerid, -60000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With M4. Price Is 60000$!!");
}
if(listitem == 10)
{
GivePlayerWeapon(playerid, 32, 9999);
GivePlayerMoney(playerid, -40000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Tec-9. Price Is 40000$!!");
}
if(listitem == 11)
{
GivePlayerWeapon(playerid, 33, 9999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Country Rifle. Price Is 30000$!!");
}
if(listitem == 11)
{
GivePlayerWeapon(playerid, 34, 9999);
GivePlayerMoney(playerid, -100000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Sniper Rifle. Price Is 100000$!!");
}
if(listitem == 12)
{
GivePlayerWeapon(playerid, 43, 9999);
GivePlayerMoney(playerid, -2000);
SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Camera. Price Is 2000$!!");
}
}
}
if(dialogid == 4)
{
if(response == 1)
{
if(listitem == 0)
{
CreateVehicleForPlayer(playerid, 522, 3, 6, 1000);
}
if(listitem == 1)
{
CreateVehicleForPlayer(playerid, 461, 3, 6, 1000);
}
if(listitem == 2)
{
CreateVehicleForPlayer(playerid, 463, 2, 2, 1000);
}
}
return 1;
}
return 0;
}
Please Help Me I'm Very Need this


Change:

if(response == 1)

to this:

if(response)

SilverKiller
20/06/2013, 02:30 PM
Change:

if(response == 1)

to this:

if(response)

That won't change anything, if(response == 1) and if(response) are the same..