Raised This Month: $ Target: $400
 0% 

[REQUEST] Harlem Shake event


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
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 #1

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 #2

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 #3

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 #4

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 #5

yes, that's correct.
EDUTz 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 05:56.


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