Raised This Month: $ Target: $400
 0% 

Does Any one know how to convert amxmod sma/plugins to amxx


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
puchi967
New Member
Join Date: Aug 2005
Location: New York, NY
Old 11-07-2005 , 23:34   Does Any one know how to convert amxmod sma/plugins to amxx
Reply With Quote #1

Does Any one know how to convert amxmod sma/plugins to amxx
puchi967 is offline
Send a message via AIM to puchi967 Send a message via Yahoo to puchi967
joka69
Senior Member
Join Date: Apr 2005
Old 11-07-2005 , 23:39  
Reply With Quote #2

Use the online compiler www.amxmodx.org If it dosent compile post the .sma here and il try to port it.
__________________
joka69 is offline
Send a message via MSN to joka69
puchi967
New Member
Join Date: Aug 2005
Location: New York, NY
Old 11-08-2005 , 00:06   Convert this one
Reply With Quote #3

#include <translator>
#include <amxmod>


new count_puke[33]
new boolukeFlag[33]
new bool:aim[33]
new counter[33]
#if !defined NO_CS_CZ
new player_origins[33][3]
#endif

public puke_on_player(id)
{

if (get_cvar_num("amx_maxpukes")==0)
return PLUGIN_HANDLED
if (!is_user_alive(id))
return PLUGIN_HANDLED
if ( (get_cvar_num("amx_puke_admin")==1) && !(get_user_flags(id) & ADMIN_LEVEL_A) )
{
console_print(id, _T("[AMX] You have not access to this command."))
return PLUGIN_HANDLED
}
if(PukeFlag[id])
return PLUGIN_HANDLED

#if !defined NO_CS_CZ
new player_origin[3], players[32], inum=0, dist, last_dist=99999, last_id

get_user_origin(id,player_origin,0)
get_players(players,inum,"b")
if (inum>0) {
for (new i=0;i<inum;i++) {
if (players[i]!=id) {
dist = get_distance(player_origin,player_origins[players[i]])
if (dist<last_dist) {
last_id = players[i]
last_dist = dist
}
}
}
if (last_dist<80) {
#endif
if (count_puke[id] > get_cvar_num("amx_maxpukes")) {
client_print(id,print_chat,_T("You can only puke on a player %d time(s) in a round !", id), get_cvar_num("amx_maxpukes"))
return PLUGIN_CONTINUE
}
new player_name[32]
get_user_name(id, player_name, 31)
#if !defined NO_CS_CZ
new dead_name[32]
get_user_name(last_id, dead_name, 31)
client_print(0,print_chat,_T("%s Is Puking On %s's Dead Body !! HaHaHaHa !!", id), player_name, dead_name)
#else
client_print(0,print_chat,_T("%s Is Puking !!", id), player_name)
#endif
count_puke[id]+=1
new ids[1]
ids[0]=id
PukeFlag[id]=true
aim[id]=false
counter[id]=0
new rand_sound=random_num(0,1)
switch(rand_sound)
{
case 0: emit_sound(id, CHAN_VOICE, "puke/puke.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
case 1: emit_sound(id, CHAN_VOICE, "puke/puke2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
}
set_task(0.3,"make_puke",2412+id,ids,1,"a",9)
#if !defined NO_CS_CZ
}
else
{
client_print(id,print_chat,_T("There are no dead bodies around you."))
return PLUGIN_HANDLED
}
}
#endif
return PLUGIN_HANDLED
}

public sqrt(num)
{
new div = num
new result = 1
while (div > result) {
div = (div + result) / 2
result = num / div
}
return div
}

public make_puke(ids[])
{
new id=ids[0]
new vec[3]
new aimvec[3]
new velocityvec[3]
new length
get_user_origin(id,vec, 1)
get_user_origin(id,aimvec,3)
new distance = get_distance(vec,aimvec)
new speed = floatround(distance*1.9)

velocityvec[0]=aimvec[0]-vec[0]
velocityvec[1]=aimvec[1]-vec[1]
velocityvec[2]=aimvec[2]-vec[2]

length=sqrt(velocityvec[0]*velocityvec[0]+velocityvec[1]*velocityvec[1]+velocityvec[2]*velocityvec[2])

velocityvec[0]=velocityvec[0]*speed/length
velocityvec[1]=velocityvec[1]*speed/length
velocityvec[2]=velocityvec[2]*speed/length

message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(101)
write_coord(vec[0])
write_coord(vec[1])
write_coord(vec[2]-2)
write_coord(velocityvec[0])
write_coord(velocityvec[1])
write_coord(velocityvec[2])
write_byte(82) // color
write_byte(160) // speed
message_end()

counter[id]++
if(counter[id]==9)
PukeFlag[id]=false

}

public death_event()
{
new victim = read_data(2)
#if !defined NO_CS_CZ
get_user_origin(victim,player_origins[victim],0)
#endif

if(PukeFlag[victim])
reset_puke(victim)

return PLUGIN_CONTINUE
}

public reset_puke(id)
{
if(task_exists(2412+id))
remove_task(2412+id)
emit_sound(id,CHAN_VOICE,"puke/puke.wav", 0.0, ATTN_NORM, 0, PITCH_NORM)
PukeFlag[id]=false

return PLUGIN_CONTINUE
}

public reset_hud(id)
{
if(task_exists(2412+id))
remove_task(2412+id)
emit_sound(id,CHAN_VOICE,"puke/puke.wav", 0.0, ATTN_NORM, 0, PITCH_NORM)
PukeFlag[id]=false

count_puke[id]=1

return PLUGIN_CONTINUE
}

public puke_help(id)
{
client_print(id, print_chat, _T("To puke on a dead body you have to bind a key to: puke"))
client_print(id, print_chat, _T("Open your console and write: bind ^"key^" ^"puke^""))
client_print(id, print_chat, _T("ex: bind ^"x^" ^"puke^""))

return PLUGIN_CONTINUE
}

public handle_say(id)
{
new said[192]
read_args(said,192)
remove_quotes(said)

if( ((containi(said, "puke") != -1) && !(containi(said, "/puke") != -1))
|| ((containi(said, "vomir") != -1) && !(containi(said, "/vomir") != -1)) )
{
client_print(id, print_chat, _T("[AMX] For Puke help say /puke"))
}

return PLUGIN_CONTINUE
}

public plugin_precache()
{
if (file_exists("sound/puke/puke.wav"))
precache_sound("puke/puke.wav")
if (file_exists("sound/puke/puke2.wav"))
precache_sound("puke/puke2.wav")

return PLUGIN_CONTINUE
}

public client_connect(id)
{
PukeFlag[id]=false
count_puke[id]=1

return PLUGIN_CONTINUE
}

public client_disconnect(id)
{
reset_hud(id)

return PLUGIN_CONTINUE
}

public plugin_init()
{
load_translations( "puke" )
register_plugin("AMX Puke","0.2","KRoTaL")
register_clcmd("puke","puke_on_player",0,_T("- Puke on a dead player"))
register_clcmd("vomir","puke_on_player",0,_T( "- Puke on a dead player"))
register_clcmd("say /puke","puke_help",0,_T("- Displays puke help"))
register_clcmd("say /vomir","puke_help",0,_T("- Displays puke help"))
register_clcmd("say","handle_say")
register_cvar("amx_maxpukes","6")
register_cvar("amx_puke_admin","0")
register_event("DeathMsg","death_event","a")
register_event("ResetHUD", "reset_hud", "be")

return PLUGIN_CONTINUE
}
puchi967 is offline
Send a message via AIM to puchi967 Send a message via Yahoo to puchi967
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 11-08-2005 , 00:43  
Reply With Quote #4

All you had to do was change the translator stuff and whatnot.. Anywho, I'm going to PM you the code since I'm not sure if this plugin is allowed here ;]
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
haimmaik
Senior Member
Join Date: Jul 2005
Old 11-08-2005 , 08:00  
Reply With Quote #5

fix ur includes...
Code:
#include <amxmod>
should be

Code:
#include <amxmodx>
and im not sure that there is <translator> in amxmodx...
so find the right include
haimmaik is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 11-08-2005 , 10:28  
Reply With Quote #6

No, there's no translator in AMXX.

You need to remove the translator stuff from the client_print functions.

For example, I took this line:
Code:
 client_print(0,print_chat,_T("%s Is Puking On %s's Dead Body !! HaHaHaHa !!", id), player_name, dead_name)
And removed some stuff and got this:
Code:
 client_print(0,print_chat,"%s Is Puking On %s's Dead Body !! HaHaHaHa !!", player_name, dead_name)
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 11-08-2005 , 17:51  
Reply With Quote #7

http://xthost.info/Hawk552/C++/illegal_ports/
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
joka69
Senior Member
Join Date: Apr 2005
Old 11-08-2005 , 18:12  
Reply With Quote #8

LOL hawk them plugins are funny
__________________
joka69 is offline
Send a message via MSN to joka69
chRm
Senior Member
Join Date: Sep 2005
Location: Cyprus
Old 11-09-2005 , 08:10  
Reply With Quote #9

Try this, ported it, compiles with no errors but not tested..

Posting in small :

Code:
#include <amxmodx> new count_puke[33] new bool:PukeFlag[33] new bool:aim[33] new counter[33] #if !defined NO_CS_CZ new player_origins[33][3] #endif public puke_on_player(id) { if (get_cvar_num("amx_maxpukes")==0) return PLUGIN_HANDLED if (!is_user_alive(id)) return PLUGIN_HANDLED if ( (get_cvar_num("amx_puke_admin")==1) && !(get_user_flags(id) & ADMIN_LEVEL_A) ) { console_print(id,"[AMX] You have not access to this command.") return PLUGIN_HANDLED } if(PukeFlag[id]) return PLUGIN_HANDLED #if !defined NO_CS_CZ new player_origin[3], players[32], inum=0, dist, last_dist=99999, last_id get_user_origin(id,player_origin,0) get_players(players,inum,"b") if (inum>0) { for (new i=0;i<inum;i++) { if (players[i]!=id) { dist = get_distance(player_origin,player_origins[players[i]]) if (dist<last_dist) { last_id = players[i] last_dist = dist } } } if (last_dist<80) { #endif if (count_puke[id] > get_cvar_num("amx_maxpukes")) { client_print(id,print_chat,"You can only puke on a player %d time(s) in a round !", get_cvar_num("amx_maxpukes")) return PLUGIN_CONTINUE } new player_name[32] get_user_name(id, player_name, 31) #if !defined NO_CS_CZ new dead_name[32] get_user_name(last_id, dead_name, 31) client_print(0,print_chat,"%s Is Puking On %s's Dead Body !! HaHaHaHa !!", player_name, dead_name) #else client_print(0,print_chat,"%s Is Puking !!" player_name) #endif count_puke[id]+=1 new ids[1] ids[0]=id PukeFlag[id]=true aim[id]=false counter[id]=0 new rand_sound=random_num(0,1) switch(rand_sound) { case 0: emit_sound(id, CHAN_VOICE, "puke/puke.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) case 1: emit_sound(id, CHAN_VOICE, "puke/puke2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) } set_task(0.3,"make_puke",2412+id,ids,1,"a",9) #if !defined NO_CS_CZ } else { client_print(id,print_chat,"There are no dead bodies around you.") return PLUGIN_HANDLED } } #endif return PLUGIN_HANDLED } public sqrt(num) { new div = num new result = 1 while (div > result) { div = (div + result) / 2 result = num / div } return div } public make_puke(ids[]) { new id=ids[0] new vec[3] new aimvec[3] new velocityvec[3] new length get_user_origin(id,vec, 1) get_user_origin(id,aimvec,3) new distance = get_distance(vec,aimvec) new speed = floatround(distance*1.9) velocityvec[0]=aimvec[0]-vec[0] velocityvec[1]=aimvec[1]-vec[1] velocityvec[2]=aimvec[2]-vec[2] length=sqrt(velocityvec[0]*velocityvec[0]+velocityvec[1]*velocityvec[1]+velocityvec[2]*velocityvec[2]) velocityvec[0]=velocityvec[0]*speed/length velocityvec[1]=velocityvec[1]*speed/length velocityvec[2]=velocityvec[2]*speed/length message_begin(MSG_BROADCAST,SVC_TEMPENTITY) write_byte(101) write_coord(vec[0]) write_coord(vec[1]) write_coord(vec[2]-2) write_coord(velocityvec[0]) write_coord(velocityvec[1]) write_coord(velocityvec[2]) write_byte(82) // color write_byte(160) // speed message_end() counter[id]++ if(counter[id]==9) PukeFlag[id]=false } public death_event() { new victim = read_data(2) #if !defined NO_CS_CZ get_user_origin(victim,player_origins[victim],0) #endif if(PukeFlag[victim]) reset_puke(victim) return PLUGIN_CONTINUE } public reset_puke(id) { if(task_exists(2412+id)) remove_task(2412+id) emit_sound(id,CHAN_VOICE,"puke/puke.wav", 0.0, ATTN_NORM, 0, PITCH_NORM) PukeFlag[id]=false return PLUGIN_CONTINUE } public reset_hud(id) { if(task_exists(2412+id)) remove_task(2412+id) emit_sound(id,CHAN_VOICE,"puke/puke.wav", 0.0, ATTN_NORM, 0, PITCH_NORM) PukeFlag[id]=false count_puke[id]=1 return PLUGIN_CONTINUE } public puke_help(id) { client_print(id, print_chat,"To puke on a dead body you have to bind a key to: puke") client_print(id, print_chat,"Open your console and write: bind ^"key^" ^"puke^"") client_print(id, print_chat,"ex: bind ^"x^" ^"puke^"") return PLUGIN_CONTINUE } public handle_say(id) { new said[192] read_args(said,192) remove_quotes(said) if( ((containi(said, "puke") != -1) && !(containi(said, "/puke") != -1)) || ((containi(said, "vomir") != -1) && !(containi(said, "/vomir") != -1)) ) { client_print(id, print_chat,"[AMX] For Puke help say /puke") } return PLUGIN_CONTINUE } public plugin_precache() { if (file_exists("sound/puke/puke.wav")) precache_sound("puke/puke.wav") if (file_exists("sound/puke/puke2.wav")) precache_sound("puke/puke2.wav") return PLUGIN_CONTINUE } public client_connect(id) { PukeFlag[id]=false count_puke[id]=1 return PLUGIN_CONTINUE } public client_disconnect(id) { reset_hud(id) return PLUGIN_CONTINUE } public plugin_init() { //load_translations( "puke" ) register_plugin("AMX Puke","0.2","KRoTaL") register_clcmd("puke","puke_on_player",0,("- Puke on a dead player")) register_clcmd("vomir","puke_on_player",0,("- Puke on a dead player")) register_clcmd("say /puke","puke_help",0,("- Displays puke help")) register_clcmd("say /vomir","puke_help",0,("- Displays puke help")) register_clcmd("say","handle_say") register_cvar("amx_maxpukes","6") register_cvar("amx_puke_admin","0") register_event("DeathMsg","death_event","a") register_event("ResetHUD", "reset_hud", "be") return PLUGIN_CONTINUE }
__________________
This signature is going to self destruct in: <countdown coming soon>




Previously known as Panais
chRm is offline
Send a message via MSN to chRm
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 11-09-2005 , 15:43  
Reply With Quote #10

Quote:
Originally Posted by v3x
All you had to do was change the translator stuff and whatnot.. Anywho, I'm going to PM you the code since I'm not sure if this plugin is allowed here ;]
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:05.


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