AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to make firstround = freeday? (https://forums.alliedmods.net/showthread.php?t=135435)

PWA 08-16-2010 07:09

How to make firstround = freeday?
 
Hello every one, i wanted to ask, how to make firstround like freeday/ but others round is my code!

Here is my code,

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <colorchat>

// Define the Plugin Version
new const VERSION[] = "1.5";

// PREFIX
new const PREFIX[] = "[IDenty]";

const 
CountSeconds 60;
const 
CountSeconds2 20;
const 
CountSeconds3 15;
new 
g_iCountTime;

public 
plugin_init()
{
    
register_plugin("Identy Days"VERSION"1PWA");
    
register_logevent("LEV_RoundEnd"2"1=Round_End")
    
register_logevent("RoundStart"2"1=Round_Start")
}

public 
RoundStart(id)
{    
    
ColorChat0GREEN"^x03%s ^x04 Uzgaidiet mazliet, Dienu tulit izvelesies! "PREFIX)
    
set_task(10.0"nextday")
}

public 
LEV_RoundEnd()
{
    
remove_task()
}

public 
Count() 
{        
    
set_hudmessage255 , -1.0 0.28 1.1 1.1 0.01 0.01 );  
    
show_hudmessage"Ieslodzitajiem ir: %d sekundes - palikusas" g_iCountTime-- );


public 
nextday(id)
{
    switch(
random_num(113))
    {
        case 
1:
        {
            
ZombieDay(id)
        }
        case 
2:
        {
            
ColorChat0GREEN"^x03%s ^x04 Custom day! Klausies ko saka! "PREFIX)
        }
        case 
3:
        {
            
SpartanDay(id)
        }
        case 
4:
        {
            
ColorChat0GREEN"^x03%s ^x04 Brivdiena!"PREFIX)
        }
        case 
5:
        {
            
ColorChat0GREEN"^x03%s ^x04 Bura diena! VISI UZ BURI! "PREFIX)
        }
        case 
6:
        {
            
ColorChat0GREEN"^x03%s ^x04 Mix day! Klausies ko saka! "PREFIX)
        }
        case 
7:
        {
            
ColorChat0GREEN"^x03%s ^x04 Simon day! Klausies ko saka! "PREFIX)
        }
        case 
8:
        {
            
ColorChat0GREEN"^x03%s ^x04 Custom day! Klausies ko saka! "PREFIX)
        }
        case 
9:
        {
            
SuddenDay(id)
        }
        case 
10:
        {
            
CthnsDay(id)
        }
        case 
11:
        {
            
WarDay(id)
        }
        case 
12:
        {
            
ColorChat0GREEN"^x03%s ^x04 Stop n Go day! Klausies ko saka! "PREFIX)
        }
        case 
13:
        {
            
HideDay(id)
        }
    }
        
    return 
PLUGIN_HANDLED;
}

And 
lower here is day scriptwith all optionswhat i dont want to show

I just want to know, how to do that. Example
All peoples join server, and the first round always be Freeday, but second will the script choise, like Hide day or smtg like that! ;)

fireattack 08-16-2010 13:55

Re: How to make firstround = freeday?
 
Try this.

PHP Code:

 
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
 
new freeday[33]
 
public 
plugin_init() 
{
 
set_task(3.0"firstround");
}
 
public 
firstround(id)
{
 if(
freeday[id] > 0)
  return 
FMRES_IGNORED;
 
 if(
is_user_alive(id) || is_user_connected(id))
 {
  
//do something
  
freeday[id] = 1
 
}
 return 
PLUGIN_CONTINUE



Mxnn 08-16-2010 14:31

Re: How to make firstround = freeday?
 
PHP Code:

#include <amxmodx>

new first_round

public plugin_init() {
    
    
register_plugin("Free Day""1.0""Mxnn")
    
register_event("ResetHUD""RoundStart""be")
}

public 
RoundStart() {
    
    if (!
first_round) {
        
first_round 1
        
//Free day
    
}
        
    return 
PLUGIN_CONTINUE



drekes 08-16-2010 14:52

Re: How to make firstround = freeday?
 
I don't think ResetHud is good to detect the first round.
I'd use this:
PHP Code:

register_event("Event_RoundStart"2"1=RoundStart); 


Javivi 08-16-2010 15:25

Re: How to make firstround = freeday?
 
PHP Code:

register_logevent("round_first"2"0=World triggered""1&Restart_Round_")
register_logevent("round_first"2"0=World triggered""1=Game_Commencing")


public 
round_first()
{
// BLABLABLA
//



RedRobster 08-16-2010 17:38

Re: How to make firstround = freeday?
 
Javivi, if I'm not mistaken, those can happen in the middle of a map as long as there is only one person, and another person joins.

Hunter-Digital 08-16-2010 23:56

Re: How to make firstround = freeday?
 
Quote:

Originally Posted by drekes (Post 1272743)
I don't think ResetHud is good to detect the first round.
I'd use this:
PHP Code:

register_event("Event_RoundStart"2"1=RoundStart); 


That's register_logevent(), it's also "Round_Start" instead of "RoundStart" and you forgot a " at the end.

register_logevent("event_roundStart", 2, "1=Round_Start")

drekes 08-17-2010 00:11

Re: How to make firstround = freeday?
 
Quote:

Originally Posted by Hunter-Digital (Post 1273070)
That's register_logevent(), it's also "Round_Start" instead of "RoundStart" and you forgot a " at the end.

register_logevent("event_roundStart", 2, "1=Round_Start")

I was tired, i've would have seen it when i compiled :wink:

Javivi 08-17-2010 06:02

Re: How to make firstround = freeday?
 
Quote:

Originally Posted by RedRobster (Post 1272854)
Javivi, if I'm not mistaken, those can happen in the middle of a map as long as there is only one person, and another person joins.

Obviously... and if you do sv_restart 1 too.

But think about it... it would be the first round :crab:

PWA 08-17-2010 07:31

Re: How to make firstround = freeday?
 
dont work, anyone of these scripts.. >.<


All times are GMT -4. The time now is 22:00.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.