SetTimerEx problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SetTimerEx problem (
/showthread.php?tid=488368)
SetTimerEx problem -
ZBits - 17.01.2014
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!
Re: SetTimerEx problem -
kamzaf - 17.01.2014
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!");
}
Re: SetTimerEx problem -
ZBits - 17.01.2014
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.
Re: SetTimerEx problem -
kamzaf - 17.01.2014
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);
Re: SetTimerEx problem -
ZBits - 17.01.2014
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.