AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Run time error 10: native error (https://forums.alliedmods.net/showthread.php?t=26417)

Evaldas 04-01-2006 18:15

Run time error 10: native error
 
It's an old plugin, but it's converted and some thing like that. It works, but generates this log. Log is huge and up to 5Mb, so I would like to ask, where is the ploblem?

Code:

L 04/01/2006 - 10:39:44: [AMXX]    [0] snipers.sma::check_movement (line 86)
L 04/01/2006 - 10:39:44: [ENGINE] Invalid player 1 (not in-game)
L 04/01/2006 - 10:39:44: [AMXX] Displaying debug trace (plugin "snipers.amxx")
L 04/01/2006 - 10:39:44: [AMXX] Run time error 10: native error (native "entity_get_int")

Here is the part from line 79 to 96:

Code:
public check_movement(playerid[])     { /* tikriname žaidėjų judėjimą */     new id = playerid[0]     /* new Float:vector[3]     entity_get_vector(id, EV_VEC_velocity, vector)     FVecIVec(vector, velocityI) */         new flags = entity_get_int(id, EV_INT_flags)         if (!(flags & FL_ONGROUND))         { /* jei ore, nuimame skopą */         client_cmd(id,"lastinv;lastinv")         unscope_func(id)         return PLUGIN_HANDLED     }         return PLUGIN_HANDLED }

v3x 04-01-2006 18:24

Right after you create the id variable put this:
Code:
if(!is_user_alive(id))     return PLUGIN_HANDLED;
That will stop the rest of the function from being executed, thus eliminating the errors.

Evaldas 04-02-2006 06:47

Thank you for help. Plugin works great again.


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

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