SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 15/08/2019, 02:56 AM   #1
PemburuHantu
Big Clucker
 
PemburuHantu's Avatar
 
Join Date: May 2019
Location: Indonesia ( Gorontalo )
Posts: 63
Reputation: 0
Default Timer for event

Hi guys, can u teach me how to make timer for event ?
Like if im start event the event will start in 60 second < in 60 second before event start the player join will freeze, and after 60 second the player will unfreeze and event will set timer again, its 5 minute. After 5 minute timer done, the player have kill a lot will win, and the event will close, all player will spawn again . How to make like that ?
PemburuHantu is offline   Reply With Quote
Old 15/08/2019, 04:28 AM   #2
SiaReyes
Huge Clucker
 
SiaReyes's Avatar
 
Join Date: Mar 2019
Location: Coordinates X,Y,Z
Posts: 256
Reputation: 19
Default Re: Timer for event

This is just an example

pawn Code:
new bool:EventActivate =false, bool:EventStarted= false; // top of your script
#define MAX_EVENT_PLAYERS 3

CMD:startevent(playerid)
{

  if(!EventActivate)
  {
    EventActivate = true;
    SetTimer("StartEvent", 60000, false); // 1 min timer
    SendClientMessage(playerid, -1, "Event Starts in 60 seconds");
  }
  TogglePlayerControllable(playerid, false); //freeze the player
  return 1;
}


forward StartEvent();
public StartEvent()
{
      new count = 0;
      foreach(new i : Player) if(PlayerInEvent[i])
      {
        ++count;
        break;
      }
 
   if(count < MAX_EVENT_PLAYERS) // if event players lesser than 3
   {
     // Remove Players from event
     TogglePlayerControllable(i, true); // unfreeze
   }
   else
   {
           // start the event
           TogglePlayerControllable(i, true); // unfreeze
           EventStarted = true;
   }
   return 1;
}
__________________
Hey guys,
We've just started up our own hosting company and we are offering cheap game hosting. Our SAMP servers start at only $0.50 cents for 32 slots per month, or $1.50 for 64. We have ONE FREE spot left for a first month free subscription for any game host of your choice. We host most many major games such as SAMP, Call of Duty, 7 Days to Die, Minecraft, CounterStrike, ARK: Survival Evolved, and many more!

Cheapest hosting company official site : http://main-hosts.com/

Cheap Hosting Company is looking for an experience staff.

Sign up to our forums and Control Panel and order one of our cheap game servers. First to sign up will receive a free SA:MP server! Join on discord https://discord.gg/J82JgQJ for more information!
SiaReyes is online now   Reply With Quote
Old 16/08/2019, 10:27 PM   #3
PemburuHantu
Big Clucker
 
PemburuHantu's Avatar
 
Join Date: May 2019
Location: Indonesia ( Gorontalo )
Posts: 63
Reputation: 0
Default Re: Timer for event

Ty, and how to make like , count player team kill, if player team kill has reach the target score, the event will auto end. ( will spawn player again in normal mode ). And player team has reach target score will win and got reward.
PemburuHantu is offline   Reply With Quote
Old 17/08/2019, 05:57 AM   #4
StevenLV
Big Clucker
 
StevenLV's Avatar
 
Join Date: Apr 2017
Location: Pakistan
Posts: 77
Reputation: 5
Default Re: Timer for event

You are, i think, making a team deathmatch with timers!? I have seen a tdm gamemode released which can help you and you can learn from there as well! I think that was HKTDM search for smthng like that.
Also for more help Discord msg me: Milton#0939 I will try my best
__________________
Eternal Life Roleplay

Server IP: TBA
Best New RP Server!
StevenLV is offline   Reply With Quote
Old 17/08/2019, 06:04 AM   #5
StevenLV
Big Clucker
 
StevenLV's Avatar
 
Join Date: Apr 2017
Location: Pakistan
Posts: 77
Reputation: 5
Default Re: Timer for event

I think you are looking for this: https://forum.sa-mp.com/showthread.php?t=399875
Hope this helps
__________________
Eternal Life Roleplay

Server IP: TBA
Best New RP Server!
StevenLV is offline   Reply With Quote
Old 17/08/2019, 06:54 AM   #6
SiaReyes
Huge Clucker
 
SiaReyes's Avatar
 
Join Date: Mar 2019
Location: Coordinates X,Y,Z
Posts: 256
Reputation: 19
Default Re: Timer for event

Quote:
Originally Posted by PemburuHantu View Post
Ty, and how to make like , count player team kill, if player team kill has reach the target score, the event will auto end. ( will spawn player again in normal mode ). And player team has reach target score will win and got reward.

Just check out my Pubg TDM Script. In OnPlayerDeath Callback, there is the answer you're asking for.
Click HERE
__________________
Hey guys,
We've just started up our own hosting company and we are offering cheap game hosting. Our SAMP servers start at only $0.50 cents for 32 slots per month, or $1.50 for 64. We have ONE FREE spot left for a first month free subscription for any game host of your choice. We host most many major games such as SAMP, Call of Duty, 7 Days to Die, Minecraft, CounterStrike, ARK: Survival Evolved, and many more!

Cheapest hosting company official site : http://main-hosts.com/

Cheap Hosting Company is looking for an experience staff.

Sign up to our forums and Control Panel and order one of our cheap game servers. First to sign up will receive a free SA:MP server! Join on discord https://discord.gg/J82JgQJ for more information!
SiaReyes is online now   Reply With Quote
Old 18/08/2019, 04:38 AM   #7
PemburuHantu
Big Clucker
 
PemburuHantu's Avatar
 
Join Date: May 2019
Location: Indonesia ( Gorontalo )
Posts: 63
Reputation: 0
Default Re: Timer for event

Ok, thanks all !
PemburuHantu 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
I Need Event System or Event Maker (Filterscript) AngeloBrand98 Scripting Help 2 26/03/2017 11:00 PM
[FilterScript] Rajat's Event system! (Lockable, Event wins, guns) RajatPawar Filterscripts 14 07/03/2015 06:30 PM
[FilterScript] S-Event (Advanced Event System) marcelodell Lançamentos/Releases 54 12/04/2014 03:54 AM
How to make /event start an actual event Snowman12 Help Archive 7 03/04/2011 11:39 PM


All times are GMT. The time now is 11:27 AM.


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