AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   Round Start Plugin (https://forums.alliedmods.net/showthread.php?t=104495)

DoviuX 09-24-2009 10:15

Round Start Plugin
 
3 Attachment(s)
Hi it's my first plugin for cs 1.6.

.:What does it do ?:.

When the round start it rings a bell and writes to every player:
" The Ultimate Battle Has begun! "

I think it will be good on gungame , public , paintball mods .

_____________________________________________ ________

So try it and say is it good for my first plugin or not :/

Sorry for bad english iam lithuanian .

Code:


V1.1 Fixed bugs : precached sound , now it's hud messege added more sounds.
V1.0 Released Plugin.


alan_el_more 09-24-2009 10:29

Re: Round Start Plugin
 
Suggestions:
Add cvars, random sounds and replace the print chat by hud

DoviuX 09-24-2009 10:46

Re: Round Start Plugin
 
Okey i try to make it :)

lucas_7_94 09-24-2009 11:12

Re: Round Start Plugin
 
I think that you should precache sound and add ML in the client_print.

DoviuX 09-24-2009 11:39

Re: Round Start Plugin
 
Quote:

Originally Posted by alan_el_more (Post 942240)
Suggestions:
Add cvars

Cvars for what ? Turn On / Off ?

Quote:

by hud
made that

Quote:

precache sound
I think it's not needed i tested works without pecache .

xbatista 09-24-2009 11:43

Re: Round Start Plugin
 
Quote:

Originally Posted by DoviuX (Post 942275)
I think it's not needed i tested works without pecache .

You must!

DarkGod 09-24-2009 11:44

Re: Round Start Plugin
 
Quote:

For packages, use only zip, [tar.]gz, [tar.]bz2. Plugins using other compression formats should not be approved, this includes RAR and 7z.
:crab:
Quote:

Originally Posted by DoviuX
I think it's not needed i tested works without pecache .

Did someone else, who did not have the sound, play during the time and if so, could he hear the sound?

DoviuX 09-24-2009 11:48

Re: Round Start Plugin
 
k i correct that and put in zip file

Jon 09-24-2009 11:49

Re: Round Start Plugin
 
Precache the sound.

PHP Code:

new const ROUND_SOUND[] = { "RoundStart/Start.wav" 

Use a define.

PHP Code:

public logevent_round_start(id

There is no index passed in this event. Use 0 as index.

PHP Code:

Redundant 


DoviuX 09-24-2009 12:06

Re: Round Start Plugin
 
Fixed Bugs read 1 post !

DarkGod 09-24-2009 12:08

Re: Round Start Plugin
 
Quote:

Originally Posted by DoviuX (Post 942296)
Fixed Bugs read 1 post !

Code:
public logevent_round_start(id) {     client_cmd(id, "spk %s", ROUND_SOUND)

DoviuX 09-24-2009 12:11

Re: Round Start Plugin
 
And whats wrong with that ?

public logevent_round_start(id) {
client_cmd(id, "spk %s", ROUND_SOUND)

Jon 09-24-2009 12:21

Re: Round Start Plugin
 
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.

DoviuX 09-24-2009 12:30

Re: Round Start Plugin
 
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 ...


Exolent[jNr] 09-24-2009 12:32

Re: Round Start Plugin
 
You obviously cannot support this.
Please learn more about writing plugins before submitting another.

Unapproved.

@Jon
You should NOT use #define for strings.

Jon 09-24-2009 12:33

Re: Round Start Plugin
 
Quote:

Originally Posted by Exolent[jNr] (Post 942317)
@Jon
You should NOT use #define for strings.

I heard this was alright as long as you only use the string once.

Exolent[jNr] 09-24-2009 12:42

Re: Round Start Plugin
 
Quote:

Originally Posted by Jon (Post 942319)
I heard this was alright as long as you only use the string once.

1. Precache Sound
2. Play Sound

Alucard^ 09-24-2009 12:43

Re: Round Start Plugin
 
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).

Jon 09-24-2009 12:48

Re: Round Start Plugin
 
Quote:

Originally Posted by Exolent[jNr] (Post 942327)
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?

Exolent[jNr] 09-24-2009 13:10

Re: Round Start Plugin
 
Quote:

Originally Posted by Jon (Post 942334)
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.

Jon 09-24-2009 13:21

Re: Round Start Plugin
 
Okay, thanks.

Rainq 11-04-2023 21:20

Re: Round Start Plugin
 
this plugin read only 1 song


All times are GMT -4. The time now is 14:27.

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