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

[REQUEST] Harlem Shake event


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Unkolix
Veteran Member
Join Date: Sep 2012
Old 02-20-2013 , 17:12   [REQUEST] Harlem Shake event
Reply With Quote #1

Could someone create a plugin that would play Harlem Shake music and on the part where everyone is doing anything they think, everybody would get slapped with 0 damage until music stops?

Last edited by Unkolix; 02-20-2013 at 17:13.
Unkolix is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 02-20-2013 , 18:14   Re: [REQUEST] Harlem Shake event
Reply With Quote #2

Quote:
Originally Posted by Unkolix View Post
Could someone create a plugin that would play Harlem Shake music and on the part where everyone is doing anything they think, everybody would get slapped with 0 damage until music stops?
I can do it tomorrow
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
ozakong
Junior Member
Join Date: Oct 2010
Old 02-21-2013 , 05:05   Re: [REQUEST] Harlem Shake event
Reply With Quote #3

Quote:
Originally Posted by ironskillz1 View Post
I can do it tomorrow
Do it withe Dhud, Something like:
.:: Harlem Shack Event ::.
ozakong is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 02-21-2013 , 06:15   Re: [REQUEST] Harlem Shake event
Reply With Quote #4

Updated! 2.0
Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <dhudmessage>
#define PLUGIN "HarlemShake"
#define VERSION "2.0"
#define AUTHOR "ironskillz1"

public plugin_init() {
 register_plugin(PLUGIN, VERSION, AUTHOR)
 
 register_clcmd( "say /shake", "Shake" ) // Command!
 register_clcmd( "say /harlemshake", "Shake" ) // Command!
} 
public plugin_precache()
{
 precache_generic("sound/harlemshake.mp3") // sound
}
public Shake(id) 
{
 if(!(get_user_flags(id) & ADMIN_CFG)) // is user admin?
 {
  client_print(id, print_chat, "Only ADMINS can use this command!") // if not print this 
 }
 set_task(0.1,"Music"); // start music
 set_task(0.1,"Dhud"); // Dhud message
 set_task(17.0,"Slap"); // start slaping 
 set_task(30.0,"Remove"); // remove slaping
}
public Music() 
{
 client_cmd(0, "mp3 play ^"sound/harlemshake.mp3^"") // play music
}
public Dhud() 
{
 set_dhudmessage(0, 30, 50, 0.01, 0.15, 0, 1.0, 1.0, 0.1, 0.2)
 show_dhudmessage ( 0, ".:: Harlem Shake Event ::.") // print permanent dhud message in left top corner
 set_task(0.1,"Dhud");
}
public Slap() // SLAP !!
{
 new iTotal, all[32]
 get_players( all, iTotal, "a")
 
 for ( new i = 0; i < iTotal; i++ ) 
 {  
         new id = all[i]
         user_slap( id, 0 )
 }
 
 set_task(0.5,"Slap"); // SLAP TIME
}
public Remove() // remove slap!
{
 remove_task();
}
Here is the song
put it in cstrike/sound/harlemshake.mp3
Attached Files
File Type: zip harlemshake.zip (452.6 KB, 228 views)
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.

Last edited by ironskillz1; 02-21-2013 at 06:33.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 02-21-2013 , 06:22   Re: [REQUEST] Harlem Shake event
Reply With Quote #5

Only 1 task is needed in Remove since you are not passing an id, it will remove ALL tasks that were not given an id (ie, all of your tasks)
Use get_players with the flag 'a', no need to filter by team.
No need to create variable id, you only use it once so use the array directly.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
EDUTz
Senior Member
Join Date: Jun 2010
Location: Dracula's Homeland
Old 02-21-2013 , 22:34   Re: [REQUEST] Harlem Shake event
Reply With Quote #6

please, make the slap sound stop, it ruins everything ) recreate the slap part without the sound

edit: here it is without the slaping sound part, optimized for exact starting and stoping according to the music,

Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <dhudmessage>
#define PLUGIN "HarlemShake"
#define VERSION "2.0"
#define AUTHOR "ironskillz1&edutz"

public plugin_init() {
 register_plugin(PLUGIN, VERSION, AUTHOR)
 
 register_clcmd( "say /shake", "Shake" ) // Command!
 register_clcmd( "say /harlemshake", "Shake" ) // Command!
} 
public plugin_precache()
{
 precache_generic("sound/harlemshake.mp3") // sound
}
public Shake(id) 
{
 if(!(get_user_flags(id) & ADMIN_CFG)) // is user admin?
 {
  client_print(id, print_chat, "Only ADMINS can use this command!") // if not print this 
 }
else
{
 set_task(0.1,"Music"); // start music
 set_task(0.1,"Dhud"); // Dhud message
 set_task(15.5,"Slap"); // start slaping 
 set_task(28.0,"Remove"); // remove slaping
}
}
public Music() 
{
 client_cmd(0, "mp3 play ^"sound/harlemshake.mp3^"") // play music
}
public Dhud() 
{
 set_dhudmessage(0, 30, 50, 0.01, 0.15, 0, 1.0, 1.0, 0.1, 0.2)
 show_dhudmessage ( 0, ".:: Harlem Shake Event ::.") // print permanent dhud message in left top corner
 set_task(0.1,"Dhud");
}
public Slap() // SLAP !!
{
 new iTotal, all[32]
 get_players( all, iTotal, "a")
 
 for ( new i = 0; i < iTotal; i++ ) 
 {  
         new id = all[i]
         slap_new(id)
 }
 
 set_task(0.5,"Slap"); // SLAP TIME
}

public slap_new(id) 
{ 

	if(!is_user_alive(id)) 
	return

	new Float:velocity[3] 
	pev(id, pev_velocity, velocity) 

	new Float:angles[3], Float:v_forward[3] 
	pev(id, pev_angles, angles) 

	angle_vector(angles, ANGLEVECTOR_FORWARD, v_forward) 

	xs_vec_mul_scalar(v_forward, 220.0, v_forward) 
	xs_vec_add(velocity, v_forward, velocity) 
	velocity[2] += 20.0 

	set_pev(id, pev_velocity, velocity) 

	new Float:punchangle[3] 
	punchangle[0] = random_float(-20.0, 20.0) 
	punchangle[1] = random_float(-20.0, 20.0) 
	set_pev(id, pev_punchangle, punchangle)             
} 
public Remove() // remove slap!
{
 remove_task();
}

Last edited by EDUTz; 02-22-2013 at 01:30. Reason: forgot an else statement
EDUTz is offline
xelent
Member
Join Date: Mar 2008
Location: Norway
Old 02-22-2013 , 16:32   Re: [REQUEST] Harlem Shake event
Reply With Quote #7

Quote:
Originally Posted by EDUTz View Post
please, make the slap sound stop, it ruins everything ) recreate the slap part without the sound

edit: here it is without the slaping sound part, optimized for exact starting and stoping according to the music,

Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <dhudmessage>
#define PLUGIN "HarlemShake"
#define VERSION "2.0"
#define AUTHOR "ironskillz1&edutz"

public plugin_init() {
 register_plugin(PLUGIN, VERSION, AUTHOR)
 
 register_clcmd( "say /shake", "Shake" ) // Command!
 register_clcmd( "say /harlemshake", "Shake" ) // Command!
} 
public plugin_precache()
{
 precache_generic("sound/harlemshake.mp3") // sound
}
public Shake(id) 
{
 if(!(get_user_flags(id) & ADMIN_CFG)) // is user admin?
 {
  client_print(id, print_chat, "Only ADMINS can use this command!") // if not print this 
 }
else
{
 set_task(0.1,"Music"); // start music
 set_task(0.1,"Dhud"); // Dhud message
 set_task(15.5,"Slap"); // start slaping 
 set_task(28.0,"Remove"); // remove slaping
}
}
public Music() 
{
 client_cmd(0, "mp3 play ^"sound/harlemshake.mp3^"") // play music
}
public Dhud() 
{
 set_dhudmessage(0, 30, 50, 0.01, 0.15, 0, 1.0, 1.0, 0.1, 0.2)
 show_dhudmessage ( 0, ".:: Harlem Shake Event ::.") // print permanent dhud message in left top corner
 set_task(0.1,"Dhud");
}
public Slap() // SLAP !!
{
 new iTotal, all[32]
 get_players( all, iTotal, "a")
 
 for ( new i = 0; i < iTotal; i++ ) 
 {  
         new id = all[i]
         slap_new(id)
 }
 
 set_task(0.5,"Slap"); // SLAP TIME
}

public slap_new(id) 
{ 

	if(!is_user_alive(id)) 
	return

	new Float:velocity[3] 
	pev(id, pev_velocity, velocity) 

	new Float:angles[3], Float:v_forward[3] 
	pev(id, pev_angles, angles) 

	angle_vector(angles, ANGLEVECTOR_FORWARD, v_forward) 

	xs_vec_mul_scalar(v_forward, 220.0, v_forward) 
	xs_vec_add(velocity, v_forward, velocity) 
	velocity[2] += 20.0 

	set_pev(id, pev_velocity, velocity) 

	new Float:punchangle[3] 
	punchangle[0] = random_float(-20.0, 20.0) 
	punchangle[1] = random_float(-20.0, 20.0) 
	set_pev(id, pev_punchangle, punchangle)             
} 
public Remove() // remove slap!
{
 remove_task();
}
Tried to compile this yourself? I get shit tons of errors, line 64 and 25
xelent is offline
Send a message via Skype™ to xelent
EDUTz
Senior Member
Join Date: Jun 2010
Location: Dracula's Homeland
Old 02-22-2013 , 16:41   Re: [REQUEST] Harlem Shake event
Reply With Quote #8

forgot to include:

#include <xs>
#include <fakemeta>
EDUTz is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 02-22-2013 , 17:41   Re: [REQUEST] Harlem Shake event
Reply With Quote #9

Quote:
Originally Posted by EDUTz View Post
forgot to include:

#include <xs>
#include <fakemeta>
Nope only #include <fakemeta_util>
I think
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
EDUTz
Senior Member
Join Date: Jun 2010
Location: Dracula's Homeland
Old 02-22-2013 , 18:08   Re: [REQUEST] Harlem Shake event
Reply With Quote #10

yes, that's correct.
EDUTz is offline
Reply


Thread Tools
Display Modes

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 19:14.


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