Raised This Month: $ Target: $400
 0% 

When I try to test the plugin, it crashes the game


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Itz
Junior Member
Join Date: Apr 2021
Old 05-24-2021 , 23:25   Re: When I try to test the plugin, it crashes the game
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
Why don't you tell us what you changed so we do not need to read every line trying to find the mistake?
I made the following changes add new class

PHP Code:
#include <zp50_class_plasma>
#include <zp50_class_knifer>
#include <zp50_class_dragon>
#include <zp50_class_nightcrawler> 
add novos cvar

PHP Code:
cvar_nightmare_kni_hp_multi register_cvar("zp_nightmare_knife_hp_multi""0.25")
cvar_nightmare_drag_hp_multi register_cvar("zp_nightmare_dragon_hp_multi""1.0")
cvar_nightmare_plasm_hp_multi register_cvar("zp_nightmare_plasma_hp_multi""1.0")
cvar_nightmare_nigh_hp_multi register_cvar("zp_nightmare_nightcrawler_hp_multi""1.0"
add them here too

PHP Code:
public zp_fw_gamemodes_start()
{
    
// Calculate player counts
    
new idalive_count GetAliveCount()
    new 
survivor_count floatround(alive_count 0.20floatround_ceil)
    
//new nemesis_count = floatround(alive_count * 0.20, floatround_ceil)
    //new sniper_count = floatround(alive_count * 0.10, floatround_ceil)
    //new knife_count = floatround(alive_count * 0.15, floatround_ceil)
    //new plasma_count = floatround(alive_count * 0.10, floatround_ceil)
    //new dragon_count = floatround(alive_count * 0.15, floatround_ceil)
    //new nightcrawler_count = floatround(alive_count * 0.10, floatround_ceil)
    
new nemesis_count survivor_count
    
new sniper_count survivor_count
    
new knife_count survivor_count
    
new plasma_count survivor_count
    
new dragon_count survivor_count
    
new nightcrawler_count survivor_count 
And in that part

PHP Code:
// Turn specified amount of players into Knifer
    
new iKnifeiMaxKnife knife_count
    
while (iKnife iMaxKnife)
    {
        
// Choose random guy
        
id GetRandomAlive(random_num(1alive_count))
        
        
// Already a survivor or nemesis?
        
if (zp_class_survivor_get(id) || zp_class_nemesis_get(id) || zp_class_sniper_get(id) || zp_class_knifer_get(id) || zp_class_plasma_get(id) || zp_class_dragon_get(id) || zp_class_nightcrawler_get(id))
            continue;
        
        
// If not, turn him into one
        
zp_class_knifer_set(id)
        
iKnife++
        
        
// Apply Knife health multiplier
        
set_user_health(idfloatround(get_user_health(id) * get_pcvar_float(cvar_nightmare_kni_hp_multi)))
    }
    
    
// Turn specified amount of players into Knifer
    
new iPlasmaiMaxPlasma plasma_count
    
while (iPlasma iMaxPlasma)
    {
        
// Choose random guy
        
id GetRandomAlive(random_num(1alive_count))
        
        
// Already a survivor or nemesis?
        
if (zp_class_survivor_get(id) || zp_class_nemesis_get(id) || zp_class_sniper_get(id) || zp_class_knifer_get(id) || zp_class_plasma_get(id) || zp_class_dragon_get(id) || zp_class_nightcrawler_get(id))
            continue;
        
        
// If not, turn him into one
        
zp_class_plasma_set(id)
        
iPlasma++
        
        
// Apply Plasma health multiplier
        
set_user_health(idfloatround(get_user_health(id) * get_pcvar_float(cvar_nightmare_plasm_hp_multi)))
    }
    
    
// Turn specified amount of players into Knifer
    
new iDragoniMaxDragon dragon_count
    
while (iDragon iMaxDragon)
    {
        
// Choose random guy
        
id GetRandomAlive(random_num(1alive_count))
        
        
// Already a survivor or nemesis?
        
if (zp_class_survivor_get(id) || zp_class_nemesis_get(id) || zp_class_sniper_get(id) || zp_class_knifer_get(id) || zp_class_plasma_get(id) || zp_class_dragon_get(id) || zp_class_nightcrawler_get(id))
            continue;
        
        
// If not, turn him into one
        
zp_class_dragon_set(id)
        
iDragon++
        
        
// Apply Dragon health multiplier
        
set_user_health(idfloatround(get_user_health(id) * get_pcvar_float(cvar_nightmare_drag_hp_multi)))
    }
    
    
// Turn specified amount of players into Knifer
    
new iNightCrawleriMaxNightCrawler nightcrawler_count
    
while (iNightCrawler iMaxNightCrawler)
    {
        
// Choose random guy
        
id GetRandomAlive(random_num(1alive_count))
        
        
// Already a survivor or nemesis?
        
if (zp_class_survivor_get(id) || zp_class_nemesis_get(id) || zp_class_sniper_get(id) || zp_class_knifer_get(id) || zp_class_plasma_get(id) || zp_class_dragon_get(id) || zp_class_nightcrawler_get(id))
            continue;
        
        
// If not, turn him into one
        
zp_class_nightcrawler_set(id)
        
iNightCrawler++
        
        
// Apply NightCrawler health multiplier
        
set_user_health(idfloatround(get_user_health(id) * get_pcvar_float(cvar_nightmare_nigh_hp_multi)))
    }
    
    
// Play Armageddon sound
    
if (get_pcvar_num(cvar_nightmare_sounds))
    {
        new 
sound[SOUND_MAX_LENGTH]
        
ArrayGetString(g_sound_nightmarerandom_num(0ArraySize(g_sound_nightmare) - 1), soundcharsmax(sound))
        
PlaySoundToClients(sound)
    } 

Last edited by Itz; 05-24-2021 at 23:26.
Itz 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 02:35.


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