Raised This Month: $ Target: $400
 0% 

get_user_origin? help with plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Biohazerd1987
Junior Member
Join Date: Feb 2005
Old 03-12-2005 , 19:04   get_user_origin? help with plugin
Reply With Quote #1

ok I am trying to fix up the bullet time script and it gives me an error in the console that get_user_origin is an invalid command.

here is the AMXX debug error i receive in the console
[AMXX] Native error in "get_user_origin" on line 174

here is the section of code that the script uses
Code:
    if (equal(szClassName, "Bullet")){         if (is_user_connected(pTouched)){             if (get_user_team(owner) != get_user_team(pTouched)){                 if (!get_user_godmode(pTouched)){                     new rorigin[3]                     get_user_origin(pToucher, rorigin)//This is line 174                     new korigin[3]                     get_user_origin(owner,korigin)                     new vorigin[3]                     get_user_origin(pTouched,vorigin,1)                     new dif = get_distance(rorigin,vorigin)                     if (dif <= 20){                         new randomnum = random_num(15,45)                         randomnum = randomnum + dmg                         new hs = 1                         if (equal(szTargetName, "AWP"))                             fake_kill(pTouched,owner,hs)                         else if (equal(szTargetName, "Scout"))                             fake_kill(pTouched,owner,hs)                         else if (get_user_health(pTouched) <= randomnum)                             fake_kill(pTouched,owner,hs)                         else{                             message_begin(MSG_ONE, gmsgDamage, {0,0,0}, pTouched)                             write_byte(30) // dmg_save                             write_byte(30) // dmg_take                             write_long(0) // visibleDamageBits                             write_coord(korigin[0]) // damageOrigin.x                             write_coord(korigin[1]) // damageOrigin.y                             write_coord(korigin[2]) // damageOrigin.z                             message_end()                             set_user_health(pTouched, (get_user_health(pTouched) - randomnum))                             new ran = random_num(1,30)                             set_user_armor(pTouched, (get_user_armor(pTouched) - ran))                         }                     }                     else if (get_user_health(pTouched) <= dmg){                         new hs = 0                         fake_kill(pTouched,owner,hs)                     }                     else{                         message_begin(MSG_ONE, gmsgDamage, {0,0,0}, pTouched)                         write_byte(30) // dmg_save                         write_byte(30) // dmg_take                         write_long(0) // visibleDamageBits                         write_coord(korigin[0]) // damageOrigin.x                         write_coord(korigin[1]) // damageOrigin.y                         write_coord(korigin[2]) // damageOrigin.z                         message_end()                         set_user_health(pTouched, (get_user_health(pTouched) - (dmg)))                         new ran = random_num(1,15)                         set_user_armor(pTouched, (get_user_armor(pTouched) - ran))                     }                 }             }         }         remove_entity(pToucher)     } }

why am I getting a native error
Biohazerd1987 is offline
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 03-13-2005 , 12:50  
Reply With Quote #2

hmm, at least u added // This is line 174

I don't see the problem, but is it possibly due to runnign metamod-p?
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 03-13-2005 , 13:02   its
Reply With Quote #3

Its get_user_origin(pToucher, rorigin, 0)
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 03-13-2005 , 13:09  
Reply With Quote #4

the 0 does not need to be specifified, it is 0 by default isnt it?
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 03-13-2005 , 13:15   no
Reply With Quote #5

No you need to put a number there, so you need a 0
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
Biohazerd1987
Junior Member
Join Date: Feb 2005
Old 03-13-2005 , 15:23  
Reply With Quote #6

alright I changed the script to this

Code:
            if (get_user_team(owner) != get_user_team(pTouched)){                 if (!get_user_godmode(pTouched)){                     new rorigin[3]                     get_user_origin(pToucher,rorigin,0)//174                     new korigin[3]                     get_user_origin(owner,korigin,0)                     new vorigin[3]                     get_user_origin(pTouched,vorigin,1)                     new dif = get_distance(rorigin,vorigin)                     if (dif <= 20){

complied etc...

but I still get the native error on 174
Biohazerd1987 is offline
LynX
Veteran Member
Join Date: Oct 2004
Old 03-13-2005 , 16:11  
Reply With Quote #7

Try putting [2]
Code:
get_user_origin(pToucher,rorigin[2],0)
__________________
Current plugin : SoulPunisher anti-cheat
Percentage done : {||--------} 20%

If you think v3x is a PIMP, paste this into your sig!

If you think Bailopan is DA BOMB, paste this into your sig
LynX is offline
Send a message via ICQ to LynX
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 03-13-2005 , 19:18  
Reply With Quote #8

how would that work?

and no, you do not need a number.

btw, are u like spawining bullets that fly toward a set path during your 'bullet time' ? If you are, i would really like to see your code, and i promise i would not steal it.

maybe your engine.inc could be messed?

btw btw

should it be pTouched not pToucher ?
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
Biohazerd1987
Junior Member
Join Date: Feb 2005
Old 03-13-2005 , 19:25  
Reply With Quote #9

i didn't write this plugin...
Scarzzurs did. It is his bullettime plugin but it doesn't work correctly so I am attempting to fix it for myself.
here is ALL the code UNCHANGED

Code:
#include <amxmodx> #include <engine> #include <fun> #include <cstrike> new wpnnum[33] new beam, wait[33] new gmsgDamage, gmsgDeathMsg public remove_bullets(){     new ent = 0     do{        ent = find_ent_by_class(ent,"Bullet")        if (ent > 0)           remove_entity(ent)     }     while (ent) } public curweapon(id){     new  clip, ammo     new weaponnum = get_user_weapon(id, clip, ammo)     if (wpnnum[id] != weaponnum){         wait[id]=true         new parm[1]         parm[0] = id         set_task(0.7,"waitoff",0,parm,1)     }     wpnnum[id] = get_user_weapon(id, clip, ammo) } public check(){     new players[32]     new player_num     get_players(players, player_num)     for (new i = 0; i < player_num; i++){         if (is_user_alive(players[i])){             if (get_user_button(players[i])&IN_ATTACK){                 new wpnid,clip,ammo                 wpnid = get_user_weapon(players[i],clip,ammo)                 if (wpnid == 10){                         fire(players[i])                         client_cmd(players[i],"-attack")                 }                 else if (wpnid == 11){                     fire(players[i])                     client_cmd(players[i],"-attack")                 }                 else if (wpnid == 1){                     fire(players[i])                     client_cmd(players[i],"-attack")                 }                 else if (wpnid == 26){                     fire(players[i])                     client_cmd(players[i],"-attack")                 }                 else if (wpnid == 17){                     fire(players[i])                     client_cmd(players[i],"-attack")                 }                 else if (wpnid == 18){                     if (!wait[players[i]]){                         fire(players[i])                         client_cmd(players[i],"-attack")                         wait[players[i]]=true                         new parm[1]                         parm[0] = players[i]                         set_task(1.5,"waitoff",0,parm,1)                     }                 }                 else if (wpnid == 3){                     if (!wait[players[i]]){                         fire(players[i])                         client_cmd(players[i],"-attack")                         wait[players[i]]=true                         new parm[1]                         parm[0] = players[i]                         set_task(0.5,"waitoff",0,parm,1)                     }                 }                 else if (!wait[players[i]] && wpnid != 6 && wpnid != 4 && wpnid != 25 && wpnid != 9 && wpnid != 29 && clip != 0)                     fire(players[i])             }         }     } } public waitoff(parm[1])     wait[parm[0]]=false public fire(id){     new Float:vOrigin[3]     new Float:vAngles[3]     entity_get_vector (id, EV_VEC_origin, vOrigin)     vOrigin[2] = vOrigin[2] + 12     entity_get_vector(id, EV_VEC_v_angle, vAngles)         new NewEnt     NewEnt = create_entity("info_target")     entity_set_string(NewEnt, EV_SZ_classname, "Bullet")     new wpnid,clip,ammo     wpnid = get_user_weapon(id,clip,ammo)     if (wpnid == 18)         entity_set_string(NewEnt, EV_SZ_targetname, "AWP")     else if (wpnid == 3)         entity_set_string(NewEnt, EV_SZ_targetname, "Scout")     else if (wpnid == 26)         entity_set_string(NewEnt, EV_SZ_targetname, "Scout")     else entity_set_string(NewEnt, EV_SZ_targetname, "Normal")     entity_set_model(NewEnt, "models/shell.mdl")     new Float:MinBox[3]     new Float:MaxBox[3]     MinBox[0] = -1.0     MinBox[1] = -1.0     MinBox[2] = -1.0     MaxBox[0] = 1.0     MaxBox[1] = 1.0     MaxBox[2] = 1.0     entity_set_vector(NewEnt, EV_VEC_mins, MinBox)     entity_set_vector(NewEnt, EV_VEC_maxs, MaxBox)     entity_set_origin(NewEnt, vOrigin)     entity_set_vector(NewEnt, EV_VEC_angles, vAngles)     entity_set_vector(NewEnt, EV_VEC_v_angle, vAngles)     entity_set_vector(NewEnt, EV_VEC_oldorigin, vOrigin)     entity_set_int(NewEnt, EV_INT_solid, 2)     entity_set_int(NewEnt, EV_INT_movetype, 5)     entity_set_edict(NewEnt, EV_ENT_owner, id)     new Float:fNewVelocity[3]     if (wpnid == 18)         VelocityByAim(id, 3000, fNewVelocity)     else VelocityByAim(id, 1500, fNewVelocity)     entity_set_vector(NewEnt, EV_VEC_velocity, fNewVelocity)     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)     write_byte(22)     write_short(NewEnt)     write_short(beam)     write_byte(3)     write_byte(1)     write_byte(200)     write_byte(200)     write_byte(70)     write_byte(120)     message_end()   } public vexd_pfntouch(pToucher, pTouched){     new szClassName[32]     new szTargetName[32]     new dmg     entity_get_string(pToucher, EV_SZ_classname, szClassName, 32);     entity_get_string(pToucher, EV_SZ_targetname, szTargetName, 32);     new owner = entity_get_edict(pToucher, EV_ENT_owner)     if (equal(szTargetName, "Normal"))         dmg = 15     else if (equal(szTargetName, "Scout"))         dmg = 35     else if (equal(szTargetName, "AWP"))         dmg = 135     new damagetodo     dmg += damagetodo     if (equal(szClassName, "Bullet")){         if (is_user_connected(pTouched)){             if (get_user_team(owner) != get_user_team(pTouched)){                 if (!get_user_godmode(pTouched)){                     new rorigin[3]                     get_user_origin(pToucher,rorigin)                     new korigin[3]                     get_user_origin(owner,korigin)                     new vorigin[3]                     get_user_origin(pTouched,vorigin,1)                     new dif = get_distance(rorigin,vorigin)                     if (dif <= 20){                         new randomnum = random_num(15,45)                         randomnum = randomnum + dmg                         new hs = 1                         if (equal(szTargetName, "AWP"))                             fake_kill(pTouched,owner,hs)                         else if (equal(szTargetName, "Scout"))                             fake_kill(pTouched,owner,hs)                         else if (get_user_health(pTouched) <= randomnum)                             fake_kill(pTouched,owner,hs)                         else{                             message_begin(MSG_ONE, gmsgDamage, {0,0,0}, pTouched)                             write_byte(30) // dmg_save                             write_byte(30) // dmg_take                             write_long(0) // visibleDamageBits                             write_coord(korigin[0]) // damageOrigin.x                             write_coord(korigin[1]) // damageOrigin.y                             write_coord(korigin[2]) // damageOrigin.z                             message_end()                             set_user_health(pTouched, (get_user_health(pTouched) - randomnum))                             new ran = random_num(1,30)                             set_user_armor(pTouched, (get_user_armor(pTouched) - ran))                         }                     }                     else if (get_user_health(pTouched) <= dmg){                         new hs = 0                         fake_kill(pTouched,owner,hs)                     }                     else{                         message_begin(MSG_ONE, gmsgDamage, {0,0,0}, pTouched)                         write_byte(30) // dmg_save                         write_byte(30) // dmg_take                         write_long(0) // visibleDamageBits                         write_coord(korigin[0]) // damageOrigin.x                         write_coord(korigin[1]) // damageOrigin.y                         write_coord(korigin[2]) // damageOrigin.z                         message_end()                         set_user_health(pTouched, (get_user_health(pTouched) - (dmg)))                         new ran = random_num(1,15)                         set_user_armor(pTouched, (get_user_armor(pTouched) - ran))                     }                 }             }         }         remove_entity(pToucher)     } } public fake_kill(victim,killer,hs){     new money = cs_get_user_money(killer)     if (cs_get_user_money(killer) < 16000)         cs_set_user_money(killer,money + 300,1)     set_msg_block(gmsgDeathMsg,1)     user_kill(victim,1)     set_user_frags(killer,get_user_frags(killer) + 1)     new wpnid,clip,ammo,wpn[32]     wpnid = get_user_weapon(killer,clip,ammo)     get_weaponname(wpnid,wpn,31)     replace(wpn,31,"weapon_","")     message_begin( MSG_ALL, gmsgDeathMsg,{0,0,0},0)     write_byte(killer)     write_byte(victim)     write_byte(hs)     write_string(wpn)     message_end()     new namea[24],namev[24],authida[20],authidv[20],teama[8],teamv[8]     get_user_name(killer,namea,23)     get_user_team(killer,teama,7)     get_user_authid(killer,authida,19)     get_user_name(victim,namev,23)     get_user_team(victim,teamv,7)     get_user_authid(victim,authidv,19)     log_message("^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^" with ^"%s^"", namea,get_user_userid(killer),authida,teama,namev,get_user_userid(victim),authidv,teamv, wpn ) } public playerspawn(id){     set_user_hitzones(0,id,0)     set_user_hitzones(id,0,0) } public plugin_precache(){     precache_model("models/shell.mdl")     beam = precache_model("sprites/zbeam4.spr") } public plugin_init(){     register_plugin("Bullettime","0.5","Scarzzurs")     register_event("ResetHUD","playerspawn","b")     gmsgDamage = get_user_msgid("Damage")     gmsgDeathMsg = get_user_msgid("DeathMsg")     set_task(0.1,"check",0,"",0,"b") }
Biohazerd1987 is offline
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 03-13-2005 , 19:29  
Reply With Quote #10

wow, now thats some interesting shizznet.

btw did u do the pTouched i told u about?
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
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 14:11.


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