Weed system problem
#1

When I try to /harvest, it just keeps saying that I'm not in range of the point.

PHP код:
new Weed
new bool:canCropWeed[MAX_PLAYERS] = false
PHP код:
timer weed[30000](playerid)
{
   
canCropWeed[playerid] = true;
}
CMD:plant(playeridparams[])
{
    if(
PlayerInfo[playerid][pSeeds] > 2)
    {
        new 
Float:x,Float:y,Float:z;
        
GetPlayerPos(playerid,x,y,z);
        
SendClientMessage(playerid,GRAY,"Your plant will be ready in an hour.");
        
Weed CreateObject(19473,x,y,z-2,0,0,0);
        
PlayerInfo[playerid][pSeeds]-=3;
        
defer weed(playerid);
    }
    else
    
SendClientMessage(playerid,GRAY,"You don't have enough seeds!");
    return 
1;
}
CMD:harvest(playeridparams[])
{
    if(
canCropWeed[playerid])
    {
        new 
Float:x,Float:y,Float:z;
        
GetPlayerObjectPos(playerid,Weed,x,y,z);
        if(
IsPlayerInRangeOfPoint(playerid,1,x,y,z))
        {
               
SendClientMessage(playerid,GRAY,"You've harvested 9 grams of Marijuana.");
            
PlayerInfo[playerid][pMarijuana]+=9;
            
DestroyObject(Weed);
        }
        else
        
SendClientMessage(playerid,GRAY,"You're not in range of your plant!");
    }
    else
    
SendClientMessage(playerid,GRAY,"This isn't ready to harvest!");
    return 
1;

Reply


Messages In This Thread
Weed system problem - by Noles2197 - 21.01.2013, 20:01
Re: Weed system problem - by azzerking - 21.01.2013, 20:13
Re: Weed system problem - by Noles2197 - 21.01.2013, 20:35
Re: Weed system problem - by arakuta - 21.01.2013, 22:00
Re: Weed system problem - by Noles2197 - 21.01.2013, 22:23

Forum Jump:


Users browsing this thread: 2 Guest(s)