[FilterScript] Interactive Trashcans
#5

When a player enters an area you loop through to find which area it is when found the iterator value references the index of the trashcan found. Save that value in a variable for instance CurrTrashArea[playerid] = i; then when a key press is made use

pawn Код:
if(IsPlayerInDynamicArea(playerid, TrashCans_InteractionField[CurrTrashArea[playerid]])) { }
No need for any looping now and if you really want to top it off do this.

pawn Код:
if(CurrTrashArea[playerid] > -1)
{
    if(IsPlayerInDynamicArea(playerid, TrashCans_InteractionField[CurrTrashArea[playerid]])) { }
    else CurrTrashArea[playerid] = -1;
}
That way it won't do any extra code if there is consecutive key presses and they are not in the area the area is to -1 so they would have to actually enter the area to have it set again.
Reply


Messages In This Thread
Interactive Trashcans - by Manyula - 16.12.2014, 22:56
Re: Interactive Trashcans - by OG Killo - 16.12.2014, 23:07
Re: Interactive Trashcans - by Pottus - 16.12.2014, 23:36
Re: Interactive Trashcans - by Manyula - 17.12.2014, 00:38
Re: Interactive Trashcans - by Pottus - 17.12.2014, 01:34
Re : Interactive Trashcans - by med01 - 17.12.2014, 03:57
AW: Interactive Trashcans - by Flori - 17.12.2014, 05:36
Re: Interactive Trashcans - by Manyula - 17.12.2014, 10:58
Re: Interactive Trashcans - by iKyle - 19.12.2014, 02:36

Forum Jump:


Users browsing this thread: 1 Guest(s)