Senior Member
Join Date: May 2013
Location: republica dominicana
|
09-08-2013
, 13:08
[ZPA][AYUDA] Modo Synapsis Instinc
|
#1
|
Hola a todos no se que estoy haciendo mal miren pongo todo donde va y me tira error ayuda.
PHP Code:
#include < amxmodx > #include < fun > #include < cstrike > #include < zombie_plague_advance >
/************************************************************\ | Customizations Section | | You can edit here according to your liking | \************************************************************/
// How many Nemesis should be there in this mode #define MAX_NEMESIS 3
// How many Survivor should be there in this mode #define MAX_SURVIVORS 2
// This is the chance value according to which this game mode will be called // The higher the value the lesser the chance of calling this game mode new const g_chance = 15
// This is the access flag required to start the game mode // through the admin menu. Look in users.ini for more details new const g_access_flag[] = "a"
// This is the sound which is played when the game mode is triggered // Add as many as you want [Randomly chosen if more than one] new const g_play_sounds[][] = { "zombie_plague/nemesis1.wav" , "zombie_plague/survivor1.wav" }
#if cellbits == 32 const OFFSET_CLIPAMMO = 51 #else const OFFSET_CLIPAMMO = 65 #endif const OFFSET_LINUX_WEAPONS = 4
const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90) const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE) const GRENADES_WEAPONS_BIT_SUM = (1<<CSW_HEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_SMOKEGRENADE)
// Max BP ammo for weapons new const MAXBPAMMO[] = { -1, 52, -1, 90, 1, 32, 1, 100, 90, 1, 120, 100, 100, 90, 90, 90, 100, 120, 30, 120, 200, 32, 90, 120, 90, 2, 35, 90, 90, -1, 100 }
// Ammo Type Names for weapons new const AMMOTYPE[][] = { "", "357sig", "", "762nato", "", "buckshot", "", "45acp", "556nato", "", "9mm", "57mm", "45acp", "556nato", "556nato", "556nato", "45acp", "9mm", "338magnum", "9mm", "556natobox", "buckshot", "556nato", "9mm", "762nato", "", "50ae", "556nato", "762nato", "", "57mm" }
// Max Clip for weapons new const MAXCLIP[] = { -1, 13, -1, 10, 1, 7, -1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20, 10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 }
#define PRIMARY_ONLY 1 #define SECONDARY_ONLY 2 #define GRENADES_ONLY 4
// CS Player CBase Offsets (win32) const PDATA_SAFE = 2 const OFFSET_ACTIVE_ITEM = 373
// Comment the following line to disable ambience sounds // Just add two slashes ( // ) #define AMBIENCE_SOUNDS
#if defined AMBIENCE_SOUNDS // Ambience Sounds (only .wav and .mp3 formats supported) // Add as many as you want [Randomly chosen if more than one] new const g_sound_ambience[][] = { "zombie_plague/ambience.wav" }
// Duration in seconds of each sound new const Float:g_sound_ambience_duration[] = { 58.0 , 56.0 } #endif
/************************************************************\ | Customizations Ends Here..!! | | You can edit the cvars in the plugin init | \************************************************************/
// Variables new g_gameid, g_maxplayers, cvar_minplayers, g_msg_sync new cvar_human_weapon_block
// Ambience sounds task #define TASK_AMB 3256
public plugin_init( ) { // Plugin registeration. register_plugin( "[ZP] Synapsis Mode","1.0", "@bdul!" ) // Min players required cvar_minplayers = register_cvar("zp_synapsis_minplayers", "2") cvar_human_weapon_block = register_cvar("zp_human_weapon_block", "1") // Get maxplayers g_maxplayers = get_maxplayers( ) // Hud stuff g_msg_sync = CreateHudSyncObj() }
// Game modes MUST be registered in plugin precache ONLY public plugin_precache( ) { // Read the access flag new access_flag = read_flags( g_access_flag ) new i // Precache the play sounds for (i = 0; i < sizeof g_play_sounds; i++) precache_sound( g_play_sounds[i] ) // Precache the ambience sounds #if defined AMBIENCE_SOUNDS new sound[100] for (i = 0; i < sizeof g_sound_ambience; i++) { if (equal(g_sound_ambience[i][strlen(g_sound_ambience[i])-4], ".mp3")) { formatex(sound, sizeof sound - 1, "sound/%s", g_sound_ambience[i]) precache_generic( sound ) } else { precache_sound( g_sound_ambience[i] ) } } #endif // Register our game mode g_gameid = zp_register_game_mode( "Synapsis Mode", access_flag, g_chance, 0, ZP_DM_BALANCE ) }
public zp_round_started_pre( game ) { // Check if it is our game mode if( game == g_gameid ) { // Check for min players if( fn_get_alive_players() < get_pcvar_num(cvar_minplayers) ) { /** * Note: * This very necessary, you should return ZP_PLUGIN_HANDLED if * some conditions required by your game mode are not met * This will inform the main plugin that you have rejected * the offer and so the main plugin will allow other game modes * to be given a chance */ return ZP_PLUGIN_HANDLED } // Start our new mode start_avs_mode( ) } // Make the compiler happy =) return PLUGIN_CONTINUE }
public zp_round_started( game, id ) { // Check if it is our game mode if( game == g_gameid ) { // Show HUD notice set_hudmessage(221, 156, 21, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1) ShowSyncHudMsg(0, g_msg_sync, "Synapsis Mode !!!") // Play the starting sound client_cmd(0, "spk ^"%s^"", g_play_sounds[ random_num(0, sizeof g_play_sounds -1) ] ) // Remove ambience task affects remove_task( TASK_AMB ) // Set task to start ambience sounds #if defined AMBIENCE_SOUNDS set_task( 2.0, "start_ambience_sounds", TASK_AMB ) #endif } }
public zp_game_mode_selected( gameid, id ) { // Check if our game mode was called if( gameid == g_gameid ) start_avs_mode( ) // Make the compiler happy again =) return PLUGIN_CONTINUE }
// This function contains the whole code behind this game mode start_avs_mode( ) { // Create and initialize some important vars static i_assassins, id id = 0 i_assassins = 0 // Randomly turn players into Assassins while (i_assassins < MAX_NEMESIS) { // Keep looping through all players if ( (++id) > g_maxplayers) id = 1 // Dead if ( !is_user_alive(id) ) continue; // Random chance if (random_num(1, 5) == 1) { // Make user nemesis zp_make_user_nemesis(id) // Increase counter i_assassins++ } } i_assassins = 0 // Randomly turn players into Assassins while (i_assassins < MAX_SURVIVORS) { // Keep looping through all players if ( (++id) > g_maxplayers) id = 1 // Dead if ( !is_user_alive(id) || zp_get_user_nemesis(id) ) continue; // Random chance if (random_num(1, 5) == 1) { // Make user assassin zp_make_user_survivor(id) // Increase counter i_assassins++ } } // Turn the remaining players into humans for (id = 1; id <= g_maxplayers; id++) { // Only those of them who are alive and are not assassins if ( !is_user_alive(id) || zp_get_user_nemesis(id) || zp_get_user_survivor(id) ) continue; // Turn into a human if (cs_get_user_team(id) != CS_TEAM_CT) cs_set_user_team(id, CS_TEAM_CT) dar_xm1014(id) } }
#if defined AMBIENCE_SOUNDS public start_ambience_sounds( ) { // Variables static amb_sound[64], sound, Float:duration // Select our ambience sound sound = random_num( 0, sizeof g_sound_ambience - 1 ) copy( amb_sound, sizeof amb_sound - 1 , g_sound_ambience[ sound ] ) duration = g_sound_ambience_duration[ sound ] // Check whether it's a wav or mp3, then play it on clients if ( equal( amb_sound[ strlen( amb_sound ) - 4 ], ".mp3" ) ) client_cmd( 0, "mp3 play ^"sound/%s^"", amb_sound ) else client_cmd( 0, "spk ^"%s^"", sound ) // Start the ambience sounds set_task( duration, "start_ambience_sounds", TASK_AMB ) } public zp_round_ended( winteam ) { // Stop ambience sounds on round end remove_task( TASK_AMB ) } #endif
// This function returns the no. of alive players // Feel free to use this in your plugin when you // are making your own game modes. fn_get_alive_players( ) { static i_alive, id i_alive = 0 for ( id = 1; id <= g_maxplayers; id++ ) { if( is_user_alive( id ) ) i_alive++ } return i_alive; }
public clcmd_drop(id) { // Should human stick to his weapon? if (!zp_core_is_zombie(id) && get_pcvar_num(cvar_human_weapon_block)) return PLUGIN_HANDLED; return PLUGIN_CONTINUE; }
// Ham Weapon Touch Forward public fw_TouchWeapon(weapon, id) { // Should survivor stick to his weapon? if (get_pcvar_num(cvar_human_weapon_block) && is_user_alive(id) && !zp_core_is_zombie(id)) return HAM_SUPERCEDE; return HAM_IGNORED; }
public dar_xm1014(id) { strip_weapons(id, PRIMARY_ONLY) give_item(id, "weapon_xm1014") ExecuteHamB(Ham_GiveAmmo, id, MAXBPAMMO[CSW_XM1014], AMMOTYPE[CSW_XM1014], MAXBPAMMO[CSW_XM1014]) g_has_unlimited_clip[id] = true }
// Unlimited clip code public message_cur_weapon(msg_id, msg_dest, msg_entity) { // Player doesn't have the unlimited clip upgrade if (!g_has_unlimited_clip[msg_entity]) return; // Player not alive or not an active weapon if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1) return; static weapon, clip weapon = get_msg_arg_int(2) // get weapon ID clip = get_msg_arg_int(3) // get weapon clip // Unlimited Clip Ammo if (MAXCLIP[weapon] > 2) // skip grenades { set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon]) // HUD should show full clip all the time if (clip < 2) // refill when clip is nearly empty { // Get the weapon entity static wname[32], weapon_ent get_weaponname(weapon, wname, sizeof wname - 1) weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity) // Set max clip on weapon fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon]) } } }
stock strip_weapons(id, stripwhat) { // Get user weapons new weapons[32], num_weapons, index, weaponid get_user_weapons(id, weapons, num_weapons) // Loop through them and drop primaries or secondaries for (index = 0; index < num_weapons; index++) { // Prevent re-indexing the array weaponid = weapons[index] if ((stripwhat == PRIMARY_ONLY && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) || (stripwhat == SECONDARY_ONLY && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)) || (stripwhat == GRENADES_ONLY && ((1<<weaponid) & GRENADES_WEAPONS_BIT_SUM))) { // Get weapon name new wname[32] get_weaponname(weaponid, wname, charsmax(wname)) // Strip weapon and remove bpammo ham_strip_weapon(id, wname) cs_set_user_bpammo(id, weaponid, 0) } } }
stock ham_strip_weapon(index, const weapon[]) { // Get weapon id new weaponid = get_weaponid(weapon) if (!weaponid) return false; // Get weapon entity new weapon_ent = fm_find_ent_by_owner(-1, weapon, index) if (!weapon_ent) return false; // If it's the current weapon, retire first new current_weapon_ent = fm_cs_get_current_weapon_ent(index) new current_weapon = pev_valid(current_weapon_ent) ? cs_get_weapon_id(current_weapon_ent) : -1 if (current_weapon == weaponid) ExecuteHamB(Ham_Weapon_RetireWeapon, weapon_ent) // Remove weapon from player if (!ExecuteHamB(Ham_RemovePlayerItem, index, weapon_ent)) return false; // Kill weapon entity and fix pev_weapons bitsum ExecuteHamB(Ham_Item_Kill, weapon_ent) set_pev(index, pev_weapons, pev(index, pev_weapons) & ~(1<<weaponid)) return true; }
// Find entity by its owner (from fakemeta_util) stock fm_find_ent_by_owner(entity, const classname[], owner) { while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) { /* keep looping */ } return entity; }
// Get User Current Weapon Entity stock fm_cs_get_current_weapon_ent(id) { // Prevent server crash if entity's private data not initalized if (pev_valid(id) != PDATA_SAFE) return -1; return get_pdata_cbase(id, OFFSET_ACTIVE_ITEM); }
// Set Weapon Clip Ammo stock fm_set_weapon_ammo(entity, amount) { set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS); }
public zp_fw_gamemodes_end(game_mode_id) { for (new i = 1; i <= g_MaxPlayers; i++) { g_has_unlimited_clip[i] = true } } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang3082\\ f0\\ fs16 \n\\ par } */
aqui los errores
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team
Warning: Loose indentation on line 260
Error: Undefined symbol "zp_core_is_nemesis" on line 311
Error: Undefined symbol "zp_core_is_zombie" on line 321
Error: Undefined symbol "HAM_SUPERCEDE" on line 322
Error: Undefined symbol "HAM_IGNORED" on line 324
Error: Undefined symbol "ExecuteHamB" on line 331
Warning: Expression has no effect on line 331
Warning: Expression has no effect on line 331
Warning: Expression has no effect on line 331
Warning: Expression has no effect on line 331
Error: Expected token: ";", but found ")" on line 331
Error: Invalid expression, assumed zero on line 331
Error: Too many error messages on one line on line 331
Compilation aborted.
8 Errors.
Could not locate output file C:\Users\dawich\Desktop\Untitled.amx (compile failed).
Last edited by Dawichi; 09-08-2013 at 13:08.
Reason: asd
|
|