Raised This Month: $ Target: $400
 0% 

Plugin needs fixing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
philman213
Member
Join Date: Feb 2005
Location: WA
Old 02-16-2005 , 01:13   Plugin needs fixing
Reply With Quote #1

Okay my current plugin, originally by SpaceDude doesnt want to work.
It went from a sma for amx, to a sma for amxx. I had to edit a included file from the vexd to just xtrafun. Okay so I compiled, it works, but gives me a warning. I ignore it. I get the amxx, and I put everything In the right place. I also know that my plugins.ini, and everything else should be setup correctly.

So I run my dedicated server on my computer and the server works, amxx works, but the grab command wont. Is there something wrong with my script?

http://www.intrinic.com/jedi_force_grab.sma
philman213 is offline
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 02-16-2005 , 06:59  
Reply With Quote #2

yhea the problem is
you have this
Quote:
#include <amxmod>
#include <amxmodx>
#include <xtrafun>
and it need to be this
Quote:
#include <amxmodx>
#include <xtrafun>
and download xtrafun from here
http://amxmod.net/forums/viewtopic.php?t=10714
__________________
- Bye bye!
nightscreem is offline
XxKpAznGuyxX
Senior Member
Join Date: Dec 2004
Location: EARTH!!
Old 02-16-2005 , 08:38  
Reply With Quote #3

need to change the <xtrafun> to cstrike or engine (forgot). you cann't have xtrafun module in AMXMODX.
__________________
24/7 Chicago Terror-8.9.2.120:27015
XxKpAznGuyxX is offline
Send a message via AIM to XxKpAznGuyxX Send a message via MSN to XxKpAznGuyxX
NiGHTFiRE
Senior Member
Join Date: Dec 2004
Location: Sweden
Old 02-16-2005 , 09:04   its
Reply With Quote #4

#include <xtrafun> is in AMXX #include <engine>
NiGHTFiRE is offline
Send a message via AIM to NiGHTFiRE Send a message via MSN to NiGHTFiRE
NiGHTFiRE
Senior Member
Join Date: Dec 2004
Location: Sweden
Old 02-16-2005 , 09:07   it
Reply With Quote #5

if you change that the code should be
Quote:
#include <amxmod>
#include <amxmodx>
#include <engine>

new grabbed[33]
new grablength[33]
new bool:grabmodeon[33]
new velocity_multiplier

public grabtask(parm[])
{
new id = parm[0]
new targetid, body
if (!grabbed[id])
{
get_user_aiming(id, targetid, body)
if (targetid)
{
set_grabbed(id, targetid)
}
}
if (grabbed[id])
{
new origin[3], look[3], direction[3], moveto[3], grabbedorigin[3], velocity[3], length

if (!is_user_alive(grabbed[id]))
{
release(id)
return
}

get_user_origin(id, origin, 1)
get_user_origin(id, look, 3)
get_user_origin(grabbed[id], grabbedorigin)

direction[0]=look[0]-origin[0]
direction[1]=look[1]-origin[1]
direction[2]=look[2]-origin[2]
length = get_distance(look,origin)
if (!length) length=1 // avoid division by 0

moveto[0]=origin[0]+direction[0]*grablength[id]/length
moveto[1]=origin[1]+direction[1]*grablength[id]/length
moveto[2]=origin[2]+direction[2]*grablength[id]/length

velocity[0]=(moveto[0]-grabbedorigin[0])*velocity_multiplier
velocity[1]=(moveto[1]-grabbedorigin[1])*velocity_multiplier
velocity[2]=(moveto[2]-grabbedorigin[2])*velocity_multiplier

set_user_velocity(grabbed[id], velocity)
}
}

public grab_toggle(id)
{
if (grabmodeon[id])
release(id)
else
grab(id)
return PLUGIN_HANDLED
}

public grab(id)
{
if (!(get_user_flags(id)&ADMIN_SLAY))
{
client_print(id,print_notify,"[AMX] You have no access to that command")
return PLUGIN_HANDLED
}
if (!grabmodeon[id])
{
new targetid, body
new parm[1]
parm[0] = id
velocity_multiplier = get_cvar_num("sv_grabforce")
grabmodeon[id]=true
set_task(0.1, "grabtask", 100+id, parm, 1, "b")
get_user_aiming(id, targetid, body)
if (targetid)
{
set_grabbed(id, targetid)
}
else
{
client_print(id,print_notify,"[AMX] Searching for a target")
}
}
return PLUGIN_HANDLED
}

public release(id)
{
if (!(get_user_flags(id)&ADMIN_SLAY))
{
client_print(id,print_notify,"[AMX] You have no access to that command")
return PLUGIN_HANDLED
}
if (grabmodeon[id])
{
grabmodeon[id]=false
if (grabbed[id])
{
new targname[32]
set_user_gravity(grabbed[id])
set_user_rendering(grabbed[id])
get_user_name(grabbed[id],targname,31)
client_print(id,print_notify,"[AMX] You have released %s", targname)
}
else
{
client_print(id,print_notify,"[AMX] No target found")
}
grabbed[id]=0
remove_task(100+id)
}
return PLUGIN_HANDLED
}

public spec_event(id)
{
new targetid = read_data(2)

if (targetid < 1 || targetid > 32)
return PLUGIN_CONTINUE

if (grabmodeon[id] && !grabbed[id])
{
set_grabbed(id, targetid)
}
return PLUGIN_CONTINUE
}

public set_grabbed(id, targetid)
{
new origin1[3], origin2[3], targname[32]
get_user_origin(id, origin1)
get_user_origin(targetid, origin2)
grabbed[id]=targetid
grablength[id]=get_distance(origin1,origin2)
set_user_gravity(targetid,0.001)
set_user_rendering(targetid,kRenderFxGlowShel l,10,145,245, kRenderNormal, 0)
get_user_name(targetid,targname,31)
client_print(id,print_notify,"[AMX] You have grabbed onto %s", targname)
}


public plugin_init()
{
register_plugin("Jedi Force Grab","1.1","SpaceDude")
register_cvar("sv_grabforce","8")
register_clcmd("grab_toggle","grab_toggle",AD MIN_SLAY,"press once to grab and again to release")
register_clcmd("+grab","grab",ADMIN_SLAY,"bin d a key to +grab")
register_clcmd("-grab","release",ADMIN_SLAY)
register_event("StatusValue","spec_event","be ","1=2")
}
I'm not sure though why amxmod is ni this.
NiGHTFiRE is offline
Send a message via AIM to NiGHTFiRE Send a message via MSN to NiGHTFiRE
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 02-16-2005 , 09:11  
Reply With Quote #6

you can use xtrafun for amxx
but engine is the same
try this .sma
i tryed to compile it with the web compiler and it works
try it if it's works on cs don't really know
__________________
- Bye bye!
nightscreem is offline
NiGHTFiRE
Senior Member
Join Date: Dec 2004
Location: Sweden
Old 02-16-2005 , 09:12  
Reply With Quote #7

i think bailopan wants to use engine
NiGHTFiRE is offline
Send a message via AIM to NiGHTFiRE Send a message via MSN to NiGHTFiRE
philman213
Member
Join Date: Feb 2005
Location: WA
Old 02-16-2005 , 20:24  
Reply With Quote #8

I did what you guys said to do, only have include amxmodx and engine, and I got +4 errors, and still have the 1 warning.
Attached Thumbnails
Click image for larger version

Name:	errors.jpg
Views:	229
Size:	143.5 KB
ID:	2358  
philman213 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 19:29.


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