12.01.2016, 23:52
Heey guys! Working on a cow raise script and sell by the pound at the 24/7.
Hum I got a problem with feeding it now. Note : I am ready to offer 5$ to anyone who helps me with it.
I want the command to check the player cow lbs, and add 5 to it.
Here is the Buycow command I made :
Heres the command that checks your cows
I don't know what kind of syntax to use i'm sooo confused.
Any help is highly appreciated and of course if you need more code I'll be more than happy to paste it.
Hum I got a problem with feeding it now. Note : I am ready to offer 5$ to anyone who helps me with it.
I want the command to check the player cow lbs, and add 5 to it.
Код:
if(PlayerInfo[playerid][pCow][i]) format(string, sizeof(string), "%d) %d lbs.", i+1, PlayerInfo[playerid][pCow][i]);
Код:
CMD:buycow(playerid, params[]) { new string[128], done, cow; if(!IsPlayerLoggedIn(playerid) || PlayerInfo[playerid][pAsshole] == 1) return SendClientMessage(playerid, COLOR_GREY, "You are not allowed to use command."); if(!IsAtAnimalCenter(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not at the Animal Center."); if(CowTime[playerid]) { format(string, sizeof(string), "You need to wait %d more seconds before buying a new cow.", CowTime[playerid]); SendClientMessage(playerid, COLOR_GREY, string); return 1; } for(new i=0; i<2; i++) // Cows { if(!done) { if(!PlayerInfo[playerid][pCow][i]) done = i+1; } } if(!done) return SendClientMessage(playerid, COLOR_GREY, "You can't have any more cows."); done = done-1; // Buying different cow sizes if(strval(RPJL(playerid, JOB_FARMER)) == 1) cow = random(10)+5; else if(strval(RPJL(playerid, JOB_FARMER)) == 2) cow = random(20)+15; else if(strval(RPJL(playerid, JOB_FARMER)) == 3) cow = random(40)+20; else if(strval(RPJL(playerid, JOB_FARMER)) == 4) cow = random(60)+25; else if(strval(RPJL(playerid, JOB_FARMER)) == 5) cow = random(80)+40; PlayerInfo[playerid][pCow][done] = cow; format(string, sizeof(string), "* %s Buys a new born cow at the Animal Center.", RPN(playerid)); SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE); format(string, sizeof(string), " Your new born cow is a %d lbs cow.", cow); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); // Leveling new oldj = strval(RPJL(playerid, JOB_FARMER)); PlayerInfo[playerid][pJobSkill][JOB_FARMER] ++; new newj = strval(RPJL(playerid, JOB_FARMER)); if(oldj < newj) { format(string, sizeof(string), "** Your Farmer level is now %d, you can now buy heavier cows. **", newj); SendClientMessage(playerid, COLOR_YELLOW, string); } CowBought[playerid] ++; if(CowBought[playerid] >= 5) { format(string, sizeof(string), " Remember to feed your cow to make it grow ! ", cow); format(string, sizeof(string), " For more info on cows use /Cowhelp ", cow); CowBought[playerid] = 0; CowTime[playerid] = 5; SetTimerEx("CowBuyTime", 1000, true, "i", playerid); } return 1; }
Код:
CMD:cows(playerid, params[]) { new string[128]; SendClientMessage(playerid, COLOR_BLUE, "____________________________"); SendClientMessage(playerid, COLOR_WHITE, " *** Your Cows ***"); for(new i=0; i<1; i++) { if(PlayerInfo[playerid][pCow][i]) format(string, sizeof(string), "%d) %d lbs.", i+1, PlayerInfo[playerid][pCow][i]); else format(string, sizeof(string), "%d) None.", i+1); SendClientMessage(playerid, COLOR_WHITE, string); } return 1; }
Any help is highly appreciated and of course if you need more code I'll be more than happy to paste it.