Dialog help
#1

This is something i would really like to know, i was wondering how i could create a dialog which displays. If a player have the certain type of seed it allows them to plant it, but if they don't have the certain type of seed they the option to plant it on the dialog doesn't appear.

These are my planting commands which i would like to create into a dialog.

E.G, A player has a corn seed but they don't have a orange seed, only the corn seed option will appear on the dialog.(if i get the dialog to work i will remove the commands.)
pawn Код:
COMMAND:plantcorn(playerid, params[])
{
    if(purchasecornseeds[playerid] == 1 && plantcornseeds[playerid] == 0)
    {
        new pname[24];
        new string[100];
        GetPlayerName(playerid,pname,24);
        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid, x, y, z);
        cornplayerobject[playerid] = CreateObject(862,x, y, z-1, 0.0, 0.0, 96.0);
        format(string, sizeof(string), "Planted Corn\nOwner:\n%s",pname);
        PlantedCorn[playerid] = Create3DTextLabel(string,COLOR_LIGHTBLUE,x,y,z,20.0,0);
        ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.1,1,1,1,1,1,1);
        SetTimerEx("animationclear",3000,false,"d",playerid );
        SendClientMessage(playerid, COLOR_YELLOW,"Seeds planted");
        SendClientMessage(playerid, COLOR_YELLOW,"You corn will be ready in 10 mins");
        corngrowingtimer = SetTimerEx("corntimer",600000,false,"d",playerid );
        plantcornseeds[playerid] = 1;
        purchasecornseeds[playerid] = 0;
        cornseedsareready[playerid] = 0;
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED,"You havn't purchased any seeds or you have already planted your corn.");
    }
    return 1;
}
COMMAND:plantorangetree(playerid, params[])
{
    if(purchaseorangeseeds[playerid] == 1 && plantorangeseeds[playerid] == 0)
    {
        new pname[24];
        new string[100];
        GetPlayerName(playerid,pname,24);
        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid, x, y, z);
        orangeplayerobject[playerid] = CreateObject(615,x, y, z-1, 0.0, 0.0, 96.0);
        format(string, sizeof(string), "Planted Orange Tree\nOwner:\n%s",pname);
        PlantedOrange[playerid] = Create3DTextLabel(string,COLOR_LIGHTBLUE,x,y,z,20.0,0);
        ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.1,1,1,1,1,1,1);
        SetTimerEx("animationclear",3000,false,"d",playerid );
        SendClientMessage(playerid, COLOR_YELLOW,"Seeds planted");
        SendClientMessage(playerid, COLOR_YELLOW,"You Orange Tree will be ready in 20 mins");
        orangegrowingtimer = SetTimerEx("orangetimer",1200000,false,"d",playerid );
        plantorangeseeds[playerid] = 1;
        purchaseorangeseeds[playerid] = 0;
        orangeseedsareready[playerid] = 0;
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED,"You havn't purchased any seeds or you have already planted your Orange Tree.");
    }
    return 1;
}
Hopefully i explained this well enough.
Reply


Messages In This Thread
Dialog help - by Haydz - 16.12.2010, 02:14
Re: Dialog help - by iFriSki - 16.12.2010, 02:23
Re: Dialog help - by Haydz - 16.12.2010, 02:27

Forum Jump:


Users browsing this thread: 2 Guest(s)