Dialog Help.
#6

Replace you phone cmd with this
PHP код:
CMD:phone(playeridparams[])
{
    if (!
Inventory_HasItem(playerid"Cellphone"))
        return 
SendErrorMessage(playerid"You don't have a cellphone on you.");
    if (
PlayerData[playerid][pHospital] != -|| PlayerData[playerid][pCuffed] || PlayerData[playerid][pInjured] || !IsPlayerSpawned(playerid))
        return 
SendErrorMessage(playerid"You can't use this command now.");
    static
        
str[32];
    
format(strsizeof(str), "Phone (#%d)"PlayerData[playerid][pPhone]);
    if (
PlayerData[playerid][pPhoneOff]) {
        
Dialog_Show(playeridMyPhoneDIALOG_STYLE_LISTstr"Dial Number\nMy Contacts\nSend Text Message\nMusic\nTurn On Phone""Select""Cancel");
    }
    else {
        
Dialog_Show(playeridMyPhoneDIALOG_STYLE_LISTstr"Dial Number\nMy Contacts\nSend Text Message\nMusic\nTurn Off Phone""Select""Cancel");
    }
    return 
1;

Replace your Dialog:MyPhone with this
PHP код:
Dialog:MyPhone(playeridresponselistiteminputtext[])
{
    if (
response)
    {
        switch (
listitem)
        {
            case 
0:
            {
                if (
PlayerData[playerid][pPhoneOff])
                    return 
SendErrorMessage(playerid"Your phone must be powered on.");
                
Dialog_Show(playeridDialNumberDIALOG_STYLE_INPUT"Dial Number""Please enter the number that you wish to dial below:""Dial""Back");
            }
            case 
1:
            {
                if (
PlayerData[playerid][pPhoneOff])
                    return 
SendErrorMessage(playerid"Your phone must be powered on.");
                
ShowContacts(playerid);
            }
            case 
2:
            {
                if (
PlayerData[playerid][pPhoneOff])
                    return 
SendErrorMessage(playerid"Your phone must be powered on.");
                
Dialog_Show(playeridSendTextDIALOG_STYLE_INPUT"Send Text Message""Please enter the number that you wish to send a text message to:""Dial""Back");
            }
            case 
3: {
                
ShowPlayerDialog(playerid2016DIALOG_STYLE_INPUT"{D6E1EB}*******""{FFFFFF}Insert the video/music title""Accept""Cancel");
            }
            case 
4:
            {
                if (!
PlayerData[playerid][pPhoneOff])
                {
                       if (
PlayerData[playerid][pCallLine] != INVALID_PLAYER_ID) {
                        
CancelCall(playerid);
                    }
                    
PlayerData[playerid][pPhoneOff] = 1;
                    
SendNearbyMessage(playerid30.0COLOR_PURPLE"** %s has powered off their cellphone."ReturnName(playerid0));
                }
                else
                {
                    
PlayerData[playerid][pPhoneOff] = 0;
                    
SendNearbyMessage(playerid30.0COLOR_PURPLE"** %s has powered on their cellphone."ReturnName(playerid0));
                }
            }
        }
    }
    return 
1;

Add this to OnDialogResponse
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[]) {
    if(
dialogid == 2016) {
        if (!
response) return SendClientMessage(playerid0xD6E1EBFF"Dialog music canceled.");
         if(
strlen(inputtext)) {
            new 
ola[255];
            
format(olasizeof(ola), "https://6t.pe/?song=%s"inputtext);
            
PlayAudioStreamForPlayer(playeridola);
        }
    }
    return 
0;

I haven't tested this but this should work.
Reply


Messages In This Thread
[Assisted] Dialog Help. - by alexkeward - 22.08.2016, 10:56
Re: Dialog Help. - by DarkSkull - 22.08.2016, 11:01
Re: Dialog Help. - by alexkeward - 22.08.2016, 11:03
Re: Dialog Help. - by DarkSkull - 22.08.2016, 11:06
Re: Dialog Help. - by alexkeward - 22.08.2016, 11:08
Re: Dialog Help. - by DarkSkull - 22.08.2016, 11:12
Re: Dialog Help. - by alexkeward - 22.08.2016, 11:20
Re: Dialog Help. - by DarkSkull - 22.08.2016, 11:23
Re: Dialog Help. - by alexkeward - 22.08.2016, 11:24

Forum Jump:


Users browsing this thread: 5 Guest(s)