New Dialog -
DJRebis - 25.06.2013
Hi, im begginer scripter and i don't know how to add 2nd dialog! Can somebody help me? I did 1st dialog like this:
Cmd
Код:
}
if (strcmp("/gangs", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Gangs", "Grove \nBallas \nLos Aztecas \nVagos", "OK","Cancel");
return 1;
}
And this:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)// They pressed the first button.
{
switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
{
case 1:// Our dialog!
{
switch(listitem)// Checking which listitem was selected
{
case 0:// Grove
{
SetPlayerSkin(playerid,107);
GivePlayerWeapon(playerid,30,9999);
GivePlayerWeapon(playerid,24,9999);
GivePlayerWeapon(playerid,18,9999);
SetPlayerPos(playerid,2477.7805,-1686.5349,13.5078);
}
case 1: // BAllas
{
SetPlayerSkin(playerid,104);
GivePlayerWeapon(playerid,30,9999);
GivePlayerWeapon(playerid,24,9999);
GivePlayerWeapon(playerid,18,9999);
SetPlayerPos(playerid,2649.9617,-2031.5221,13.5540);
}
case 2: // Zilie
{
SetPlayerSkin(playerid,115);
GivePlayerWeapon(playerid,30,9999);
GivePlayerWeapon(playerid,24,9999);
GivePlayerWeapon(playerid,18,9999);
SetPlayerPos(playerid,2143.2739,-1803.2969,16.1475);
}
case 3://Vagos
{
SetPlayerPos(playerid,2770.5347,-1627.9919,12.1775);
SetPlayerSkin(playerid,108);
GivePlayerWeapon(playerid,30,9999);
GivePlayerWeapon(playerid,24,9999);
GivePlayerWeapon(playerid,18,9999);
}
}
}
}
}
return 1;
But now i wana do similar with mafias! cmd i did is right
Код:
if (strcmp("/mafia", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Mafias", "Triads \nRussian Mafia \nItalian Mafia", "OK","Cancel");
return 1;
}
But what to do now in OnDialogResponse?
Re: New Dialog -
Josh_Main - 25.06.2013
pawn Код:
if(dialogid == 2)// They pressed the first button.
{
if(response)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
{
switch(listitem)
{
case 0:// Mafias
{
SetPlayerSkin(playerid,x);
GivePlayerWeapon(playerid,x,9999);
GivePlayerWeapon(playerid,x,9999);
GivePlayerWeapon(playerid,x,9999);
SetPlayerPos(playerid,x,y,z);
}
case 1: // Triads
{
SetPlayerSkin(playerid,x);
GivePlayerWeapon(playerid,x,9999);
GivePlayerWeapon(playerid,x,9999);
GivePlayerWeapon(playerid,x,9999);
SetPlayerPos(playerid,x,y,z);
}
case 2: // Russian Mafia
{
SetPlayerSkin(playerid,x);
GivePlayerWeapon(playerid,x,9999);
GivePlayerWeapon(playerid,x,9999);
GivePlayerWeapon(playerid,x,9999);
SetPlayerPos(playerid,x,y,z);
}
case 3://Italian Mafia
{
SetPlayerPos(playerid,x,y,z);
SetPlayerSkin(playerid,x);
GivePlayerWeapon(playerid,x,9999);
GivePlayerWeapon(playerid,x,9999);
GivePlayerWeapon(playerid,x,9999);
}
}
return 1;
}
}
Change the "x" to the weapon ID's you want for the team. Also change "x,y,z" to the co-ordinates where you want the team to spawn.
Change
pawn Код:
if (strcmp("/mafia", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Mafias", "Triads \nRussian Mafia \nItalian Mafia", "OK","Cancel");
return 1;
}
and replace it with this
pawn Код:
if (strcmp("/mafia", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Mafias", "Triads \nRussian Mafia \nItalian Mafia", "OK","Cancel");
return 1;
}
If you need any more help, send me your Teamviewer ID and pass and I will fix it for you. You can also speak to me in my Teamspeak server on this IP: 63.143.45.104
Re: New Dialog -
DJRebis - 25.06.2013
Is this right?
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)// They pressed the first button.
{
switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
{
case 1:// Our dialog!
{
switch(listitem)// Checking which listitem was selected
{
case 0:// Grove
{
SetPlayerSkin(playerid,107);
GivePlayerWeapon(playerid,30,9999);
GivePlayerWeapon(playerid,24,9999);
GivePlayerWeapon(playerid,18,9999);
SetPlayerPos(playerid,2477.7805,-1686.5349,13.5078);
}
case 1: // BAllas
{
SetPlayerSkin(playerid,104);
GivePlayerWeapon(playerid,30,9999);
GivePlayerWeapon(playerid,24,9999);
GivePlayerWeapon(playerid,18,9999);
SetPlayerPos(playerid,2649.9617,-2031.5221,13.5540);
}
case 2: // Zilie
{
SetPlayerSkin(playerid,115);
GivePlayerWeapon(playerid,30,9999);
GivePlayerWeapon(playerid,24,9999);
GivePlayerWeapon(playerid,18,9999);
SetPlayerPos(playerid,2143.2739,-1803.2969,16.1475);
}
case 3://Vagos
{
SetPlayerPos(playerid,2770.5347,-1627.9919,12.1775);
SetPlayerSkin(playerid,108);
GivePlayerWeapon(playerid,30,9999);
GivePlayerWeapon(playerid,24,9999);
GivePlayerWeapon(playerid,18,9999);
}
}
}
{
if(dialogid == 2)// They pressed the first button.
{
if(response)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
{
switch(listitem)
{
case 0: // Triads
{
SetPlayerPos(playerid,2021.4722,1011.6873,10.8203);
SetPlayerSkin(playerid,120);
GivePlayerWeapon(playerid,27);
GivePlayerWeapon(playerid,29);
GivePlayerWeapon(playerid,31);
SendClientMessage(playerid,COLOR_TOMATO,"Attack Other Mafia!");
}
case 1: // Russian Mafia
{
SetPlayerPos(playerid,1652.7783,-1656.9902,22.5156);
SetPlayerSkin(playerid,113);
GivePlayerWeapon(playerid,27);
GivePlayerWeapon(playerid,29);
GivePlayerWeapon(playerid,31);
SendClientMessage(playerid,COLOR_TOMATO,"Attack Other Mafia!");
}
case 2://Italian Mafia
{
SetPlayerPos(playerid,1533.4248,752.3821,11.0234);
SetPlayerSkin(playerid,126);
GivePlayerWeapon(playerid,27);
GivePlayerWeapon(playerid,29);
GivePlayerWeapon(playerid,31);
SendClientMessage(playerid,COLOR_TOMATO,"Attack Other Mafia!");
}
}
return 1;
}
Re: New Dialog -
dEcooR - 25.06.2013
This is right dude
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)// They pressed the first button.
{
switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
{
case 1:// Our dialog!
{
switch(listitem)// Checking which listitem was selected
{
case 0:// Grove
{
SetPlayerSkin(playerid,107);
GivePlayerWeapon(playerid,30,9999);
GivePlayerWeapon(playerid,24,9999);
GivePlayerWeapon(playerid,18,9999);
SetPlayerPos(playerid,2477.7805,-1686.5349,13.5078);
}
case 1: // BAllas
{
SetPlayerSkin(playerid,104);
GivePlayerWeapon(playerid,30,9999);
GivePlayerWeapon(playerid,24,9999);
GivePlayerWeapon(playerid,18,9999);
SetPlayerPos(playerid,2649.9617,-2031.5221,13.5540);
}
case 2: // Zilie
{
SetPlayerSkin(playerid,115);
GivePlayerWeapon(playerid,30,9999);
GivePlayerWeapon(playerid,24,9999);
GivePlayerWeapon(playerid,18,9999);
SetPlayerPos(playerid,2143.2739,-1803.2969,16.1475);
}
case 3://Vagos
{
SetPlayerPos(playerid,2770.5347,-1627.9919,12.1775);
SetPlayerSkin(playerid,108);
GivePlayerWeapon(playerid,30,9999);
GivePlayerWeapon(playerid,24,9999);
GivePlayerWeapon(playerid,18,9999);
}
}
}
case 2:// Our dialog!
{
switch(listitem)
{
case 0: // Triads
{
SetPlayerPos(playerid,2021.4722,1011.6873,10.8203);
SetPlayerSkin(playerid,120);
GivePlayerWeapon(playerid,27,9999);
GivePlayerWeapon(playerid,29,9999);
GivePlayerWeapon(playerid,31,9999);
SendClientMessage(playerid,COLOR_TOMATO,"Attack Other Mafia!");
}
case 1: // Russian Mafia
{
SetPlayerPos(playerid,1652.7783,-1656.9902,22.5156);
SetPlayerSkin(playerid,113);
GivePlayerWeapon(playerid,27,9999);
GivePlayerWeapon(playerid,29,9999);
GivePlayerWeapon(playerid,31,9999);
SendClientMessage(playerid,COLOR_TOMATO,"Attack Other Mafia!");
}
case 2://Italian Mafia
{
SetPlayerPos(playerid,1533.4248,752.3821,11.0234);
SetPlayerSkin(playerid,126);
GivePlayerWeapon(playerid,27,9999);
GivePlayerWeapon(playerid,29,9999);
GivePlayerWeapon(playerid,31,9999);
SendClientMessage(playerid,COLOR_TOMATO,"Attack Other Mafia!");
}
}
}
}
}
return 1;
}
Re: New Dialog -
DJRebis - 25.06.2013
Thank you! Now works!