SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 17/01/2014, 07:31 PM   #1
ZBits
Gangsta
 
Join Date: Dec 2011
Posts: 516
Reputation: 18
Default SetTimerEx problem

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!

Last edited by ZBits; 27/06/2015 at 09:36 AM.
ZBits is offline   Reply With Quote
Old 17/01/2014, 07:48 PM   #2
kamzaf
Huge Clucker
 
Join Date: Aug 2010
Location: Canada
Posts: 247
Reputation: 20
Default Re: SetTimerEx problem

change stock to public and use a forward:
pawn Code:
forward EndWeedSpot1Time(playerid);
public EndWeedSpot1Time(playerid)
{
     weedspot1[playerid] = 0;
     SendClientMessage(playerid, COLOR_LAWNGREEN, "[TEMP MESSAGE] Timer for weed ENDED!");
}
kamzaf is offline   Reply With Quote
Old 17/01/2014, 07:56 PM   #3
ZBits
Gangsta
 
Join Date: Dec 2011
Posts: 516
Reputation: 18
Default Re: SetTimerEx problem

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.
ZBits is offline   Reply With Quote
Old 17/01/2014, 07:59 PM   #4
kamzaf
Huge Clucker
 
Join Date: Aug 2010
Location: Canada
Posts: 247
Reputation: 20
Default Re: SetTimerEx problem

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 Code:
if(weespot1 == 1) SendClientMessage(playerid, red, "The weed is still growing, you cannot grow weed atm);
kamzaf is offline   Reply With Quote
Old 17/01/2014, 08:01 PM   #5
ZBits
Gangsta
 
Join Date: Dec 2011
Posts: 516
Reputation: 18
Default Re: SetTimerEx problem

Quote:
Originally Posted by kamzaf View Post
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 Code:
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.
ZBits is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SetTimerEx problem Bartando Scripting Help 2 25/09/2011 05:59 PM
Problem in SetTimerEx motherfucker Help Archive 7 20/07/2011 09:02 PM
Problem with SetTimerEx Arrows73 Help Archive 5 14/08/2010 09:36 AM
SetTimerEx Problem yeswecanchange09 Help Archive 3 14/06/2010 08:53 PM
SetTimerEx problem. Freddy19 Help Archive 2 08/02/2010 01:16 PM


All times are GMT. The time now is 06:11 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.