06.06.2009, 15:44
pawn Код:
dcmd_BuySeed(playerid, params[])
{
new SeedType,SeedAmount,SeedString[50];
if(sscanf(params, "dd", SeedType,SeedAmount)) return SendClientMessage(playerid, 0xFF000096, "* Usage: /BuySeed [Seed Number] [SeedAmount]"); SendClientMessage(playerid, 0xFF000096, "* 1- Cucumber 2- Carrot 3- Tomato");
if(SeedType <= 0 || SeedType >= 4) return SendClientMessage(playerid, 0xFF000096,"Choose a valid seed number!");
else if(SeedType == 1)
{
format(SeedString, sizeof(SeedString),"* You have bought %d Cucumber Seeds!",SeedAmount);
SendClientMessage(playerid, 0x00FF0096, SeedString);
SendClientMessage(playerid, 0x00FF0096, "* Remember: To plant it, you will need to have at least 5 of them.");
FarmInfo[playerid][CucumberSeed] += SeedAmount;
}
else if(SeedType == 2)
{
format(SeedString, sizeof(SeedString),"* You have bought %d Carrot Seeds!",SeedAmount);
SendClientMessage(playerid, 0x00FF0096, SeedString);
SendClientMessage(playerid, 0x00FF0096, "* Remember: To plant it, you will need to have at least 5 of them.");
FarmInfo[playerid][CarrotSeed] += SeedAmount;
}
else if(SeedType == 3)
{
format(SeedString, sizeof(SeedString),"* You have bought %d Tomato Seeds!",SeedAmount);
SendClientMessage(playerid, 0x00FF0096, SeedString);
SendClientMessage(playerid, 0x00FF0096, "* Remember: To plant it, you will need to have at least 5 of them.");
FarmInfo[playerid][TomatoSeed] += SeedAmount;
}
return 1;
}