PDA

View Full Version : Gwm Fix (repost)


talha14
01-11-2013, 01:16
Any Fix For THis , This is the script for gwm i just want someone to change this to console command like(amx_gwm) and when i activate it in any map it should make the lights of the map dim (Happy YamiKaitou and wickedd)

#include <amxmodx>
#include <cstrike>
#include <fun>
#include <engine>

#define BIG_HUD

#if defined BIG_HUD
#include <dhudmessage>
#endif

new g_max_clients
new CsTeams:g_iActivatorTeam
new bool:g_bGhostRunning = false

#define ADMIN ADMIN_BAN
#define SILVER ADMIN_LEVEL_G
#define GOLDEN ADMIN_LEVEL_H

// DO NOT EDIT THIS
#define FINAL (ADMIN|SILVER|GOLDEN)
#define IsValidPlayer(%1) (1 <= %1 <= g_max_clients)

enum
{
PIANO = 0,
KILL,
oooo
}

#define oooo_TASKID 142715290178236512652357833

new g_szGhostSounds[][] = {
"piano",
"ghost_kill",
"ooo0ooo"
}

new const gsz_MODELNAME[] = "dpt_ghost2"

new Float:g_fWooOooODuration

public plugin_precache()
{
new szFilePath[100]
formatex(szFilePath, charsmax(szFilePath), "models/player/%s/%s.mdl", gsz_MODELNAME, gsz_MODELNAME)
precache_model(szFilePath)

for(new i; i < sizeof(g_szGhostSounds); i++)
{
formatex(szFilePath, charsmax(szFilePath), "ghost/%s.wav", g_szGhostSounds[i])
precache_sound(szFilePath)
}
}

public plugin_init()
{
register_plugin( "Ghost WaLKING MOD", "0.0.5", "Freestyle/pokemonmaster" );
register_concmd("amx_ghostwalker", "gwm", FINAL, "*- Activates ghostwalking mode")
register_event("HLTV", "NewRound", "a", "1=0", "2=0")
register_event("DeathMsg", "eDeath", "a")

g_max_clients = get_maxplayers()
}


public plugin_cfg()
{
new szFilePath[101]
formatex(szFilePath, 100, "sound/ghost/%s.wav", g_szGhostSounds[oooo])
g_fWooOooODuration = GetWavDuration(szFilePath)
}

//public event_round_end()
public NewRound()
{
if(g_bGhostRunning)
{
for(new i = 1; i <= g_max_clients; i++)
{
if(is_user_connected(i))
if(cs_get_user_team(i) == g_iActivatorTeam)
{
cs_reset_user_model(i)
set_user_noclip(i, 0)

if(task_exists(oooo_TASKID + i))
remove_task(oooo_TASKID + i)
}
}

g_bGhostRunning = false
client_cmd(0, "stopsound")
set_lights("#OFF")
}
}

public client_putinserver(id)
{
if(g_bGhostRunning)
{
set_lights("d")
set_task(g_fWooOooODuration, "Ghost_Woo", oooo_TASKID + id, .flags="b")
}
}

public client_disconnect(id)
if(g_bGhostRunning)
if(task_exists(oooo_TASKID + id))
remove_task(oooo_TASKID + id)

public eDeath()
{
new iKiller = read_data(1)

if(IsValidPlayer(iKiller) && cs_get_user_team(iKiller) == g_iActivatorTeam)
client_cmd(0, "spk ^"ghost/%s^"", g_szGhostSounds[KILL])
}

public gwm(id, level)
{
new iFlags = get_user_flags(id)
#if defined BIG_HUD
set_dhudmessage( 0, 160, 0, -1.0, 0.25, 2, 6.0, 3.0, 0.1, 1.5 );
#else
set_hudmessage( 0, 160, 0, -1.0, 0.25, 2, 6.0, 3.0, 0.1, 1.5 );
#endif

if(!(iFlags & level))
{
#if defined BIG_HUD
show_dhudmessage(id , "You don't have acess to this command.");
#else
show_hudmessage(id , "You don't have acess to this command.");
#endif
return PLUGIN_HANDLED
}

g_iActivatorTeam = cs_get_user_team(id)

if( g_iActivatorTeam == CS_TEAM_SPECTATOR || g_iActivatorTeam == CS_TEAM_UNASSIGNED )
{
#if defined BIG_HUD
show_dhudmessage(id , "You must join to a Team.");
#else
show_hudmessage(id , "You must join to a Team.");
#endif
return PLUGIN_HANDLED
}

ghost_features()

new szName[32]
get_user_name(id, szName, charsmax(szName))

#if defined BIG_HUD
show_dhudmessage(0, "%s %s activated Ghost Walking Mode^nAll the %s team will be Ghosts", ( iFlags & ADMIN ? "Admin" : ( iFlags & SILVER ? "Silver Player" : "Golden Player" ) ), szName, ( g_iActivatorTeam == CS_TEAM_T ? "Terrorist" : "Counter-Terrorist" ) )
#else
show_hudmessage(0, "%s %s activated Ghost Walking Mode^nAll the %s team will be Ghosts", ( iFlags & ADMIN ? "Admin" : ( iFlags & SILVER ? "Silver Player" : "Golden Player" ) ), szName, ( g_iActivatorTeam == CS_TEAM_T ? "Terrorist" : "Counter-Terrorist" ) )
#endif

client_cmd(0, "spk ^"ghost/%s^"", g_szGhostSounds[PIANO])

set_lights("d")

g_bGhostRunning = true

return PLUGIN_HANDLED
}

ghost_features()
{
for(new i = 1; i < g_max_clients + 1; i++)
{
if(is_user_alive(i))
{
if(cs_get_user_team( i ) == g_iActivatorTeam)
{
strip_user_weapons(i)
give_item(i,"weapon_usp")
give_item(i,"weapon_knife")
cs_set_user_bpammo(i, CSW_USP, 250)

set_user_noclip(i, 1)
cs_set_user_model(i, gsz_MODELNAME)
}

else cs_set_user_money(i, 16000, 1)
}

if(is_user_connected(i))
Ghost_Woo(oooo_TASKID + i)
}
}

public Ghost_Woo(taskid)
{
new id = taskid - oooo_TASKID
client_cmd(id, "spk ^"ghost/%s^"", g_szGhostSounds[oooo])

if(!task_exists(taskid))
set_task(g_fWooOooODuration, "Ghost_Woo", taskid, .flags="b")
}

// By Arkshine (The eyed one )
stock Float:GetWavDuration( const WavFile[] )
{
new Frequence [ 4 ];
new Bitrate [ 2 ];
new DataLength[ 4 ];
new File;

// --| Open the file.
File = fopen( WavFile, "rb" );

// --| Get the frequence from offset 24. ( Read 4 bytes )
fseek( File, 24, SEEK_SET );
fread_blocks( File, Frequence, 4, BLOCK_INT );

// --| Get the bitrate from offset 34. ( read 2 bytes )
fseek( File, 34, SEEK_SET );
fread_blocks( File, Bitrate, 2, BLOCK_BYTE );

// --| Search 'data'. If the 'd' not on the offset 40, we search it.
if ( fgetc( File ) != 'd' ) while( fgetc( File ) != 'd' && !feof( File ) ) {}

// --| Get the data length from offset 44. ( after 'data', read 4 bytes )
fseek( File, 3, SEEK_CUR );
fread_blocks( File, DataLength, 4, BLOCK_INT );

// --| Close file.
fclose( File );

// --| Calculate the time. ( Data length / ( frequence * bitrate ) / 8 ).
return float( DataLength[ 0 ] ) / ( float( Frequence[ 0 ] * Bitrate[ 0 ] ) / 8.0 );
}

wickedd
01-11-2013, 02:24
(Happy YamiKaitou and wickedd)

HELL NO! We said, post your code in [PHP] or [CODE] tags. All you had to do was edit your previous post, not start a new thread.

I hope Yami delete this thread.

talha14
01-11-2013, 03:10
Yea i know..