AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Converting AMX to AMXX (https://forums.alliedmods.net/showthread.php?t=9638)

Chester 01-25-2005 21:44

Converting AMX to AMXX
 
I was wondering if there was anyway of converting an AMX file to an AMXX file without rewriting it? If not, how do you do it?

XxAvalanchexX 01-25-2005 22:22

a) Change any hard-coded paths that lead to the "addons/amx/" directory so that they lead to the "addons/amxmodx/" directory, and change any file names that AMX may have used that AMXx doesn't.

b) Compile.

AMX scripts should compile fine with AMXx. If you REALLY want to "convert" it, then change the "#include <amxmod>" to "#include <amxmodx>" and "#include <VexdUM>" to "#include <engine>", and change all the old function names to the new ones.

Chester 01-25-2005 22:25

what are the new ones and old ones?
edit: also, some of the .sma's dont lead to the directory .../amx. Im a little confused.

Also, to make sure im doing everything right, do i edit the .sma file or .amx file?

XxAvalanchexX 01-25-2005 23:32

I doubt you will find any that have a hard-coded path to the amx directory, that was a just-in-case thing. You will need to edit the sma files, as that is the source file. If you change amxmod to amxmodx and compile, it will might you "unknown function so-and-so" errors, in which case you change those functions to the new ones.

Chester 01-25-2005 23:42

oh ok. Yeah, i got that error a couple times.

What are the new and old functions?

Twilight Suzuka 01-26-2005 00:18

Look them up in the include files....

Chester 01-28-2005 20:10

im asuming these are them:
Core
Fun
Engine
Cstrike
SQL
NS
DoDX
TFCX
GeoIP
Sockets
Array
DoDFun
Fakemeta
Regex

Although i still have no idea what this means...
I mean, it doesnt tell me what ones to replace...
it just gives me the link..

Can you explain step-by-step how to convert it?

XxAvalanchexX 01-28-2005 22:20

user_spawn to spawn
get_user_money to cs_get_user_money
set_user_money to cs_set_user_money
numtostr to num_to_str
strtonum to str_to_num
Entvars_Get_Int to entity_get_int
Entvars_Set_Int to entity_set_int
Entvars_Get_Float to entity_get_float
Entvars_Set_Float to entity_set_float
Entvars_Get_Vector to entity_get_vector
Entvars_Set_Vector to entity_set_vector
Entvars_Get_Edict to entity_get_edict
Entvars_Set_Edict to entity_set_edict
Entvars_Get_String to entity_get_string
Entvars_Set_String to entity_set_string
Entvars_Get_Byte to entity_get_byte
Entvars_Set_Byte to entity_set_byte
CreateEntity to create_entity
ENT_SetModel to entity_set_model
ENT_SetOrigin to entity_set_origin
FindEntity to find_ent_by_class
RemoveEntity to remove_entity
TraceLn to trace_line
VecToAngles to vector_to_angle
VecLength to vector_length
VecDist to vector_distance
MessageBlock to set_msg_block
GetMessageBlock to get_msg_block
HLTime to halflife_time
FakeTouch to fake_touch
AttachView to attach_view
SetView to set_view
SetSpeak to set_speak

Chester 01-28-2005 22:54

ok i replaced all those, now is that all i do to the .sma file?

edit: im getting this:

Code:

/home/users/amxmodx/tmp/php0yzpiq.sma(345) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(346) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(347) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(348) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(349) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(350) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(351) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(352) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(353) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(354) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(356) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(357) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(358) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(359) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(360) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(361) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(362) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(363) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(364) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(365) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(366) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(367) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(368) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(369) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(370) : error 017: undefined symbol "strtonum"
/home/users/amxmodx/tmp/php0yzpiq.sma(371) : error 017: undefined symbol "strtonum"


TotalNoobScripter 01-28-2005 23:21

str_to_num


All times are GMT -4. The time now is 19:23.

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