AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Many errors. . . Anyone could help? (https://forums.alliedmods.net/showthread.php?t=90274)

speed4weed 04-16-2009 00:39

Many errors. . . Anyone could help?
 
/fixed

Hunter-Digital 04-16-2009 06:38

Re: Many errors. . . Anyone could help?
 
1 Attachment(s)
PHP Code:

public RoundStart()
// ...
        
if(player_class[i] == Necromancer)
            
g_haskit[i]=1
        
else
            
g_haskit[i]=

defines, variables, etc are case sensitive ! you defined "Necromancer" as "NECROMANCER", also for Ninja, Paladin, and the rest of the classes, all fixed.

and also a function:
PHP Code:

public paladin(id){
    
showitem(id,"Paladin"," "," ","<br>Starts with 125hp and can cast Long Jump.<br> <br><br>")


this returned error when you called it Paladin(id) because it's named "paladin"... fixed

The loose indentation errors are caused by the code alignment errors, it does matter how the code is aligned.

PHP Code:

public award_plant()
{
    new 
Players[32], playerCountid
    get_players
(PlayersplayerCount"aeh""TERRORIST"
        
    for (new 
i=0i<playerCounti++) 
    {
        
id Players[i
        
Give_Xp(id,get_cvar_num("diablo_xpbonus"))    
        
client_print(id,print_chat,"You gained *%i* experience for bomb plant",get_cvar_num("diablo_xpbonus"))
    }    
        
Give_Xp(planter,get_cvar_num("diablo_xpbonus2"))


Give_Xp() is away from alignement as you can see... fixed :)


The:
error 017: undefined symbol "n"
error 029: invalid expression, ass
error 017: undefined symbol "w7"
fatal error 107: too many error messages on one line

errors are caused by a misplaced " in here:
PHP Code:

    format(text512"\ySelect Class - ^n\w1. Sorcerer [Increased effect of spells]^n\w2. Paladin [Bonus to strength]^n\w3. Monk [More Experienced gained]^n\w4. Assassin [Faster and no footsteps]^n\w5. Barbarian [Regain hitpoint upon kill]^n\w6. Necromancer [Returns some of the damage taken]"^n\w7Ninja [Fasthas only a knife and is invisible]") 

if you can see after the necromancer :) fixed.

another "error"...
PHP Code:

        case 5
        {    
            
player_class[id] = NECROMANCER
            g_haskit
[id] = 1
        
}
        case 
6
        {    
            
player_class[id] = NINJA
    


Don't forget the { and }'s ... if you have only one option you don't need them at all. fixed.

Compiles succesfully, don't know if any of your code actually works but that's your job :P sma attached.

speed4weed 04-16-2009 11:02

Re: Many errors. . . Anyone could help?
 
1 Attachment(s)
Alright i fixed it up, and it compiles perfectly now, i just get this annoying message and it causes no classes to work, How can i fix this?

Message:
Code:

L 04/16/2009 - 10:55:52: Plugin called message_begin with an invalid message id (0).
L 04/16/2009 - 10:55:52: [AMXX] Run time error 10 (plugin "dbmod_5.4h.amxx") (native "message_begin") - debug not enabled!
L 04/16/2009 - 10:55:52: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).

And when i put debug it goes
Code:

L 04/16/2009 - 10:52:15: [AMXX] Run time error 10: native error (native "message_begin")
L 04/16/2009 - 10:52:15: [AMXX]    [0] dbmod_5.4h.sma::write_hud (line 1364)
L 04/16/2009 - 10:52:15: [AMXX]    [1] dbmod_5.4h.sma::CurWeapon (line 765)
L 04/16/2009 - 10:52:27: Plugin called message_begin with an invalid message id (0).
L 04/16/2009 - 10:52:27: [AMXX] Displaying debug trace (plugin "dbmod_5.4h.amxx")
L 04/16/2009 - 10:52:27: [AMXX] Run time error 10: native error (native "message_begin")
L 04/16/2009 - 10:52:27: [AMXX]    [0] dbmod_5.4h.sma::show_deadmessage (line 1153)

L 04/16/2009 - 10:52:27: [AMXX]    [1] dbmod_5.4h.sma::DeathMsg (line 850)
L 04/16/2009 - 10:52:27: Plugin called message_begin with an invalid message id (0).
L 04/16/2009 - 10:52:27: [AMXX] Displaying debug trace (plugin "dbmod_5.4h.amxx")

Could anyone help me?

YamiKaitou 04-16-2009 11:50

Re: Many errors. . . Anyone could help?
 
On line 1375, change
PHP Code:

    for (new id=0id 32id++) 

to
PHP Code:

    for (new id=1id <= g_maxplayersid++) 

Then, add this
PHP Code:

new g_maxplayers;
[...]
public 
plugin_init()
{
    [...]
    
g_maxplayers get_maxplayers();
    [...]



speed4weed 04-16-2009 12:10

Re: Many errors. . . Anyone could help?
 
1 Attachment(s)
/fixed


All times are GMT -4. The time now is 02:24.

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