Quote:
Originally Posted by ALonsoVIP4141
Can i have an example for im not rely good at ZP 5.0
|
Open the plugin with the name "zp50_gamemode_nemesis.sma" and replace this function
PHP Code:
public plugin_precache()
{
// Register game mode at precache (plugin gets paused after this)
register_plugin("[ZP] Game Mode: Nemesis", ZP_VERSION_STRING, "ZP Dev Team")
zp_gamemodes_register("Nemesis Mode")
// Create the HUD Sync Objects
g_HudSync = CreateHudSyncObj()
g_MaxPlayers = get_maxplayers()
cvar_nemesis_chance = register_cvar("zp_nemesis_chance", "20")
cvar_nemesis_min_players = register_cvar("zp_nemesis_min_players", "0")
cvar_nemesis_show_hud = register_cvar("zp_nemesis_show_hud", "1")
cvar_nemesis_sounds = register_cvar("zp_nemesis_sounds", "1")
cvar_nemesis_allow_respawn = register_cvar("zp_nemesis_allow_respawn", "0")
// Initialize arrays
g_sound_nemesis = ArrayCreate(SOUND_MAX_LENGTH, 1)
// Load from external file
amx_load_setting_string_arr(ZP_SETTINGS_FILE, "Sounds", "ROUND NEMESIS", g_sound_nemesis)
// If we couldn't load custom sounds from file, use and save default ones
new index
if (ArraySize(g_sound_nemesis) == 0)
{
for (index = 0; index < sizeof sound_nemesis; index++)
ArrayPushString(g_sound_nemesis, sound_nemesis[index])
// Save to external file
amx_save_setting_string_arr(ZP_SETTINGS_FILE, "Sounds", "ROUND NEMESIS", g_sound_nemesis)
}
// Precache sounds
new sound[SOUND_MAX_LENGTH]
for (index = 0; index < ArraySize(g_sound_nemesis); index++)
{
ArrayGetString(g_sound_nemesis, index, sound, charsmax(sound))
if (equal(sound[strlen(sound)-4], ".mp3"))
{
format(sound, charsmax(sound), "sound/%s", sound)
precache_generic(sound)
}
else
precache_sound(sound)
}
}
PHP Code:
public plugin_precache()
{
if( !IsMapAvailable( "de_" ) )
{
return; // If the map is not "de_*" blocks this plugin.
}
// Register game mode at precache (plugin gets paused after this)
register_plugin("[ZP] Game Mode: Nemesis", ZP_VERSION_STRING, "ZP Dev Team")
zp_gamemodes_register("Nemesis Mode")
// Create the HUD Sync Objects
g_HudSync = CreateHudSyncObj()
g_MaxPlayers = get_maxplayers()
cvar_nemesis_chance = register_cvar("zp_nemesis_chance", "20")
cvar_nemesis_min_players = register_cvar("zp_nemesis_min_players", "0")
cvar_nemesis_show_hud = register_cvar("zp_nemesis_show_hud", "1")
cvar_nemesis_sounds = register_cvar("zp_nemesis_sounds", "1")
cvar_nemesis_allow_respawn = register_cvar("zp_nemesis_allow_respawn", "0")
// Initialize arrays
g_sound_nemesis = ArrayCreate(SOUND_MAX_LENGTH, 1)
// Load from external file
amx_load_setting_string_arr(ZP_SETTINGS_FILE, "Sounds", "ROUND NEMESIS", g_sound_nemesis)
// If we couldn't load custom sounds from file, use and save default ones
new index
if (ArraySize(g_sound_nemesis) == 0)
{
for (index = 0; index < sizeof sound_nemesis; index++)
ArrayPushString(g_sound_nemesis, sound_nemesis[index])
// Save to external file
amx_save_setting_string_arr(ZP_SETTINGS_FILE, "Sounds", "ROUND NEMESIS", g_sound_nemesis)
}
// Precache sounds
new sound[SOUND_MAX_LENGTH]
for (index = 0; index < ArraySize(g_sound_nemesis); index++)
{
ArrayGetString(g_sound_nemesis, index, sound, charsmax(sound))
if (equal(sound[strlen(sound)-4], ".mp3"))
{
format(sound, charsmax(sound), "sound/%s", sound)
precache_generic(sound)
}
else
precache_sound(sound)
}
}
bool:IsMapAvailable( const szMapHandler[ ] )
{
new szMap[ 32 ];
get_mapname( szMap, charsmax( szMap ) )
return ( contain( szMap, szMapHandler ) != 0 ) ? true : false
}
Or use another method that was shared by ZaX
Create a new file in this location addons/amxmodx/configs/maps with name "plugins-de.ini" and type the name of the plugin that you want to make it work on "de" maps like this:
zp50_gamemode_nemesis.amxx
zp50_gamemode_survivor.amxx
etc...
Note: If you are going to use the second method, remember to remove the plugin you added in "plugins-de.ini" from "plugins.ini"
__________________