case 1:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
case 1:
{
SetPlayerFightingStyle(playerid, 4);
}
case 2:
{
SetPlayerFightingStyle(playerid, 5);
}
case 3:
{
SetPlayerFightingStyle(playerid, 6);
}
case 4:
{
SetPlayerFightingStyle(playerid, 7);
}
case 5:
{
SetPlayerFightingStyle(playerid, 15);
}
case 6:
SetPlayerFightingStyle(playerid, 26);
}
}
}
return 1;
}
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Fighting Style", "1. Normal\r\n2. Boxing\r\n3. Kung Fu\r\n4. Knee Head\r\n5. Grab Kick\r\n5. Elbow","Accept", "Cancel");
return 1;
switch(listitem)
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
switch(listitem)
{
case 1:
{
SetPlayerFightingStyle(playerid, 4);
}
case 2:
{
SetPlayerFightingStyle(playerid, 5);
}
case 3:
{
SetPlayerFightingStyle(playerid, 6);
}
case 4:
{
SetPlayerFightingStyle(playerid, 7);
}
case 5:
{
SetPlayerFightingStyle(playerid, 15);
}
case 6:
{ // <-- missing bracket
SetPlayerFightingStyle(playerid, 26);
}
}
}
return 1;
}
Thanks for the assistance, Although the return says Loose indentation an even though i backspace and tab my life out it still says it.
Awkward moment when you realise your a retard, |
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case 1: // dialog id 1
{
switch(listitem)
{
case 1: SetPlayerFightingStyle(playerid, 4); //1st option
case 2: SetPlayerFightingStyle(playerid, 5); //2nd
case 3: SetPlayerFightingStyle(playerid, 6);// so on
case 4: SetPlayerFightingStyle(playerid, 7);
case 5: SetPlayerFightingStyle(playerid, 15);
case 6: SetPlayerFightingStyle(playerid, 26);
}
}
case 2: //dialog id 2
{
//code
}
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response)
{
switch(listitem)
{
case 0:SetPlayerFightingStyle(playerid, 4);
case 1:SetPlayerFightingStyle(playerid, 5);
case 2:SetPlayerFightingStyle(playerid, 6);
case 3:SetPlayerFightingStyle(playerid, 7);
case 4:SetPlayerFightingStyle(playerid, 15);
case 5:SetPlayerFightingStyle(playerid, 26);
}
}
}
return 1;
}