/plantweed system problem.. -
I got a problem with the Weed system, as you can see I planted some seeds and in secods it says that I waited to long so they have been removed.. It happens in seconds some times you can do /plantweed and they will be removed in 5 minutes it depends..
Код:
if(strcmp(cmd,"/plantweed",true)==0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pJob] != 4)
{
SendClientMessage(playerid,COLOR_GREY, "You are not a Drug Dealer !");
return 1;
}
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(GetPlayerState(playerid) != 1) return SendClientMessage(playerid, COLOR_GREY, " You must be on foot !");
if(GetPlayerInterior(playerid) > 0) return SendClientMessage(playerid, COLOR_GREY, " You must be outside to plant your seeds.");
if(PlayerInfo[playerid][pSeeds] == 0) return SendClientMessage(playerid, COLOR_GREY, " You don't have any Seeds!");
if(PlayerInfo[playerid][pSeeds] < 10) return SendClientMessage(playerid, COLOR_GREY, " You don't have enough Seeds!");
if(PlayerInfo[playerid][pPlantedWeed] == 1) return SendClientMessage(playerid, COLOR_GRAD2, "* You have already planted a weed !");
new Float:X, Float:Y, Float:Z;
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0,1);
GetPlayerPos(playerid, X, Y, Z);
PlayerInfo[playerid][pWeedX] = X;
PlayerInfo[playerid][pWeedY] = Y;
PlayerInfo[playerid][pWeedZ] = Z;
WeedObject[playerid] = CreateObject(3409, X, Y, Z-1.8, 0, 0, 0);
PlayerInfo[playerid][pPlantedWeed] = 1;
PlayerInfo[playerid][pSeeds] -= 10;
format(string, sizeof(string), "* %s plants some seeds.", name);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_GREEN, "You have planted your seeds! Every minute, your plant will make one gram of weed.");
SendClientMessage(playerid, COLOR_GREEN, "If your plant won't picked within 70 minutes, it will rot and you will lose it.");
SendClientMessage(playerid, COLOR_GREEN, "Also remember that anyone can /pickweed if they find your plant, so be careful.");
SetTimer("RotWeed", 420000, 1); // 70 min
}
return 1;
}
Re: /plantweed system problem.. -
So it only occurs once I'm not too sure but it definitively has something to do with the settimer