16.02.2013, 11:16
Hello,im trying to create a drug system. The point of it is it creates a global object after player /plant it.And the command /harvest should destroy it and give drugs.But it doesn't destroy it,nor give drugs. Here's the command:
pawn Code:
CMD:harvest(playerid,params[])
{
new Float:x,Float:y,Float:z;
GetObjectPos(3409,x,y,z);
if(IsPlayerInRangeOfPoint(playerid,5,x,y,z))
{
new rand = random(5);
DestroyObject(3409);
PlayerInfo[playerid][Marijuana]=PlayerInfo[playerid][Marijuana] + rand;
SaveStats(playerid);
}
return 1;
}