27.11.2011, 10:59
ok i made the dialog:
How i can now send a message to PD if select Police and FD if select FD?
Quote:
public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext, "/911", true)) { ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "911 Emergency what service you need?", "Police\nFire Dept", "Call", "Cancel"); return 1; } return 0; } |
Quote:
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:// The first item listed { if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, 0xFFFFFF, "[INFO]Type your message and the location."); GivePlayerMoney(playerid, -0); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK); } case 1: // The second item listed { if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, 0xFFFFFF, "[INFO]Type your message and the location."); GivePlayerMoney(playerid, 02); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER); } } } } } return 1; |