AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   error 035: argument type mismatch (argument 1) (https://forums.alliedmods.net/showthread.php?t=325238)

supertrio17 06-13-2020 11:27

error 035: argument type mismatch (argument 1)
 
Hey, so I want to make class plugin, and I want to remember which class member had when they leave the server. I wanted to use nVault, but for some reason it gives me this error.

Here is my code
PHP Code:

public rank_ten_c_one(id//Samurai
{
    
get_user_authidid g_szAuthID[id] , charsmaxg_szAuthID[] ) );

    new 
szClass;
    new 
szKey[40];

    
formatexszKey charsmaxszKey ) , "%sCLASS" g_szAuthID[id] );
    
formatexszClass charsmaxszClass ) , %g_Class );
    
    
nvault_setg_Vault szKey szClass );

    
set_user_health(id110);
    
set_user_gravity(id1.2);


I use g_Vault to set integer for each class, Example: Assasin = 1, Wizard = 2 ....
And on client_authorized, I would read szClass value from nVault like this:

PHP Code:

public client_authorized(id)
{
    new 
szKey[40];
    
formatexszKey charsmaxszKey ) , "%sCLASS" g_szAuthID[id] );
    new 
iClass nvault_getg_Vault szKey );
    if( 
iClass )
    {
        switch(
iClass)
        {
            case 
1:
            {
                
set_user_health(id110);
                
set_user_gravity(id1.2);
            }
            case 
2:
            {
                
set_user_health(id120);
                
set_user_gravity(id1.3);
            }
            case 
3:
            {
                
set_user_health(id130);
                
set_user_gravity(id1.2);
            }
            case 
4:
            {
                
set_user_health(id130);
                
set_user_gravity(id1.2);
                
set_user_maxspeed(id1.5);
            }
            case 
5:
            {
                
set_user_health(id110);
                
set_user_gravity(id1.6);
                
set_user_maxspeed(id1.1);
            }
            case 
6:
            {
                
set_user_health(id190);
                
set_user_gravity(id0.8);
                
set_user_maxspeed(id0.8);
            }
        }
    }



iceeedr 06-13-2020 11:30

Re: error 035: argument type mismatch (argument 1)
 
PHP Code:

formatexszClass charsmaxszClass ) , %g_Class ); 

:arrow:

PHP Code:

formatexszClass charsmaxszClass ) , "%d"g_Class ); 


supertrio17 06-13-2020 11:36

Re: error 035: argument type mismatch (argument 1)
 
Doesn't work

mahbodsr 06-13-2020 11:38

Re: error 035: argument type mismatch (argument 1)
 
you have type error
you are formating a non-string variable
szClass should be string


PHP Code:

new szClass

:arrow:

PHP Code:

new szClass[X]; // put something instead of X 


supertrio17 06-13-2020 11:47

Re: error 035: argument type mismatch (argument 1)
 
Yeah, I'm stupid, I will tell you if it works...

supertrio17 06-13-2020 11:49

Re: error 035: argument type mismatch (argument 1)
 
Nope, doesn't work.

HamletEagle 06-13-2020 11:50

Re: error 035: argument type mismatch (argument 1)
 
Please post the actual error/issue, not only "doesn't work".

mahbodsr 06-13-2020 11:57

Re: error 035: argument type mismatch (argument 1)
 
your topic title is about argument type mismatch
and solution is above

so if you got any other errors post it not simply saying ok or doesnt work

supertrio17 06-13-2020 12:10

Re: error 035: argument type mismatch (argument 1)
 
No solution is not above, I already said that I am getting that same message again. That means that your "solution" doesn't work.

mahbodsr 06-13-2020 12:14

Re: error 035: argument type mismatch (argument 1)
 
guy u were formating/setting nvault by a non-string variable
so that was wrong and i told you the solution
now maybe you are getting error from other side or smthng
which line you got error from?

post your error and code completly


All times are GMT -4. The time now is 16:58.

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