Raised This Month: $51 Target: $400
 12% 

Round Start Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 09-24-2009 , 12:08   Re: Round Start Plugin
Reply With Quote #11

Quote:
Originally Posted by DoviuX View Post
Fixed Bugs read 1 post !
Code:
public logevent_round_start(id) {     client_cmd(id, "spk %s", ROUND_SOUND)
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 09-24-2009 , 12:11   Re: Round Start Plugin
Reply With Quote #12

And whats wrong with that ?

public logevent_round_start(id) {
client_cmd(id, "spk %s", ROUND_SOUND)
DoviuX is offline
Send a message via Skype™ to DoviuX
Jon
Veteran Member
Join Date: Dec 2007
Old 09-24-2009 , 12:21   Re: Round Start Plugin
Reply With Quote #13

Test your plugins before releasing/editing them.

Quote:
PHP Code:
public logevent_round_start(id
There is no index passed in this event. Use 0 as index.
You didn't fix that.

PHP Code:
precache_sound("ROUND_SOUND"
Remove "" and precache all sounds.

PHP Code:
new const ROUND_SOUND[] =
{
     
"RoundStart/Start1.wav",
     
"RoundStart/Start2.wav",
     
"RoundStart/Start3.wav"
}

client_cmd(id"spk %s"ROUND_SOUND
Won't work as intended.

Last edited by Jon; 09-24-2009 at 12:23.
Jon is offline
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 09-24-2009 , 12:30   Re: Round Start Plugin
Reply With Quote #14

PHP Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Round Start"
#define AUTHOR "DoviuX"
#define VERSION "1.1"
new const ROUND_SOUND[][]=
{  
  
"RoundStart/Start1.wav",
  
"RoundStart/Start2.wav",
  
"RoundStart/Start3.wav"
}
/*================================================================================
 [Plugin Start]
=================================================================================*/
public plugin_init()
{
 
register_plugin(PLUGINVERSIONAUTHOR)
        
register_logevent("logevent_round_start"2"1=Round_Start")
}
public 
logevent_round_start(id) {
    
client_cmd(id"spk %s"ROUND_SOUND)
    
set_hudmessage(225225225, -1.00.2926.012.0 );
    
show_hudmessage(0"The Ultimate Battle Has Begun !"); 
}
public 
plugin_precache() 
{
  
precache_sound(ROUND_SOUND)

Error:

Code:
 
//AMXXPC compile.exe
// by the AMX Mod X Dev Team
 
//// RoundStart.sma
// D:\Dovydo\Counter - strike Failai\Addonai\L4DPlague\L4DPlague\addons\amxmodx\
scripting\RoundStart.sma(32) : error 048: array dimensions do not match
//
// 1 Error.
// Could not locate output file D:\Dovydo\Counter - strike Failai\Addonai\L4DPla
gue\L4DPlague\addons\amxmodx\scripting\compiled\RoundStart.amx (compile failed).
//
// Compilation Time: 0,09 sec
// ----------------------------------------
Press enter to exit ...

Last edited by DoviuX; 09-24-2009 at 12:33.
DoviuX is offline
Send a message via Skype™ to DoviuX
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-24-2009 , 12:32   Re: Round Start Plugin
Reply With Quote #15

You obviously cannot support this.
Please learn more about writing plugins before submitting another.

Unapproved.

@Jon
You should NOT use #define for strings.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Jon
Veteran Member
Join Date: Dec 2007
Old 09-24-2009 , 12:33   Re: Round Start Plugin
Reply With Quote #16

Quote:
Originally Posted by Exolent[jNr] View Post
@Jon
You should NOT use #define for strings.
I heard this was alright as long as you only use the string once.
Jon is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-24-2009 , 12:42   Re: Round Start Plugin
Reply With Quote #17

Quote:
Originally Posted by Jon View Post
I heard this was alright as long as you only use the string once.
1. Precache Sound
2. Play Sound
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 09-24-2009 , 12:43   Re: Round Start Plugin
Reply With Quote #18

The round start is a global event so you cant use (id)... you have to do a loop of maxplayers for that. Or if i am not wrong... you can play the sound to all players with the emit_sound (that i never used it so i am not sure).
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
Jon
Veteran Member
Join Date: Dec 2007
Old 09-24-2009 , 12:48   Re: Round Start Plugin
Reply With Quote #19

Quote:
Originally Posted by Exolent[jNr] View Post
1. Precache Sound
2. Play Sound
Okay. What if you have a function that is called pretty often which checks a string, but this is the only place that string is checked?
Jon is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-24-2009 , 13:10   Re: Round Start Plugin
Reply With Quote #20

Quote:
Originally Posted by Jon View Post
Okay. What if you have a function that is called pretty often which checks a string, but this is the only place that string is checked?
In plugins by VEN, I have seen him make a static const variable of a string that is used in a situation like that.
I don't know the reasoning behind it, but I'm sure if he did it, it had to be for a good reason.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
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 04:46.


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