Raised This Month: $ Target: $400
 0% 

Starting Screen


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
razieljohn619
Senior Member
Join Date: May 2011
Location: Philippines
Old 06-24-2011 , 22:43   Starting Screen
Reply With Quote #1

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

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
__________________


Last edited by razieljohn619; 06-26-2011 at 19:36.
razieljohn619 is offline
Send a message via Yahoo to razieljohn619
razieljohn619
Senior Member
Join Date: May 2011
Location: Philippines
Old 06-26-2011 , 19:37   Re: Starting Screen
Reply With Quote #2

sorry for double posting, but please anyone help me with this
__________________

razieljohn619 is offline
Send a message via Yahoo to razieljohn619
FoxueR
Senior Member
Join Date: Jun 2011
Old 06-26-2011 , 19:48   Re: Starting Screen
Reply With Quote #3

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.
__________________
¯\_(ツ)_/¯
FoxueR is offline
razieljohn619
Senior Member
Join Date: May 2011
Location: Philippines
Old 06-26-2011 , 22:41   Re: Starting Screen
Reply With Quote #4

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..
__________________

razieljohn619 is offline
Send a message via Yahoo to razieljohn619
FoxueR
Senior Member
Join Date: Jun 2011
Old 06-27-2011 , 11:18   Re: Starting Screen
Reply With Quote #5

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.
__________________
¯\_(ツ)_/¯
FoxueR is offline
razieljohn619
Senior Member
Join Date: May 2011
Location: Philippines
Old 06-27-2011 , 19:21   Re: Starting Screen
Reply With Quote #6

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"
__________________

razieljohn619 is offline
Send a message via Yahoo to razieljohn619
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-27-2011 , 22:27   Re: Starting Screen
Reply With Quote #7

Quote:
Originally Posted by razieljohn619 View Post
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.
__________________
fysiks is online now
razieljohn619
Senior Member
Join Date: May 2011
Location: Philippines
Old 06-27-2011 , 22:35   Re: Starting Screen
Reply With Quote #8

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

razieljohn619 is offline
Send a message via Yahoo to razieljohn619
FoxueR
Senior Member
Join Date: Jun 2011
Old 06-27-2011 , 22:49   Re: Starting Screen
Reply With Quote #9

I already explained the problems, or at least the most obvious ones.
__________________
¯\_(ツ)_/¯
FoxueR is offline
razieljohn619
Senior Member
Join Date: May 2011
Location: Philippines
Old 06-27-2011 , 23:41   Re: Starting Screen
Reply With Quote #10

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??
__________________

razieljohn619 is offline
Send a message via Yahoo to razieljohn619
Reply



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

Forum Jump


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


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