AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Starting Screen (https://forums.alliedmods.net/showthread.php?t=160086)

razieljohn619 06-24-2011 22:43

Starting Screen
 
hey guys i need some help with this.. please..

what this plugin should do is at round start, every one's screen should be black and the blackness has transparency, every player will freeze and there will be a countdown that Match Begins in 3..2..1.. .,and after the countdown has stop., the blackness and freezing of players should stop and the game starts killing :D

PHP Code:

#include <amxmodx>
#include <fun>
#include <csx>
#include <amxmisc>
#include <engine>

#define PLUGIN "Starting Screen"
#define VERSION "1.0"
#define AUTHOR "razieljohn619"

#define NORMAL_VELOCITY        240.0
#define FROZEN_VELOCITY        0.1

#define ID_UNFREEZE ( taskid - TASK_UNFREEZE )
#define IsPlayer(%1)    ( 1 <= %1 <= g_iMaxPlayers )

new const Version[] = "1.0";

const 
iCountTime 1500;

new 
g_iCountdownEntity;
new 
g_iCounter;
new 
g_iMaxPlayersmsgScreenFade
const TASK_UNFREEZE 1589;

new 
g_frozen[33]

public 
plugin_init()
{
    
register_plugin("Starting Screen""1.0" "razieljohn619")
    
register_event("HLTV""freezeplayers""a""1=0""2=0");
    
register_event("HLTV""ShowCountdown""a""1=0""2=0");
    
g_iCountdownEntity create_entity"info_target" );
    
entity_set_stringg_iCountdownEntity EV_SZ_classname "countdown_entity" );
    
    
register_think"countdown_entity" "fw_CountdownEntThink" );
    
msgScreenFade get_user_msgid("ScreenFade")
    
g_iMaxPlayers get_maxplayers()
}

public 
freezeplayers(id)
{
    if(!
is_user_alive(id) || g_frozen[id] || task_exists(id+TASK_UNFREEZE))
        return;
        
    
g_frozen[id] = 1
    
    set_user_maxspeed
(idFROZEN_VELOCITY)
    
    
fadeblack(idamount)
    
set_task(3.0"remove_freeze"id+TASK_UNFREEZE)
}

public 
remove_freeze(taskid)
{
    
g_frozen[ID_UNFREEZE] = 0
    set_user_maxspeed
(ID_UNFREEZENORMAL_VELOCITY)


public 
countdown


stock fadeblack
(idammount)
{    
    if (
ammount 255)
    
ammount 255
    
    message_begin
(MSG_ONE_UNRELIABLEmsgScreenFade, {0,0,0}, id)
    
write_short(ammount 3)    //Durration
    
write_short(0)        //Hold
    
write_short(0)        //Type
    
write_byte(100)    //R
    
write_byte(100)    //G
    
write_byte(100)    //B
    
write_byte(ammount)    //B
    
message_end()
}  

public 
ShowCountdown()
{
    
g_iCounter iCountTime;
    
entity_set_floatg_iCountdownEntity EV_FL_nextthink get_gametime() + 0.01 );
}

public 
fw_CountdownEntThinkiEntity )
{
    if ( 
iEntity == g_iCountdownEntity 
    {
        
set_hudmessage255 255 255 , -1.0 , -1.0 0.1 0.1 );
        
show_hudmessage" Match Begins in %d " , --g_iCounter );
        
        if ( 
g_iCounter )
            
entity_set_floatg_iCountdownEntity EV_FL_nextthink get_gametime() + 0.01 );
        else
            
    }


THANKS :D

razieljohn619 06-26-2011 19:37

Re: Starting Screen
 
sorry for double posting, but please anyone help me with this :|

FoxueR 06-26-2011 19:48

Re: Starting Screen
 
You're asking for too much. I suggest the following:
  • Explain what you've already done.
  • Tell us what isn't working.
  • Narrow down what you need to additions/changes to individual sections of code.

razieljohn619 06-26-2011 22:41

Re: Starting Screen
 
errors:
Code:

startingscreen.sma<50> : error 017: undefined symbol "amount"
startingscreen.sma<96> : error 029: invalid expression, assumed zero
startingscreen.sma<96--101> : warning 215: expression has no effect
startingscreen.sma<105> : error 001: expected token: "}", but found "-end of file"

and also want a sound to be played at gamestart..

..what this plugin should do is at round start, every one's screen should be black and the blackness has transparency, every player will freeze and there will be a countdown that Match Begins in 3..2..1.. .,and after the countdown has stop., the blackness and freezing of players should stop and the game starts..

FoxueR 06-27-2011 11:18

Re: Starting Screen
 
Get it compiling first before worrying about the functionality.
  • You have a random else with nothing inside it.
  • You have the beginning of a function public countdown but no actual code.
There may be more problems, but I just did a quick glance through it.

razieljohn619 06-27-2011 19:21

Re: Starting Screen
 
i did compile it..and these are the errors

Code:

startingscreen.sma<50> : error 017: undefined symbol "amount"
startingscreen.sma<96> : error 029: invalid expression, assumed zero
startingscreen.sma<96--101> : warning 215: expression has no effect
startingscreen.sma<105> : error 001: expected token: "}", but found "-end of file"


fysiks 06-27-2011 22:27

Re: Starting Screen
 
Quote:

Originally Posted by razieljohn619 (Post 1498315)
i did compile it..and these are the errors

Code:

startingscreen.sma<50> : error 017: undefined symbol "amount"
startingscreen.sma<96> : error 029: invalid expression, assumed zero
startingscreen.sma<96--101> : warning 215: expression has no effect
startingscreen.sma<105> : error 001: expected token: "}", but found "-end of file"


If you get errors then it didn't actually compile.

razieljohn619 06-27-2011 22:35

Re: Starting Screen
 
^ what i mean is, when i place the sma to the compiler these errors appeared.. and can you help me

FoxueR 06-27-2011 22:49

Re: Starting Screen
 
I already explained the problems, or at least the most obvious ones.

razieljohn619 06-27-2011 23:41

Re: Starting Screen
 
the public showcountdown is nothing it's my mistake placing it there :) ..

PHP Code:

#include <amxmodx>
#include <fun>
#include <csx>
#include <amxmisc>
#include <engine>

#define PLUGIN "Starting Screen"
#define VERSION "1.0"
#define AUTHOR "razieljohn619"

#define NORMAL_VELOCITY        240.0
#define FROZEN_VELOCITY        0.1

#define ID_UNFREEZE ( taskid - TASK_UNFREEZE )
#define IsPlayer(%1)    ( 1 <= %1 <= g_iMaxPlayers )

new const Version[] = "1.0";

const 
iCountTime 1500;

new 
g_iCountdownEntity;
new 
g_iCounter;
new 
g_iMaxPlayersmsgScreenFade
const TASK_UNFREEZE 1589;

new 
g_frozen[33]

new 
g_iMsgId_ScreenFade;

public 
plugin_init()
{
    
register_plugin("Starting Screen""1.0" "razieljohn619")
    
register_event("HLTV""freezeplayers""a""1=0""2=0");
    
register_event("HLTV""ShowCountdown""a""1=0""2=0");
    
FLcolor register_cvar("amx_rfl_color""020 020 020");
    
g_iCountdownEntity create_entity"info_target" );
    
entity_set_stringg_iCountdownEntity EV_SZ_classname "countdown_entity" );
    
    
register_think"countdown_entity" "fw_CountdownEntThink" );
    
msgScreenFade get_user_msgid("ScreenFade")
    
g_iMaxPlayers get_maxplayers()
}

public 
freezeplayers(id)
{
    if(!
is_user_alive(id) || g_frozen[id] || task_exists(id+TASK_UNFREEZE))
        return;
        
    
g_frozen[id] = 1
    
    set_user_maxspeed
(idFROZEN_VELOCITY)
    
    
fadeblack(idamount)
    
set_task(3.0"remove_freeze"id+TASK_UNFREEZE)
}

public 
remove_freeze(taskid)
{
    
g_frozen[ID_UNFREEZE] = 0
    set_user_maxspeed
(ID_UNFREEZENORMAL_VELOCITY)


stock fadeblack(idammount)
{    
    
get_pcvar_string(FLcolorColorescharsmax(Colores))
    if (
ammount 255)
    
ammount 255
    
    message_begin
MSG_ONE_UNRELIABLEg_iMsgId_ScreenFade_iPlayers] );
    
write_shortiUnits );
    
write_shortiUnits );
    
write_shortFADE_TYPE );
    
write_byteiRed );
    
write_byteiGreen );
    
write_byteiBlue );
    
write_byteiAlpha );
    
message_end( );
}  

public 
ShowCountdown()
{
    
g_iCounter iCountTime;
    
entity_set_floatg_iCountdownEntity EV_FL_nextthink get_gametime() + 0.01 );
}

public 
fw_CountdownEntThinkiEntity )
{
    if ( 
iEntity == g_iCountdownEntity 
    {
        
set_hudmessage255 255 255 , -1.0 , -1.0 0.1 0.1 );
        
show_hudmessage" Match Begins in %d " , --g_iCounter );
        
        if ( 
g_iCounter )
            
entity_set_floatg_iCountdownEntity EV_FL_nextthink get_gametime() + 0.01 );
        else
            
    }


is this right??


All times are GMT -4. The time now is 23:24.

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