Little Help
Hello,
Sorry For Requesting Help Multiple Times Today, Anyways, I was adding a plugin made by pokemonmaster, Which is Ghost Walking Mode. This One.
The Plugin was made for Admins, Golden Players, Silver Players. So I Decided To Add Diamond and Bronze Players into the code, but since I Don't know that much in Coding AMXX Plugins, I had Two Errors Which are : - (209 -- 210) : error 001: expected token ")", but found ";"
- (209 -- 210) : error 001: expected token ",", but found ";"
Here is The Code Originally Made By Pokemonmaster:
PHP Code:
#include <amxmodx> #include <cstrike> #include <fun> #include <engine>
/* ------------------- EDIT STUFF ------------------ */ // If you want a big HUD message, just remove the // before #define //#define BIG_HUD
// if you want to completely remove sounds, just put // before #define #define WITH_SOUNDS
#define ADMIN ADMIN_BAN #define SILVER ADMIN_LEVEL_G #define GOLDEN ADMIN_LEVEL_H /* ------------- No editing below this point ------- */
new g_max_clients new CsTeams:g_iActivatorTeam new bool:g_bGhostRunning = false
#if defined BIG_HUD #include <dhudmessage> #endif
// DO NOT EDIT THIS #define FINAL (ADMIN|SILVER|GOLDEN) #define IsValidPlayer(%1) (1 <= %1 <= g_max_clients)
#if defined WITH_SOUNDS
#define oooo_TASKID 142715
enum { PIANO = 0, KILL, oooo }
new g_szGhostSounds[][] = { "piano", "ghost_kill", "ooo0ooo" } new Float:g_fWooOooODuration #endif
new g_pBlockWeaponPickUp
new const gsz_MODELNAME[] = "dpt_ghost2"
public plugin_precache() { new szFilePath[100] formatex(szFilePath, charsmax(szFilePath), "models/player/%s/%s.mdl", gsz_MODELNAME, gsz_MODELNAME) precache_model(szFilePath) #if defined WITH_SOUNDS for(new i; i < sizeof(g_szGhostSounds); i++) { formatex(szFilePath, charsmax(szFilePath), "ghost/%s.wav", g_szGhostSounds[i]) precache_sound(szFilePath) } #endif }
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") #if defined WITH_SOUNDS register_event("DeathMsg", "eDeath", "a") #endif register_touch("armoury_entity", "player", "fw_PickUp") register_touch("weaponbox", "player", "fw_PickUp") g_pBlockWeaponPickUp = register_cvar("gw_block_weapon_pickup", "1") g_max_clients = get_maxplayers() }
public fw_PickUp(iEnt, id) { if(g_bGhostRunning && is_user_alive(id) && cs_get_user_team(id) == g_iActivatorTeam && get_pcvar_num(g_pBlockWeaponPickUp)) return PLUGIN_HANDLED return PLUGIN_CONTINUE }
#if defined WITH_SOUNDS public plugin_cfg() { new szFilePath[101] formatex(szFilePath, 100, "sound/ghost/%s.wav", g_szGhostSounds[oooo]) g_fWooOooODuration = GetWavDuration(szFilePath) } #endif
//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 defined WITH_SOUNDS if(task_exists(oooo_TASKID + i)) remove_task(oooo_TASKID + i) #endif } } } g_bGhostRunning = false client_cmd(0, "stopsound") set_lights("#OFF") } }
public client_putinserver(id) { if(g_bGhostRunning) { set_lights("d") #if defined WITH_SOUNDS set_task(g_fWooOooODuration, "Ghost_Woo", oooo_TASKID + id, .flags="b") #endif } }
#if defined WITH_SOUNDS public client_disconnect(id) { if(g_bGhostRunning) { if(task_exists(oooo_TASKID + id)) { remove_task(oooo_TASKID + id) } } } #endif
#if defined WITH_SOUNDS public eDeath() { if(g_bGhostRunning) { new iKiller = read_data(1) if(IsValidPlayer(iKiller) && cs_get_user_team(iKiller) == g_iActivatorTeam) client_cmd(0, "spk ^"ghost/%s^"", g_szGhostSounds[KILL]) } } #endif
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 #if defined WITH_SOUNDS client_cmd(0, "spk ^"ghost/%s^"", g_szGhostSounds[PIANO]) #endif 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 defined WITH_SOUNDS if(is_user_connected(i)) Ghost_Woo(oooo_TASKID + i) #endif } } #if defined WITH_SOUNDS 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") }
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 ); } #endif
And This One That I Edit It:
PHP Code:
#include <amxmodx> #include <cstrike> #include <fun> #include <engine>
/* ------------------- EDIT STUFF ------------------ */ // If you want a big HUD message, just remove the // before #define #define BIG_HUD
// if you want to completely remove sounds, just put // before #define #define WITH_SOUNDS
#define ADMIN ADMIN_BAN #define DIAMOND ADMIN_LEVEL_D #define SILVER ADMIN_LEVEL_G #define GOLDEN ADMIN_LEVEL_H #define BRONZE ADMIN_LEVEL_F /* ------------- No editing below this point ------- */
new g_max_clients new CsTeams:g_iActivatorTeam new bool:g_bGhostRunning = false
#if defined BIG_HUD #include <dhudmessage> #endif
// DO NOT EDIT THIS #define FINAL (ADMIN|DIAMOND|SILVER|GOLDEN|BRONZE) #define IsValidPlayer(%1) (1 <= %1 <= g_max_clients)
#if defined WITH_SOUNDS
#define oooo_TASKID 142715
enum { PIANO = 0, KILL, oooo }
new g_szGhostSounds[][] = { "piano", "ghost_kill", "ooo0ooo" } new Float:g_fWooOooODuration #endif
new g_pBlockWeaponPickUp
new const gsz_MODELNAME[] = "dpt_ghost2"
public plugin_precache() { new szFilePath[100] formatex(szFilePath, charsmax(szFilePath), "models/player/%s/%s.mdl", gsz_MODELNAME, gsz_MODELNAME) precache_model(szFilePath) #if defined WITH_SOUNDS for(new i; i < sizeof(g_szGhostSounds); i++) { formatex(szFilePath, charsmax(szFilePath), "ghost/%s.wav", g_szGhostSounds[i]) precache_sound(szFilePath) } #endif }
public plugin_init() { register_plugin( "Ghost WaLKING MOD", "0.0.5", "Freestyle/pokemonmaster" ); register_concmd("ad_ghosts", "gwm", FINAL, "*- Activates ghostwalking mode") register_event("HLTV", "NewRound", "a", "1=0", "2=0") #if defined WITH_SOUNDS register_event("DeathMsg", "eDeath", "a") #endif register_touch("armoury_entity", "player", "fw_PickUp") register_touch("weaponbox", "player", "fw_PickUp") g_pBlockWeaponPickUp = register_cvar("gw_block_weapon_pickup", "1") g_max_clients = get_maxplayers() }
public fw_PickUp(iEnt, id) { if(g_bGhostRunning && is_user_alive(id) && cs_get_user_team(id) == g_iActivatorTeam && get_pcvar_num(g_pBlockWeaponPickUp)) return PLUGIN_HANDLED return PLUGIN_CONTINUE }
#if defined WITH_SOUNDS public plugin_cfg() { new szFilePath[101] formatex(szFilePath, 100, "sound/ghost/%s.wav", g_szGhostSounds[oooo]) g_fWooOooODuration = GetWavDuration(szFilePath) } #endif
//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 defined WITH_SOUNDS if(task_exists(oooo_TASKID + i)) remove_task(oooo_TASKID + i) #endif } } } g_bGhostRunning = false client_cmd(0, "stopsound") set_lights("#OFF") } }
public client_putinserver(id) { if(g_bGhostRunning) { set_lights("d") #if defined WITH_SOUNDS set_task(g_fWooOooODuration, "Ghost_Woo", oooo_TASKID + id, .flags="b") #endif } }
#if defined WITH_SOUNDS public client_disconnect(id) { if(g_bGhostRunning) { if(task_exists(oooo_TASKID + id)) { remove_task(oooo_TASKID + id) } } } #endif
#if defined WITH_SOUNDS public eDeath() { if(g_bGhostRunning) { new iKiller = read_data(1) if(IsValidPlayer(iKiller) && cs_get_user_team(iKiller) == g_iActivatorTeam) client_cmd(0, "spk ^"ghost/%s^"", g_szGhostSounds[KILL]) } } #endif
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" : ( iFlags & DIAMOND ? "Diamond Player" : ( iFlags & BRONZE ? "Bronze 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 #if defined WITH_SOUNDS client_cmd(0, "spk ^"ghost/%s^"", g_szGhostSounds[PIANO]) #endif 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 defined WITH_SOUNDS if(is_user_connected(i)) Ghost_Woo(oooo_TASKID + i) #endif } } #if defined WITH_SOUNDS 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") }
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 ); } #endif
Sorry If I may sound stupid, but I'm Learning. Thank You.
|