AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [REQUEST] Harlem Shake event (https://forums.alliedmods.net/showthread.php?t=209069)

Unkolix 02-20-2013 17:12

[REQUEST] Harlem Shake event
 
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?

ironskillz1 02-20-2013 18:14

Re: [REQUEST] Harlem Shake event
 
Quote:

Originally Posted by Unkolix (Post 1898536)
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

ozakong 02-21-2013 05:05

Re: [REQUEST] Harlem Shake event
 
Quote:

Originally Posted by ironskillz1 (Post 1898562)
I can do it tomorrow

Do it withe Dhud, Something like:
.:: Harlem Shack Event ::.

ironskillz1 02-21-2013 06:15

Re: [REQUEST] Harlem Shake event
 
1 Attachment(s)
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

YamiKaitou 02-21-2013 06:22

Re: [REQUEST] Harlem Shake event
 
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.

EDUTz 02-21-2013 22:34

Re: [REQUEST] Harlem Shake event
 
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();
}


xelent 02-22-2013 16:32

Re: [REQUEST] Harlem Shake event
 
Quote:

Originally Posted by EDUTz (Post 1899314)
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

EDUTz 02-22-2013 16:41

Re: [REQUEST] Harlem Shake event
 
forgot to include:

#include <xs>
#include <fakemeta>

ironskillz1 02-22-2013 17:41

Re: [REQUEST] Harlem Shake event
 
Quote:

Originally Posted by EDUTz (Post 1899803)
forgot to include:

#include <xs>
#include <fakemeta>

Nope only #include <fakemeta_util>
I think

EDUTz 02-22-2013 18:08

Re: [REQUEST] Harlem Shake event
 
yes, that's correct.


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

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