AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   I'll reference your memory in a minute! (https://forums.alliedmods.net/showthread.php?t=2572)

rompom7 06-09-2004 03:15

I'll reference your memory in a minute!
 
1 Attachment(s)
Hello, I am working on a plugin but when ever I try to compile it I get an error in the command window

Quote:

The instruction at 0x0041c40a referenced memory at 0x00000008.
The memory could not be read.
It puts the .amx file in the compiled folder but it is an empty file (0kb).

Is this some kind of newb scripting effort? Or is it something wrong with the compiler.

I attached that .sma, like I said, i am a newb at this so don't laugh :)

BAILOPAN 06-09-2004 04:27

1: The compiler shouldn't crash, looks like a bug :] (00000008 is invalid memory).

You can't do things like this:
Code:
textid("[WarBot] Changed your name to " + name + " [L]",id)

String addition doesn't work because they are character arrays. It must be this:
Code:
new temp[128] format(temp, 128, "[Warbot] Changed your name to %s [L]", name) textid(temp, id)

Also, unless you reference your helper functions in other places like this:
set_task(... "textid"...) or register_event(..."textid") etc
They shouldn't be public.

rompom7 06-09-2004 04:36

Thanks for your help BAILOPAN. I did string addition because of my old pascal days :)

and yes I am going to use the set_task function, but thanks anyway :)

[FBX] 06-09-2004 06:41

adding a string class would be rather handy...

BAILOPAN 06-09-2004 06:57

Adding random things like this into a language set is no easy task. While we have thought of making a string tag and attaching properties to it, it would be a separate "string engine" and we'd need to run a separate (or the given) garbage collector for AMX (I think).

Maybe for HL2 ;]

rompom7 06-09-2004 07:24

Woah. I hadn't even thought about AMX-X for HL2.


All times are GMT -4. The time now is 14:41.

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