CMD:plantseed(playerid,params[])
{
if(pinfo[playerid][seeds] < 5) return SendClientMessage(playerid,-1,"[SERVER] You haven't enought seeds");
if(IsPlayerInVehicle(playerid,GetPlayerVehicleID(playerid))) return SendClientMessage(playerid,-1,"[SERVER] You can't do it in a vehicle");
if(limite == MAX_WEED_PER_PLAYER) return SendClientMessage(playerid,-1,"[SERVER] You can't plant more of 3 seeds");
new id = plantcount;
GetPlayerPos(playerid,winfo[id][poswx],winfo[id][poswy],winfo[id][poswz]);
mariaobject[id] = CreateDynamicObject(3409,winfo[id][poswx],winfo[id][poswy],winfo[id][poswz]-1,0.0,0.0,0.0,-1,-1,-1,100.0,0.0);
ApplyAnimation(playerid,LIBRARY,ANIMATION,4.1,false,false,false,false,3000,false);
winfo[id][labelweed] = CreateDynamic3DTextLabel("On Harvest",0xFF0000FF,winfo[id][poswx],winfo[id][poswy],winfo[id][poswz],100.0);
pinfo[playerid][seeds] = pinfo[playerid][seeds] - 5;
plantcount++;
limit++;
SetTimer("harvesttimer",30000,false);
return 1;
}
forward harvesttimer();
public harvesttimer()
{
for(new i = 0; i < MAX_WEED; i++)
{
winfo[i][finita] = 1;
UpdateDynamic3DTextLabelText(winfo[i][labelweed],0xFF0000FF,"Harvest");
}
return 1;
}
Because the timer is of 30 seconds (30000ms). So, after 10 seconds, this still will be processing.
If you want to continue as that, I recommend to retype the command just after 30 seconds. Otherwise, if many people will use the command on your server, I'd suggest you to use this function: https://sampwiki.blast.hk/wiki/SetTimerEx |