AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   about amx_ejl_missiles.sma (https://forums.alliedmods.net/showthread.php?t=6249)

ol 09-25-2004 11:55

about amx_ejl_missiles.sma
 
1 Attachment(s)
i convered it to amxx0.2,and compile it very nice.but when i run it on amxx 0.2 rc6(debug) ,i get some error info:

L 09/25/2004 - 23:36:17: [Engine] Invalid Entity 0 ("cstrike\addons\amxmodx\plugins\amx_ejl_miss iles.amxx", line 454)


who can fix it?

jtp10181 09-25-2004 13:12

I will be posritng all my plugins to amxmodx 0.20 soon.

to fix that error just add a simple check

if the ent id is 0 then return (or stop doing whatever itsa doing)

ol 09-26-2004 02:14

how to do it?

can you fix it and upload it for me?

breaddawson 09-27-2004 07:39

Quote:

Originally Posted by jtp10181
I will be posritng all my plugins to amxmodx 0.20 soon.

to fix that error just add a simple check

if the ent id is 0 then return (or stop doing whatever itsa doing)

yes,u r right
i run it in debug mode
and found it's all about "new id = entity_get_edict(iCurrent, EV_ENT_owner)"
and the id was 0
amx x said that
Code:

" [Engine] Invalid Entity 0 ("cstrike\addons\amxmodx\plugins\missiles.amxx", line 2182)"
"[AMXX] Run time error 10 (native) on line 2182 (file "F:\Cs1.6\cstrike\addons\amxmodx\scripting\missiles.sma")."

what should i do 2 fix it?
just delete the symbol "id"??
what's the purpose of the function"entitiy_get_edict"
i found it in the "engine.inc"

maybe u can get the id of one entity ?
and if the id is 0
amxx will tell u there's one mistake happening

i'm a newbie in AMX X scriping :oops:

breaddawson 09-27-2004 10:06

i've "fixed" that
but i don't know whether this fix by me is correct

Code:

while ((iCurrent = find_ent_by_class(-1, "lud_missile")) !=-1){

                new id = entity_get_edict(iCurrent, EV_ENT_owner)       

                remove_missile(id,iCurrent)
        }

i thought maybe the error was because "iCurrent" is 0
so i changed"while ((iCurrent = find_ent_by_class(-1, "lud_missile")) !=-1)" to "while ((iCurrent = find_ent_by_class(-1, "lud_missile")) !=0)"

then the error messages were gone

another error in line 429 was fixed like this
Code:

entity_get_string(pToucher, EV_SZ_classname, szClassName, 31)
i changed it to

Code:

        if (pToucher!=0)
        {
                entity_get_string(pToucher, EV_SZ_classname, szClassName, 31)
        }

the modified missiles.sma is in the attachment
so if u wish,u can test it whether it worked well


Edit:the attachment once here was removed (20041003)

ol 09-27-2004 11:49

thk it work fine

but , missile info in menu is not work

plz have a look


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

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