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;
}
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. |