AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED] fix nightmare mode! (https://forums.alliedmods.net/showthread.php?t=276507)

arvEL. 12-22-2015 16:43

[SOLVED] fix nightmare mode!
 
hi guys, i want fix this codes:

PHP Code:

else if ((mode == MODE_NONE && (g_lastmode != MODE_NIGHT) && random_num(130) == && floatround(iPlayersnum*0.4floatround_ceil) >= && floatround(iPlayersnum*0.4floatround_ceil) < iPlayersnum && iPlayersnum >= 4) || mode == MODE_NIGHT)
{        
// Nightmare Mode
g_nightround true
g_lastmode 
MODE_NIGHT

// iMaxZombies is rounded up, in case there aren't enough players
iMaxZombies floatround(iPlayersnum*0.4floatround_ceil)
iZombies 0

// Randomly turn iMaxZombies players into nemesis
while (iZombies iMaxZombies)
{
// Keep looping through all players
if (++id g_maxplayersid 1

// Dead or already a nemesis
if (!g_isalive[id] || g_nemesis[id])
continue;

// Random chance
if (random_num(01))
{
// Turn into a nemesis
zombieme(id01000)
iZombies++        

// Apply nemesis health 
fm_set_user_health(id90000)
}
}

iZombies 0

// Randomly turn iMaxZombies players into assassins
while (iZombies iMaxZombies)
{
// Keep looping through all players
if (++id g_maxplayersid 1

// Dead or already a nemesis/assassin
if (!g_isalive[id] || g_nemesis[id] || g_assassin[id])
continue;

// Random chance
if (random_num(01))
{
// Turn into an assassin
zombieme(id00100)
iZombies++        

// Apply assassin health 
fm_set_user_health(id30000)
}
}

iZombies 0

// Randomly turn iMaxZombies players into survivors
while (iZombies iMaxZombies)
{
// Keep looping through all players
if (++id g_maxplayersid 1

// Dead or already a nemesis/assassin/survivor
if (!g_isalive[id] || g_nemesis[id] || g_assassin[id] || g_survivor[id])
continue;

// Random chance
if (random_num(01))
{
// Turn into a survivor
humanme(id100)
iZombies++        

// Apply survivor health 
fm_set_user_health(id12000)
}
}

// Turn the remaining players into snipers
for (id 1id <= g_maxplayersid++)
{
// Only those of them who aren't nemesis/assassin/survivor/sniper
if (!g_isalive[id] || g_nemesis[id] || g_assassin[id] || g_survivor[id] || g_sniper[id])
continue;

// If not, turn him into one
humanme(id010)            

// Apply sniper health 
fm_set_user_health(id10000)                                        
}        

// Play nightmare sound
ArrayGetString(sound_nightmarerandom_num(0ArraySize(sound_nightmare) - 1), soundcharsmax(sound))
PlaySound(sound);

// Show Nightmare HUD notice
set_hudmessage(2552020HUD_EVENT_XHUD_EVENT_Y10.05.01.01.0, -1)
ShowSyncHudMsg(0g_MsgSync"Nightmare Round !!!")        

// Mode fully started!
g_modestarted true

// Round start forward
ExecuteForward(g_fwRoundStartg_fwDummyResultMODE_NIGHT0);


when the nightmare start the server crashed :/
what the problem with this codes??

wickedd 12-22-2015 16:55

Re: [HELP] edit plague mod
 
Do it then, this is not the request forum.
P.S. You can give scripting lessons but you can't do that :roll:

arvEL. 12-22-2015 17:08

Re: [HELP] edit plague mod
 
Quote:

Originally Posted by wickedd (Post 2375273)
Do it then, this is not the request forum.
P.S. You can give scripting lessons but you can't do that :roll:

I gave lessons that I learned only!
I am tired of false attempts

wickedd 12-22-2015 17:26

Re: [HELP] fix nightmare mode!
 
Quote:

Originally Posted by arvEL. (Post 2375271)
hi guys, i want fix this codes:

PHP Code:

else if ((mode == MODE_NONE && (g_lastmode != MODE_NIGHT) && random_num(130) == && floatround(iPlayersnum*0.4floatround_ceil) >= && floatround(iPlayersnum*0.4floatround_ceil) < iPlayersnum && iPlayersnum >= 4) || mode == MODE_NIGHT)
{        
// Nightmare Mode
g_nightround true
g_lastmode 
MODE_NIGHT

// iMaxZombies is rounded up, in case there aren't enough players
iMaxZombies floatround(iPlayersnum*0.4floatround_ceil)
iZombies 0

// Randomly turn iMaxZombies players into nemesis
while (iZombies iMaxZombies)
{
// Keep looping through all players
if (++id g_maxplayersid 1

// Dead or already a nemesis
if (!g_isalive[id] || g_nemesis[id])
continue;

// Random chance
if (random_num(01))
{
// Turn into a nemesis
zombieme(id01000)
iZombies++        

// Apply nemesis health 
fm_set_user_health(id90000)
}
}

iZombies 0

// Randomly turn iMaxZombies players into assassins
while (iZombies iMaxZombies)
{
// Keep looping through all players
if (++id g_maxplayersid 1

// Dead or already a nemesis/assassin
if (!g_isalive[id] || g_nemesis[id] || g_assassin[id])
continue;

// Random chance
if (random_num(01))
{
// Turn into an assassin
zombieme(id00100)
iZombies++        

// Apply assassin health 
fm_set_user_health(id30000)
}
}

iZombies 0

// Randomly turn iMaxZombies players into survivors
while (iZombies iMaxZombies)
{
// Keep looping through all players
if (++id g_maxplayersid 1

// Dead or already a nemesis/assassin/survivor
if (!g_isalive[id] || g_nemesis[id] || g_assassin[id] || g_survivor[id])
continue;

// Random chance
if (random_num(01))
{
// Turn into a survivor
humanme(id100)
iZombies++        

// Apply survivor health 
fm_set_user_health(id12000)
}
}

// Turn the remaining players into snipers
for (id 1id <= g_maxplayersid++)
{
// Only those of them who aren't nemesis/assassin/survivor/sniper
if (!g_isalive[id] || g_nemesis[id] || g_assassin[id] || g_survivor[id] || g_sniper[id])
continue;

// If not, turn him into one
humanme(id010)            

// Apply sniper health 
fm_set_user_health(id10000)                                        
}        

// Play nightmare sound
ArrayGetString(sound_nightmarerandom_num(0ArraySize(sound_nightmare) - 1), soundcharsmax(sound))
PlaySound(sound);

// Show Nightmare HUD notice
set_hudmessage(2552020HUD_EVENT_XHUD_EVENT_Y10.05.01.01.0, -1)
ShowSyncHudMsg(0g_MsgSync"Nightmare Round !!!")        

// Mode fully started!
g_modestarted true

// Round start forward
ExecuteForward(g_fwRoundStartg_fwDummyResultMODE_NIGHT0);



If you want help then post the correct code, because that code will not even compile.
And how do you know this part of the code is the cause of the crash?

arvEL. 12-22-2015 17:36

Re: [HELP] fix nightmare mode!
 
1 Attachment(s)
Quote:

Originally Posted by wickedd (Post 2375283)
If you want help then post the correct code, because that code will not even compile.
And how do you know this part of the code is the cause of the crash?

well i used this

arvEL. 12-23-2015 07:16

Re: [SOLVED] fix nightmare mode!
 
solved.
i used other codes.


All times are GMT -4. The time now is 17:56.

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