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


Messages In This Thread
Weed Timer. - by EthanR - 22.11.2010, 22:22
AW: Weed Timer. - by EthanR - 23.11.2010, 00:18
Re: Weed Timer. - by XoSarahMoX - 23.11.2010, 02:30

Forum Jump:


Users browsing this thread: 2 Guest(s)