Dialog 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: Dialog problem (
/showthread.php?tid=401143)
Dialog problem -
Strier - 21.12.2012
Umm, well i made an special command for choosing weapons and its supposed to be a list for example
Option 1
Option 2
but it shows together Option 1/nOption2
Here the code.
Код:
if (strcmp("/Ws", cmdtext, true, 10) == 0)
{
#define DIALOG_SLOTWEAPONS 1
ShowPlayerDialog(playerid, DIALOG_SLOTWEAPONS, DIALOG_STYLE_LIST, "Slot Weapons", "Running weapons: /n WalkingWeapons:", "Select", "Close");
return 1;
}
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
{
if(dialogid == DIALOG_SLOTWEAPONS)
{
if(response)
{
if(listitem == 0)
{
GivePlayerWeapon (playerid, 22, 9999);
GivePlayerWeapon (playerid, 26, 9999);
GivePlayerWeapon (playerid, 32, 9999);
}
if(listitem == 1)
{
GivePlayerWeapon (playerid, 24, 9999);
GivePlayerWeapon (playerid, 27, 9999);
GivePlayerWeapon (playerid, 31, 9999);
}
}
}
The same problem but now its switching teams.
Код:
if (strcmp("/St", cmdtext, true, 10) == 0)
#define DIALOG_TEAM 0
ShowPlayerDialog(playerid, DIALOG_TEAM, DIALOG_STYLE_LIST,"Team Selection", "Team Hobo/nTeam Grandma", "Select", "Close");
return 1;
}
return 0; // Line 287
}
Код:
if(dialogid == DIALOG_TEAM)
{
if(response)
{
if(listitem == 0)
{
SendClientMessage(playerid, 0x3A47DEFF, "You're now on the team Hobo");
gTeam[playerid] = TEAM_HOBO;
SetPlayerSkin(playerid, 231);
GivePlayerWeapon (playerid, 24, 500);
GivePlayerWeapon (playerid, 27, 500);
GivePlayerWeapon (playerid, 31, 500);
SetPlayerPos(playerid, -408.1354, 1014.3384, 11.0209);
}
if(listitem == 1)
{
SendClientMessage(playerid, 0x3A47DEFF, "You're now on the team Grandma");
gTeam[playerid] = TEAM_GRANDMA;
SetPlayerSkin(playerid, 53);
GivePlayerWeapon (playerid, 24, 500);
GivePlayerWeapon (playerid, 27, 500);
GivePlayerWeapon (playerid, 31, 500);
SetPlayerPos(playerid,-547.8126, 1094.2133, 11.0250 );
}
}
}
Whole code gives me this warning
Код:
C:\Users\Guille\Desktop\Server\gamemodes\ASD.pwn(287) : warning 225: unreachable code
Thanks for helping me in advanced.
Re: Dialog problem -
RedCrossER - 21.12.2012
Ahh check with \n
Re: Dialog problem -
B-Matt - 21.12.2012
"Red\nBlue\nGreen"
Backslash is for new line, not slash.
Re: Dialog problem -
Strier - 21.12.2012
Replaced /n with \n still didn't work
Re: Dialog problem -
Strier - 21.12.2012
Yea, it's fixed, thank you.