SetTimerEx problem
#1

Hello,

I've been trying to set a timer to set my weedspot1[playerid] variable to 0 but it doesn't work

Code Removed, Problem Fixed!
Reply
#2

change stock to public and use a forward:
pawn Код:
forward EndWeedSpot1Time(playerid);
public EndWeedSpot1Time(playerid)
{
     weedspot1[playerid] = 0;
     SendClientMessage(playerid, COLOR_LAWNGREEN, "[TEMP MESSAGE] Timer for weed ENDED!");
}
Reply
#3

It worked!, i have a question though, is their anyway i can make the weespot1 variable to global and when suppose one person plants weed it sets the weedspot1 variable to 1 for all of the people on the person so no one else can grow weed until the timer is over.
Reply
#4

just remove the playerid and then ctrl+f weedspot1[MAX_PLAYERS], remove the "[MAX_PLAYERS]" and then when you are using the weespot1 variable simply just use weespot1 = 1; or weespot1 = 0; and/or
pawn Код:
if(weespot1 == 1) SendClientMessage(playerid, red, "The weed is still growing, you cannot grow weed atm);
Reply
#5

Quote:
Originally Posted by kamzaf
Посмотреть сообщение
just remove the playerid and then ctrl+f weedspot1[MAX_PLAYERS], remove the "[MAX_PLAYERS]" and then when you are using the weespot1 variable simply just use weespot1 = 1; or weespot1 = 0; and/or
pawn Код:
if(weespot1 == 1) SendClientMessage(playerid, red, "The weed is still growing, you cannot grow weed atm);
Hahah, tried this same thing before, was getting an error


Anways, it worked perfectly, +repped man.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)