AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Error: Number of arguments does not match definition on line 606 (https://forums.alliedmods.net/showthread.php?t=128911)

HLM 06-06-2010 18:33

Error: Number of arguments does not match definition on line 606
 
PHP Code:

new szPlayer pev(pFlagpev_aiment);

// a bunch of code through here, all the stuff matches and is correct, trus me.

AddHealthCheckMax(szPlayer50.0); 

PHP Code:

// adds health, not exceeding max, returns 1 if any health was added
AddHealthCheckMax(pEntity, const Float:iValue)
{
    
// raise us to max health, don't reduce health if health is above max (from medic boost)
    
if(entity_get_float(pEntityEV_FL_health) < entity_get_float(pEntityEV_FL_max_health))
    {
        
//pEntity->v.health = min(pEntity->v.max_health, pEntity->v.health + iValue);
        
entity_set_float(pEntityEV_FL_healthfloatmin(entity_get_float(pEntityEV_FL_health), (entity_get_float(pEntityEV_FL_health) + iValue)) )
        return 
true;
    }
    else
        return 
false;
    return 
pEntity;



fysiks 06-06-2010 22:03

Re: Error: Number of arguments does not match definition on line 606
 
Are you sure that's the function that is causing this? I compile it just fine.

FYI,

Do NOT use the prefix "sz" for something that is not a string. It makes your code extremely confusing! "sz" means "string, zero-terminated"

Your function should be tagged according to your return value. When you return true or false your function is a bool. AND, all your return values should be of the same type.

Unreachable code:

PHP Code:

    return pEntity


HLM 06-06-2010 22:08

Re: Error: Number of arguments does not match definition on line 606
 
I will look through it again and recode it, but as for the returning lines, I dont trule "need" a return value, since it goes ahead and does what it needs to do anyways, the return was something I just included while converting from C++ -> Small, I will probably be removing it, and I guess I need to go through and fix the warnings and check the lines before going to the errors, I dont know.. maybe ill figure it out, lol.


All times are GMT -4. The time now is 05:18.

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