AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   help me with amx->amxx compile (https://forums.alliedmods.net/showthread.php?t=10216)

meowlike 02-11-2005 22:27

help me with amx->amxx compile
 
Code:
/* * Enter and Leave Message *  v 0.2geo * *  by [MUPPETS] Gonzo *   <a href="mailto:[email protected]">[email protected]</a> * * some code was taken from * welcome_hudmsg by JustinHoMi * */   /* * Cvars: * amx_enter_message "%name% just entered %hostname%." * amx_leave_message "%name% just left %hostname%." * * If you are using csstats module then you may use * %rankpos% expression in amx_enter_message cvar. * */   #include <amxmod> #include <csstats> #include <geoip> public client_putinserver(id){    new param[34], len    param[0] = id    len = get_user_name(id,param[1],31)    set_task(2.0, "enter_msg", 0, param,len + 2)    return PLUGIN_CONTINUE }   public client_disconnect(id){    new param[34], len      param[0] = id    len = get_user_name(id, param[1], 31)    set_task(2.0, "leave_msg", 0, param, len + 2)      return PLUGIN_CONTINUE   }   public enter_msg(param[]) {      new message[192],hostname[64]    get_cvar_string("amx_enter_message", message, 191)    get_cvar_string("hostname", hostname, 63)      replace(message,191, "%hostname%", hostname)      if (cvar_exists("csstats_reset")){       new data[8], rankpos[8], pos       pos = get_user_stats(param[0],data,data)       numtostr(pos,rankpos,7)       replace(message, 191, "%rankpos%", rankpos)      }    if (cvar_exists("geoip_country")){       new ip[32], country[45]       get_user_ip(param[0],ip,31)       geoip_country(ip,country)       replace(message, 191, "%country%", country)      }    replace(message, 191, "%name%", param[1])    while(replace(message, 191, "\n", "^n")){}    set_hudmessage(0, 225, 0, 0.05, 0.55, 0, 6.0, 6.0, 0.5, 0.15, 3)      show_hudmessage(0, message)    return PLUGIN_CONTINUE }   public leave_msg(param[]) {    new message[192],hostname[64]    get_cvar_string("amx_leave_message", message, 191)      get_cvar_string("hostname", hostname, 63)      replace(message, 191, "%hostname%", hostname)      replace(message, 191, "%name%", param[1])      while(replace(message, 191, "\n", "^n")){}    set_hudmessage(0, 225, 0, 0.05, 0.55, 0, 6.0, 6.0, 0.5, 0.15, 3)      show_hudmessage(0, message)    return PLUGIN_CONTINUE   } public plugin_init() {     register_plugin("Enter-Leave Message","0.2","[MUPPETS] Gonzo")     return PLUGIN_CONTINUE   }

compile is ok, no problem, but when i put it in game, it's shows:

L 02/12/2005 - 11:23:52: [AMXX] Run time error 25 (parameter error) on line 63 (file "enter-leave_message.sma").
L 02/12/2005 - 11:23:52: String formatted incorrectly - parameter 3 (total 2)

plz help the newbie :twisted:

XxAvalanchexX 02-11-2005 22:51

Why don't you point out what line 63 is in your copy of the code. Also, the below seems useless:

Code:
while(replace(message, 191, "\n", "^n")){} // why not just do this? replace(message, 191, "\n", "^n")

Peli 02-11-2005 23:29

Wait , are you porting it to AMX Mod X? Then change the amx include.

meowlike 02-12-2005 08:05

Quote:

Originally Posted by XxAvalanchexX
Why don't you point out what line 63 is in your copy of the code. Also, the below seems useless:

Code:
while(replace(message, 191, "\n", "^n")){} // why not just do this? replace(message, 191, "\n", "^n")

i'm sorry, next time i'll keep eyes on that (newbie saysXD)

Quote:

Wait , are you porting it to AMX Mod X? Then change the amx include.
i changed the include to amxmodx, still ot this problem.
i go trying XxAvalanchexX's way, thanks guys

nightscreem 02-12-2005 08:11

and i think <csstats> should be <csx>
don't really know but try it

meowlike 02-12-2005 15:00

Quote:

Originally Posted by XxAvalanchexX
Why don't you point out what line 63 is in your copy of the code. Also, the below seems useless:

Code:
while(replace(message, 191, "\n", "^n")){} // why not just do this? replace(message, 191, "\n", "^n")

i follow your advance, but its still not working.
Quote:

L 02/13/2005 - 03:51:21: [AMXX] Run time error 25 (parameter error) on line 63 (file "enter-leave_message.sma").
L 02/13/2005 - 03:51:21: String formatted incorrectly - parameter 3 (total 2)
at least, the leave massage can shows currectly, only the join message can't. i doubt geoip is the prime criminal...

nightscreem i'll try it, later report

meowlike 02-12-2005 15:12

it's no use.still got same error
Quote:

L 02/13/2005 - 04:08:03: [AMXX] Run time error 25 (parameter error) on line 63 (file "enter-leave_message.sma"
).
L 02/13/2005 - 04:08:03: String formatted incorrectly - parameter 3 (total 2)
lol i m crazy Orz...

XxAvalanchexX 02-12-2005 15:54

Once again, what is line 63 in your copy of the code?

meowlike 02-12-2005 22:20

Quote:

Originally Posted by XxAvalanchexX
Once again, what is line 63 in your copy of the code?

oh... really sorry i forgot. :cry: if i make the same mistake next time, i'll never ask question over her lol

THIS is the line 63... sorry again..

Code:
   show_hudmessage(0, message)

XxAvalanchexX 02-12-2005 22:41

Try printing out the string with a console_print to see if it appears as it should or if something is wrong.


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

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