Weed Timer.
#1

Alright so I've got problem with a Weed Timer for picking up Weed somehow and I totally can't figure out why.

Код:
public WeedPickup(playerid)
{
	new string[256];
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	for(new i = 0; i<MAX_PLAYERS; i++)
	{
	    if(PlayerInfo[i][pPlantedWeed] == 0) return SendClientMessage(playerid, COLOR_GREEN, "This plant doesn't have any Weed on it!");
		if(!IsPlayerInRangeOfPoint(playerid, 2.0, PlayerInfo[i][pWeedX], PlayerInfo[i][pWeedY], PlayerInfo[i][pWeedZ])) return SendClientMessage(playerid, COLOR_GREEN, "You're not in range of any Weed plant!");
		if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) return SendClientMessage(playerid, COLOR_GREEN, "You must stay in crouching position to pick weed!");
		format(string, sizeof(string), "* %s begins picking the Weed plant next to him", name);
		ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		PlayerInfo[playerid][pPot] += PlayerInfo[i][pWeedGrams];
		format(string, sizeof(string), " You have picked %d grams of Weed", PlayerInfo[i][pWeedGrams]);
		GameTextForPlayer(playerid, string, 3000, 3);
		DestroyObject(WeedObject[i]);
		PlayerInfo[i][pWeedGrams] = 0;
                PlayerInfo[i][pPlantedWeed] = 0;
		PlayerInfo[i][pWeedTime] = 0;
		PlayerInfo[i][pWeedX] = 0.0;
		PlayerInfo[i][pWeedY] = 0.0;
		PlayerInfo[i][pWeedZ] = 0.0;
		}
    return 1;
}
This timer starts after 5 seconds once you did /pickweed. Problem is whenever there are more than 2 plants you even get the "You have moved from your position" message even after you successfully picked weed. And additionally you can't pick any other plants after you picked one. It will give you the first message "This plant doesn't have any weed.

Any idea?
Reply
#2

If anyone cares, on my testserver testing with 2 people it works.

On the real server with ~80 people it gives the message "You're not in range of a Weed Plant" or some other message somehow.
Reply
#3

Maybe there is another timer or something close to it that is disrupting it, not sure though sorry.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)