| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- Dialog:PhoneMenu(playerid, response, listitem, inputtext[])
- {
- if (response)
- {
- switch (listitem)
- {
- case 0:
- {
- Dialog_Show(playerid, PhoneCall, DIALOG_STYLE_INPUT, "{6688FF}Call Number", "Please specify the number you would like to call:", "Call", "Cancel");
- }
- case 1:
- {
- Dialog_Show(playerid, PhoneSMS, DIALOG_STYLE_INPUT, "{6688FF}SMS Number", "Please specify the number you would like to SMS:", "Call", "Cancel");
- }
- case 2:
- {
- ListContacts(playerid);
- }
- case 3:
- {
- SendErrorMessage(playerid, "This feature is still being developed.");
- }
- case 4:
- {
- CheckBank(playerid,playerid);
- }
- case 5:
- {
- Dialog_Show(playerid, PhoneSettings, DIALOG_STYLE_LIST, "{6688FF}Phone Settings", "Power %s\nSound Off", "Select", "Cancel", (Players[playerid][pPhoneOff]) ? ("Off") : ("On"));
- }
- }
- }
- return 1;
- }
- Dialog:PhoneSettings(playerid, response, listitem, inputtext[])
- {
- if (response)
- {
- switch (listitem)
- {
- case 0:
- {
- if (Players[playerid][pPhoneOff] == 0)
- Players[playerid][pPhoneOff] = 1;
- else
- Players[playerid][pPhoneOff] = 0;
- }
- }
- }
- return 1;
- }
- Dialog:PhoneSMS(playerid, response, listitem, inputtext[])
- {
- new number;
- if (response)
- {
- if (sscanf(inputtext, "i", number))
- {
- return Dialog_Show(playerid, PhoneSMS, DIALOG_STYLE_INPUT, "{6688FF}SMS Number", "Please specify the number you would like to SMS:", "Call", "Cancel");
- }
- else if (Players[playerid][pPhone] == number)
- {
- return Dialog_Show(playerid, PhoneSMS, DIALOG_STYLE_INPUT, "{6688FF}SMS Number", "You can't text your own number.\n\nPlease specify the number you would like to SMS:", "Call", "Cancel");
- }
- else if (number < 1)
- {
- return Dialog_Show(playerid, PhoneSMS, DIALOG_STYLE_INPUT, "{6688FF}SMS Number", "Please specify the number you would like to SMS:", "Call", "Cancel");
- }
- else
- {
- new strHead[64];
- format(strHead, sizeof(strHead), "{6688FF}SMS to %i", number);
- Players[playerid][pPhoneSMS] = number;
- Dialog_Show(playerid, PhoneSMStext, DIALOG_STYLE_INPUT, strHead, "Please type your message:", "Send", "Cancel");
- }
- }
- return 1;
- }
- Dialog:PhoneSMStext(playerid, response, listitem, inputtext[])
- {
- new text[512];
- new number = Players[playerid][pPhoneSMS];
- new strHead[64];
- if (response)
- {
- format(strHead, sizeof(strHead), "{6688FF}SMS to %i", number);
- if (sscanf(inputtext, "s[512]", text))
- {
- Dialog_Show(playerid, PhoneSMStext, DIALOG_STYLE_INPUT, strHead, "Please type your message:", "Send", "Cancel");
- }
- else
- {
- SendTextMessage(playerid, number, text);
- }
- }
- return 1;
- }
- Dialog:PhoneCall(playerid, response, listitem, inputtext[])
- {
- if (response)
- {
- new number;
- if (sscanf(inputtext, "i", number))
- {
- return Dialog_Show(playerid, PhoneCall, DIALOG_STYLE_INPUT, "{6688FF}Call Number", "Please specify the number you would like to call:", "Call", "Cancel");
- }
- else if (Players[playerid][pCalling] > 0)
- {
- return Dialog_Show(playerid, PhoneCall, DIALOG_STYLE_INPUT, "{6688FF}Call Number", "You are already on a call. Use {6688FF}/hangup{FFFFFF} to end it.\n\nPlease specify the number you would like to call:", "Call", "Cancel");
- }
- else if (Players[playerid][pPhone] == number)
- {
- return Dialog_Show(playerid, PhoneCall, DIALOG_STYLE_INPUT, "{6688FF}Call Number", "You can't dial your own number.\n\nPlease specify the number you would like to call:", "Call", "Cancel");
- }
- else if (number < 1)
- {
- return Dialog_Show(playerid, PhoneCall, DIALOG_STYLE_INPUT, "{6688FF}Call Number", "You have entered an invalid phone number.\n\nPlease specify the number you would like to call:", "Call", "Cancel");
- }
- else
- {
- CallNumber(playerid, number);
- }
- }
- return 1;
- }
- Dialog:PhoneCallPP(playerid, response, listitem, inputtext[])
- {
- if (response)
- {
- new number, payphone = GetClosestPayphone(playerid);
- if (sscanf(inputtext, "i", number))
- {
- return Dialog_Show(playerid, PhoneCall, DIALOG_STYLE_INPUT, "{6688FF}Call Number", "Please specify the number you would like to call:", "Call", "Cancel");
- }
- else if (Players[playerid][pCalling] > 0)
- {
- return Dialog_Show(playerid, PhoneCall, DIALOG_STYLE_INPUT, "{6688FF}Call Number", "You are already on a call. Use {6688FF}/hangup{FFFFFF} to end it.\n\nPlease specify the number you would like to call:", "Call", "Cancel");
- }
- else if (Players[playerid][pPhone] == number)
- {
- return Dialog_Show(playerid, PhoneCall, DIALOG_STYLE_INPUT, "{6688FF}Call Number", "You can't dial your own number.\n\nPlease specify the number you would like to call:", "Call", "Cancel");
- }
- else if (number < 1)
- {
- return Dialog_Show(playerid, PhoneCall, DIALOG_STYLE_INPUT, "{6688FF}Call Number", "You have entered an invalid phone number.\n\nPlease specify the number you would like to call:", "Call", "Cancel");
- }
- else if (IsValidPayphoneID(payphone) && number == Payphones[payphone][phNumber])
- {
- return Dialog_Show(playerid, PhoneCall, DIALOG_STYLE_INPUT, "{6688FF}Call Number", "You can't call this number as it belongs to this payphone.\n\nPlease specify the number you would like to call:", "Call", "Cancel");
- }
- else if (IsValidPayphoneID(payphone) && (Payphones[payphone][phOccupied] || Payphones[payphone][phCaller] != INVALID_PLAYER_ID))
- {
- return Dialog_Show(playerid, PhoneCall, DIALOG_STYLE_INPUT, "{6688FF}Call Number", "This payphone is already in use.\n\nPlease specify the number you would like to call:", "Call", "Cancel");
- }
- else
- {
- CallNumber(playerid, number, payphone);
- }
- }
- return 1;
- }
|