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
#2

If I understood you correctly, you want a way to make dynamic dialog lists. If I'm incorrect, feel free to be a bit more elaborate.

http://forum.sa-mp.com/showthread.ph...dynamic+dialog

You wouldn't need to use it, but it would be a lot better than the way I'd go about doing it - creating separate dialogs just for an if/else structure.
Reply
#3

Quote:
Originally Posted by iFriSki
Посмотреть сообщение
If I understood you correctly, you want a way to make dynamic dialog lists. If I'm incorrect, feel free to be a bit more elaborate.

http://forum.sa-mp.com/showthread.ph...dynamic+dialog

You wouldn't need to use it, but it would be a lot better than the way I'd go about doing it - creating separate dialogs just for an if/else structure.
Yes, i'm pretty sure this is what i'm looking for, i'll try it out. Thanks alot.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)