Dialog
#1

PHP код:
#include <a_samp>
#include <zcmd>
COMMAND:buyitems(playerid,params[])
{
    if 
GetPlayerScore(playerid) >= 0*then
    
{
    
ShowPlayerDialog(playerid3DIALOG_STYLE_LIST,"Buyable items","Parrot = 20000$","Buy","Cancel");
    }
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 3)
    {
    if (!
response)
    {
    if(
listitem == 0)
    {
    
SetPlayerAttachedObject(playerid,2,19078,1,0.320722,-0.067912,-0.165151,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000);
    
SendClientMessage(playerid0x00FF00FF,"You have bought a parrot!");
    
GivePlayerMoney(playerid,-20000);
    }
    }
    }
    return 
0;

i made that but when i press Parrot i dont get parrot or message or - money....please help
Reply
#2

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 3)
    {
        if(response)//here was the problem
        {
            if(listitem == 0)
            {
                SetPlayerAttachedObject(playerid,2,19078,1,0.320722,-0.067912,-0.165151,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000);
                SendClientMessage(playerid, 0x00FF00FF,"You have bought a parrot!");
                GivePlayerMoney(playerid,-20000);
            }
        }
    }
    return 0;
}
Reply
#3

still dont work
Reply
#4

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 3)
    {
        if(response)//here was the problem
        {
            if(listitem == 0)
            {
                SetPlayerAttachedObject(playerid,2,19078,1,0.320722,-0.067912,-0.165151,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000);
                SendClientMessage(playerid, 0x00FF00FF,"You have bought a parrot!");
                GivePlayerMoney(playerid,-20000);
                return 1;
            }
        }
    }
    return 0;
}
Reply
#5

nah still not
Reply
#6

try return 1; at the end
Reply
#7

try this
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 3)
    {
        if(!response) return 0;
        switch(listitem)
        {
            case 0:
            {
                SetPlayerAttachedObject(playerid,2,19078,1,0.320722,-0.067912,-0.165151,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000);
                SendClientMessage(playerid, 0x00FF00FF,"You have bought a parrot!");
                GivePlayerMoney(playerid,-20000);
            }
        }
    }
    return 0;
}

COMMAND:buyitems(playerid,params[])
{
    if GetPlayerScore(playerid) >= 0)
    {
        ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST,"Buyable items","Parrot = 20000$","Buy","Cancel");
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)