PDA

View Full Version : A problem with a dialog


Burning
10/06/2013, 09:52 AM
Hello, I made a dialog like Ammu-Nation GUNSHOP, but when I enter that pickup nobody's happen's. Please help me out :(.
That's response for dialog
public OnDialogResponse(playerid,dialogid,response,listit em,inputtext[])
{
//AMMU-NATION parduotuvė
if(dialogid == DIALOG_AMMU_GUN)
{
if(listitem == 0)
{
if(GetPlayerMoneyA(playerid)<7500){
SendClientMessage(playerid,-1,"{F22715}SERVERIS:{F2C915} Neturite tiek pinigų!"); return 1;
}
GivePlayerMoneyA(playerid, -7500);
SendClientMessage(playerid,-1,"{F22715}SERVERIS:{F2C915} Įsigijote Deagle 100 kulkų už 7500 LT!");
GivePlayerWeapon(playerid,24,100);
}
if(listitem == 1)
{
if(GetPlayerMoneyA(playerid)<5000){
SendClientMessage(playerid,-1,"{F22715}SERVERIS:{F2C915} Neturite tiek pinigų!"); return 1;
}
GivePlayerMoneyA(playerid, -5000);
SendClientMessage(playerid,-1,"{F22715}SERVERIS:{F2C915} Įsigijote Colt 100 kulkų už 5000 LT!");
GivePlayerWeapon(playerid,22,100);
}
if(listitem == 2)
{
if(GetPlayerMoneyA(playerid)<11750){
SendClientMessage(playerid,-1,"{F22715}SERVERIS:{F2C915} Neturite tiek pinigų!"); return 1;
}
GivePlayerMoneyA(playerid, -5000);
SendClientMessage(playerid,-1,"{F22715}SERVERIS:{F2C915} Įsigijote MP5 100 kulkų už 11750 LT!");
GivePlayerWeapon(playerid,29,100);
}
if(listitem == 3)
{
if(GetPlayerMoneyA(playerid)<15000){
SendClientMessage(playerid,-1,"{F22715}SERVERIS:{F2C915} Neturite tiek pinigų!"); return 1;
}
GivePlayerMoneyA(playerid, -15000);
SendClientMessage(playerid,-1,"{F22715}SERVERIS:{F2C915} Įsigijote Shotgun 100 kulkų už 15000 LT!");
GivePlayerWeapon(playerid,25,100);
}
}
}
}
///
And here's define
#define DIALOG_AMMU_GUN 456123
And that's where i'm responsing when entering a pickup
if(pickupid == pickups[1][ammunationgun])
{
if(!playerDB[playerid][teisesG])
{
SendClientMessage(playerid,-1,"{F22715}SERVERIS:{F2C915} Jūs negalite pirkti ginklų, kol neturite licenzijos, išsilaikykite ją!");
}
else{
ShowPlayerDialog(playerid,DIALOG_AMMU_GUN,DIALOG_S TYLE_LIST,"Parduotuvė","Deagle(100)\nColt(100)\nMP5(100)\nShotgun(100)","Pasirinkti","Atgal");
}
}
Please, help me..I'm doing some edit from a LTG gamemode, that's Lithuanian. Help me, say what I'm doing wrong, thanks :)

IceBilizard
10/06/2013, 09:56 AM
public OnDialogResponse(playerid,dialogid,response,listit em,inputtext[])
{
//AMMU-NATION parduotuvė
if(dialogid == DIALOG_AMMU_GUN)
{
if(response == 1)
{
if(listitem == 0)
{
if(GetPlayerMoneyA(playerid)<7500){
SendClientMessage(playerid,-1,"{F22715}SERVERIS:{F2C915} Neturite tiek pinigų!"); return 1;
}
GivePlayerMoneyA(playerid, -7500);
SendClientMessage(playerid,-1,"{F22715}SERVERIS:{F2C915} Įsigijote Deagle 100 kulkų už 7500 LT!");
GivePlayerWeapon(playerid,24,100);
}
if(listitem == 1)
{
if(GetPlayerMoneyA(playerid)<5000){
SendClientMessage(playerid,-1,"{F22715}SERVERIS:{F2C915} Neturite tiek pinigų!"); return 1;
}
GivePlayerMoneyA(playerid, -5000);
SendClientMessage(playerid,-1,"{F22715}SERVERIS:{F2C915} Įsigijote Colt 100 kulkų už 5000 LT!");
GivePlayerWeapon(playerid,22,100);
}
if(listitem == 2)
{
if(GetPlayerMoneyA(playerid)<11750){
SendClientMessage(playerid,-1,"{F22715}SERVERIS:{F2C915} Neturite tiek pinigų!"); return 1;
}
GivePlayerMoneyA(playerid, -5000);
SendClientMessage(playerid,-1,"{F22715}SERVERIS:{F2C915} Įsigijote MP5 100 kulkų už 11750 LT!");
GivePlayerWeapon(playerid,29,100);
}
if(listitem == 3)
{
if(GetPlayerMoneyA(playerid)<15000){
SendClientMessage(playerid,-1,"{F22715}SERVERIS:{F2C915} Neturite tiek pinigų!"); return 1;
}
GivePlayerMoneyA(playerid, -15000);
SendClientMessage(playerid,-1,"{F22715}SERVERIS:{F2C915} Įsigijote Shotgun 100 kulkų už 15000 LT!");
GivePlayerWeapon(playerid,25,100);
}
}
}
}
}

Burning
10/06/2013, 09:58 AM
Still, pickup doesn't shows the dialog..:|
I guess I did wrong here:
if(pickupid == pickups[1][ammunationgun])
{
if(!playerDB[playerid][teisesG])
{
SendClientMessage(playerid,-1,"{F22715}SERVERIS:{F2C915} Jūs negalite pirkti ginklų, kol neturite licenzijos, išsilaikykite ją!");
}
else{
ShowPlayerDialog(playerid,DIALOG_AMMU_GUN,DIALOG_S TYLE_LIST,"Parduotuvė","Deagle(100)\nColt(100)\nMP5(100)\nShotgun(100)","Pasirinkti","Atgal");
}
}

IceBilizard
10/06/2013, 10:15 AM
where you create pickup in script post

Burning
10/06/2013, 10:17 AM
pickups[0][ammunationgun]=CreatePickupA(1274 ,2,287.9525,-105.9843,1001.5156);
and
enum pdata{
ammunationgun
}
new pickups[2][pdata];

IceBilizard
10/06/2013, 10:20 AM
your problem is

pickups[1][ammunationgun]

you did in script

pickups[0][ammunationgun]


do

if(pickupid == pickups[0][ammunationgun])
{
if(!playerDB[playerid][teisesG])
{
SendClientMessage(playerid,-1,"{F22715}SERVERIS:{F2C915} Jūs negalite pirkti ginklų, kol neturite licenzijos, išsilaikykite ją!");
}
else{
ShowPlayerDialog(playerid,DIALOG_AMMU_GUN,DIALOG_S TYLE_LIST,"Parduotuvė","Deagle(100)\nColt(100)\nMP5(100)\nShotgun(100)","Pasirinkti","Atgal");
}
}

Burning
10/06/2013, 10:21 AM
damn..thanks :)

Burning
10/06/2013, 10:24 AM
Sorry for doublepost, but it's still doesn't working :/

IceBilizard
10/06/2013, 10:31 AM
remove all pickups and add like this




new AmmuPickup;//Top on the script



then go at


public OnGameModeInit()
{
AmmuPickup = CreatePickup(1274 ,1,287.9525,-105.9843,1001.5156,-1);
}



public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == AmmuPickup)
{
if(!playerDB[playerid][teisesG])
{
SendClientMessage(playerid,-1,"{F22715}SERVERIS:{F2C915} Jūs negalite pirkti ginklų, kol neturite licenzijos, išsilaikykite ją!");
}
else{
ShowPlayerDialog(playerid,DIALOG_AMMU_GUN,DIALOG_S TYLE_LIST,"Parduotuvė","Deagle(100)\nColt(100)\nMP5(100)\nShotgun(100)","Pasirinkti","Atgal");
}
}
return 1;
}

Burning
10/06/2013, 10:43 AM
I don't know what I'm doing wrong, I did exactly how you said, my response for pickup is
if(pickupid == ammunationguns)
{
ShowPlayerDialog(playerid,DIALOG_AMMU_GUN,DIALOG_S TYLE_LIST,"Parduotuvë","Deagle(100)\nColt(100)\nMP5(100)\nShotgun(100)","Pasirinkti","Atgal");
}
But dialog doesn't shows...What the...? Ok,fixed thanks for your help :)