Raised This Month: $51 Target: $400
 12% 

[ZPA][AYUDA] Modo Synapsis Instinc


  
 
 
Thread Tools Display Modes
Author Message
Dawichi
Senior Member
Join Date: May 2013
Location: republica dominicana
Old 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[] = { -152, -1901321100901120100100909090100120,
301202003290120902359090, -1100 }

// 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[] = { -113, -11017, -1303013020253035251220,
            
10301008303020273030, -150 }

#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_gameidg_maxplayerscvar_minplayersg_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_flagsg_access_flag )
    new 
i
    
    
// Precache the play sounds
    
for (0sizeof g_play_soundsi++)
        
precache_soundg_play_sounds[i] )
    
    
// Precache the ambience sounds
    #if defined AMBIENCE_SOUNDS
    
new sound[100]
    for (
0sizeof g_sound_ambiencei++)
    {
        if (
equal(g_sound_ambience[i][strlen(g_sound_ambience[i])-4], ".mp3"))
        {
            
formatex(soundsizeof sound 1"sound/%s"g_sound_ambience[i])
            
precache_genericsound )
        }
        else
        {
            
precache_soundg_sound_ambience[i] )
        }
    }
    
#endif
    
    // Register our game mode
    
g_gameid zp_register_game_mode"Synapsis Mode"access_flagg_chance0ZP_DM_BALANCE )
}

public 
zp_round_started_pregame )
{
    
// 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_startedgameid )
{
    
// Check if it is our game mode
    
if( game == g_gameid )
    {
        
// Show HUD notice
        
set_hudmessage(22115621, -1.00.1710.05.01.01.0, -1)
        
ShowSyncHudMsg(0g_msg_sync"Synapsis Mode !!!")
        
        
// Play the starting sound
        
client_cmd(0"spk ^"%s^""g_play_soundsrandom_num(0sizeof g_play_sounds -1) ] )
        
        
// Remove ambience task affects
        
remove_taskTASK_AMB )
        
        
// Set task to start ambience sounds
        #if defined AMBIENCE_SOUNDS
        
set_task2.0"start_ambience_sounds"TASK_AMB )
        
#endif
    
}
}

public 
zp_game_mode_selectedgameidid )
{
    
// 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_assassinsid
    id 
0
    i_assassins 
0
    
    
// Randomly turn players into Assassins
    
while (i_assassins MAX_NEMESIS)
    {
        
// Keep looping through all players
        
if ( (++id) > g_maxplayersid 1
        
        
// Dead
        
if ( !is_user_alive(id) )
            continue;
        
        
// Random chance
        
if (random_num(15) == 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_maxplayersid 1
        
        
// Dead
        
if ( !is_user_alive(id) || zp_get_user_nemesis(id) )
            continue;
        
        
// Random chance
        
if (random_num(15) == 1)
        {
            
// Make user assassin
            
zp_make_user_survivor(id)
            
            
// Increase counter
            
i_assassins++
        }
    }
    
    
// Turn the remaining players into humans
    
for (id 1id <= g_maxplayersid++)
    {
        
// 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(idCS_TEAM_CT)
       
dar_xm1014(id)
    }
}


#if defined AMBIENCE_SOUNDS
public start_ambience_sounds( )
{
    
// Variables
    
static amb_sound[64], soundFloat:duration
    
    
// Select our ambience sound
    
sound random_num0sizeof g_sound_ambience )
    
copyamb_soundsizeof amb_sound g_sound_ambiencesound ] )
    
duration g_sound_ambience_durationsound ]
    
    
// Check whether it's a wav or mp3, then play it on clients
    
if ( equalamb_soundstrlenamb_sound ) - ], ".mp3" ) )
        
client_cmd0"mp3 play ^"sound/%s^""amb_sound )
    else
        
client_cmd0"spk ^"%s^""sound )
    
    
// Start the ambience sounds
    
set_taskduration"start_ambience_sounds"TASK_AMB )
}
public 
zp_round_endedwinteam )
{
    
// Stop ambience sounds on round end
    
remove_taskTASK_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_aliveid
    i_alive 
0
    
    
for ( id 1id <= g_maxplayersid++ )
    {
        if( 
is_user_aliveid ) )
            
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(weaponid)
{
    
// 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(idPRIMARY_ONLY)
    
give_item(id"weapon_xm1014")
    
ExecuteHamB(Ham_GiveAmmoidMAXBPAMMO[CSW_XM1014], AMMOTYPE[CSW_XM1014], MAXBPAMMO[CSW_XM1014])
    
g_has_unlimited_clip[id] = true
}  

// Unlimited clip code
public message_cur_weapon(msg_idmsg_destmsg_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 
weaponclip
    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(3get_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
(weaponwnamesizeof wname 1)
            
weapon_ent fm_find_ent_by_owner(-1wnamemsg_entity)
            
            
// Set max clip on weapon
            
fm_set_weapon_ammo(weapon_entMAXCLIP[weapon])
        }
    }
}

stock strip_weapons(idstripwhat)
{
    
// Get user weapons
    
new weapons[32], num_weaponsindexweaponid
    get_user_weapons
(idweaponsnum_weapons)
    
    
// Loop through them and drop primaries or secondaries
    
for (index 0index num_weaponsindex++)
    {
        
// 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(weaponidwnamecharsmax(wname))
            
            
// Strip weapon and remove bpammo
            
ham_strip_weapon(idwname)
            
cs_set_user_bpammo(idweaponid0)
        }
    }
}

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(-1weaponindex)
    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_RetireWeaponweapon_ent)
    
    
// Remove weapon from player
    
if (!ExecuteHamB(Ham_RemovePlayerItemindexweapon_ent))
        return 
false;
    
    
// Kill weapon entity and fix pev_weapons bitsum
    
ExecuteHamB(Ham_Item_Killweapon_ent)
    
set_pev(indexpev_weaponspev(indexpev_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_FindEntityByStringentity"classname"classname)) && pev(entitypev_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(idOFFSET_ACTIVE_ITEM);
}

// Set Weapon Clip Ammo
stock fm_set_weapon_ammo(entityamount)
{
    
set_pdata_int(entityOFFSET_CLIPAMMOamountOFFSET_LINUX_WEAPONS);
}

public 
zp_fw_gamemodes_end(game_mode_id)
{    
      for (new 
1<= g_MaxPlayersi++)
      {
         
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
Dawichi is offline
Roccoxx
AlliedModders Donor
Join Date: Jan 2012
Location: Argentina
Old 09-08-2013 , 13:15   Re: [ZPA][AYUDA] Modo Synapsis Instinc
#2

falta el include hamsandwich y el include con las natives de zp_core_is_nemesis y zp_core_is_zombie
__________________
Tutorials here (Spanish)

Like as another Pijudo said: "Tired and retired"
Roccoxx is offline
Send a message via MSN to Roccoxx
Dawichi
Senior Member
Join Date: May 2013
Location: republica dominicana
Old 09-08-2013 , 13:22   Re: [ZPA][AYUDA] Modo Synapsis Instinc
#3

ok gracias eso delos include van el zombie_plague_advanced.inc no?
Dawichi is offline
chetah
Senior Member
Join Date: Jan 2013
Location: BangBros
Old 09-08-2013 , 13:45   Re: [ZPA][AYUDA] Modo Synapsis Instinc
#4

si ahi metes las natives
__________________
Minecraft Mod: | %15
"Tomorrowland <3"
chetah is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:12.


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