View Single Post
Author Message
talha14
Member
Join Date: Aug 2012
Location: London
Old 01-11-2013 , 01:16   Gwm Fix (repost)
Reply With Quote #1

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)

PHP Code:
#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(szFilePathcharsmax(szFilePath), "models/player/%s/%s.mdl"gsz_MODELNAMEgsz_MODELNAME)
precache_model(szFilePath)

for(new 
isizeof(g_szGhostSounds); i++)
{
formatex(szFilePathcharsmax(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(szFilePath100"sound/ghost/%s.wav"g_szGhostSounds[oooo])
g_fWooOooODuration GetWavDuration(szFilePath)
}

//public event_round_end()
public NewRound() 

if(
g_bGhostRunning

for(new 
1<= g_max_clientsi++) 

if(
is_user_connected(i))
if(
cs_get_user_team(i) == g_iActivatorTeam)
{
cs_reset_user_model(i)
set_user_noclip(i0)

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(idlevel)

new 
iFlags get_user_flags(id
#if defined BIG_HUD 
set_dhudmessage01600, -1.00.2526.03.00.11.5 ); 
#else 
set_hudmessage01600, -1.00.2526.03.00.11.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(idszNamecharsmax(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 
1g_max_clients 1i++) 

if(
is_user_alive(i)) 
{
if(
cs_get_user_team) == g_iActivatorTeam

strip_user_weapons(i
give_item(i,"weapon_usp"
give_item(i,"weapon_knife"
cs_set_user_bpammo(iCSW_USP250

set_user_noclip(i1
cs_set_user_model(igsz_MODELNAME)


else 
cs_set_user_money(i160001)


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 ];
new 
Bitrate ];
new 
DataLength];
new 
File;

// --| Open the file.
File fopenWavFile"rb" );

// --| Get the frequence from offset 24. ( Read 4 bytes )
fseekFile24SEEK_SET );
fread_blocksFileFrequence4BLOCK_INT );

// --| Get the bitrate from offset 34. ( read 2 bytes )
fseekFile34SEEK_SET ); 
fread_blocksFileBitrate2BLOCK_BYTE );

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

// --| Get the data length from offset 44. ( after 'data', read 4 bytes )
fseekFile3SEEK_CUR ); 
fread_blocksFileDataLength4BLOCK_INT );

// --| Close file.
fcloseFile );

// --| Calculate the time. ( Data length / ( frequence * bitrate ) / 8 ).
return floatDataLength] ) / ( floatFrequence] * Bitrate] ) / 8.0 );

__________________

Allied Modders <3
talha14 is offline