19.01.2013, 17:02
I want to make it to where when you /plant the weed somewhere, you will be able to /pick an hour later and it will destroy the plant, giving you 9 grams of marijuana..
I think I have to make some sort of timer, but I'm not sure, so can someone help me out?
PHP код:
PlayerInfo[playerid][pMarijuana]+=9;
PHP код:
CMD:plant(playerid, params[])
{
if(PlayerInfo[playerid][pSeeds] > 2)
{
new Name[MAX_PLAYER_NAME],string[128],Float:x,Float:y,Float:z;
GetPlayerName(playerid,Name, sizeof(Name));
format(string, 128, "* %s plants seeds into his(her) plant pot.", Name);
SendClientMessageToAll(COL_WHITE,string); // to nearby players
GetPlayerPos(playerid,x,y,z);
CreateObject(19473,x,y,z-2,0,0,0);
PlayerInfo[playerid][pSeeds]-=3;
}
else
SendClientMessage(playerid,COL_WHITE,"You don't have enough seeds!");
return 1;
}