AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   cs_get_user_team/cs_get_user_model problems.. (https://forums.alliedmods.net/showthread.php?t=295977)

D3XT3R 04-09-2017 13:49

cs_get_user_team/cs_get_user_model problems..
 
Hi Ther, i have problem been show me in logs with those codes...
log:
Quote:

L 04/09/2017 - 20:23:02: [CSTRIKE] Invalid player 7
L 04/09/2017 - 20:23:02: [AMXX] Displaying debug trace (plugin "test.amxx", version "6.0")
L 04/09/2017 - 20:23:02: [AMXX] Run time error 10: native error (native "cs_get_user_team")
L 04/09/2017 - 20:23:02: [AMXX] [0] test.sma::changeTeam (line 2135)
code:
PHP Code:

public changeTeamid )
{
    switch( 
cs_get_user_teamid ) )
    {
        case 
CS_TEAM_CTcs_set_user_teamidCS_TEAM_T );
        case 
CS_TEAM_Tcs_set_user_teamidCS_TEAM_CT );
    }

    
round_count 0;


and this other line
log:
Quote:

L 04/09/2017 - 18:39:01: [CSTRIKE] Invalid player 6
L 04/09/2017 - 18:39:01: [AMXX] Displaying debug trace (plugin "test.amxx", version "6.0")
L 04/09/2017 - 18:39:01: [AMXX] Run time error 10: native error (native "cs_set_user_model")
L 04/09/2017 - 18:39:01: [AMXX] [0] test.sma::fm_set_user_model (line 2188)
L 04/09/2017 - 18:39:01: [AMXX] [1] test.sma::changeModel (line 1185)
code of line 1185
PHP Code:

public changeModel(id)
{
    
//log_to_file(g_logfile, "changeModel(%d) = START", id);
    
fm_set_user_model(idg_zombie_models[iClass[id]]);
    
//log_to_file(g_logfile, "changeModel(%d) = END", id);


code of line 2188:
PHP Code:

stock fm_set_user_model(playermodelname[])
{
    
cs_set_user_model(playermodelname);
    
g_model[player] = true;



D3XT3R 04-09-2017 13:51

Re: cs_get_user_team/cs_get_user_model problems..
 
PS: i noticed when players spawn some of them have default models not changed ones from the plugin.

edon1337 04-09-2017 13:54

Re: cs_get_user_team/cs_get_user_model problems..
 
Add is_user_connected(id).

D3XT3R 04-09-2017 13:57

Re: cs_get_user_team/cs_get_user_model problems..
 
should be add to if user is alive with it to slove this bug?

edon1337 04-09-2017 14:57

Re: cs_get_user_team/cs_get_user_model problems..
 
Quote:

Originally Posted by edon1337 (Post 2510691)
Add is_user_connected(id).


D3XT3R 04-10-2017 14:42

Re: cs_get_user_team/cs_get_user_model problems..
 
problem compile -_-
agrument miss match (agrumment 2)
in lines whitch i add is_user_connected(id)

EFFx 04-10-2017 14:52

Re: cs_get_user_team/cs_get_user_model problems..
 
Code:
public changeTeam( id ) {     if(is_user_connected(id))     {         switch( cs_get_user_team( id ) )         {             case CS_TEAM_CT: cs_set_user_team( id, CS_TEAM_T );             case CS_TEAM_T: cs_set_user_team( id, CS_TEAM_CT );         }     }     round_count = 0; }

edon1337 04-10-2017 15:28

Re: cs_get_user_team/cs_get_user_model problems..
 
Quote:

Originally Posted by D3XT3R (Post 2511013)
problem compile -_-
agrument miss match (agrumment 2)
in lines whitch i add is_user_connected(id)

It's not my fault that you can't add a single check..

Natsheh 04-10-2017 17:30

Re: cs_get_user_team/cs_get_user_model problems..
 
It depends on when you calling the function , if the client is not ingame should send an error.

Btw show us how you storing data in the models array


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

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