Raised This Month: $32 Target: $400
 8% 

adding a player's origin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 03-29-2006 , 16:43   adding a player's origin
Reply With Quote #1

hi i'm trying to add a player origin on this so the command would be
amx_createcar <target> <model>
so then the model spawns ontop of them but this wouldnt work
help plz
Code:
public purposedrop(id)     {     if(!is_user_alive(id)) return PLUGIN_HANDLED     if(!access(id,ADMIN_RESERVATION)) return PLUGIN_HANDLED         new itemname[64], player[32], target     read_argv(1, itemname, 31)     read_argv(3, player, 31)     if(!access(id,ADMIN_RESERVATION)) {         client_print(id,print_console,"You do not have access to this command.")         return PLUGIN_HANDLED     }     if(equal(itemname, ""))         if(equal(player, ""))         {         client_print(id,print_console,"Usage: amx_createcar <target> <model>")         return PLUGIN_HANDLED     }         new origin[3], Float:originF[3], Float:angles[3]     get_user_origin(id,origin)     target = cmd_target(id,player,2)         if(!target) {         return PLUGIN_HANDLED     }     entity_get_vector(target,EV_VEC_origin, origin)     entity_get_vector(target,EV_VEC_angles, angles)         originF[0] = float(origin[0])     originF[1] = float(origin[1])     originF[2] = float(origin[2])         new car = create_entity("info_target")         if(!car) {         client_print(id,print_chat,"CAR WAS not created. Error.^n")         return PLUGIN_HANDLED     }         new Float:minbox[3] = { -2.5, -2.5, -2.5 }     new Float:maxbox[3] = { 2.5, 2.5, -2.5 }         new Float:pangles[3]     entity_get_vector(id,EV_VEC_angles,pangles)     angles[1] = pangles[1]     entity_set_vector(car,EV_VEC_mins,minbox)     entity_set_vector(car,EV_VEC_maxs,maxbox)     entity_set_vector(car,EV_VEC_angles,angles)     entity_set_float(id,EV_FL_speed,100.0)     entity_set_float(car,EV_FL_dmg,0.0)     entity_set_float(car,EV_FL_dmg_take,0.0)     entity_set_float(car,EV_FL_max_health,99999.0)     entity_set_float(car,EV_FL_health,99999.0)         entity_set_int(car,EV_INT_solid,SOLID_TRIGGER)     entity_set_int(car,EV_INT_movetype,MOVETYPE_NONE)         entity_set_string(car,EV_SZ_targetname,itemname)     entity_set_string(car,EV_SZ_classname,"item_car")         new damodel[64]     format(damodel,63,"models/player/%s/%s.mdl", itemname, itemname)         entity_set_model(car,damodel)     entity_set_origin(car,originF)         allow[id] = 1     set_task(10.0,"allowhim",id)     return PLUGIN_HANDLED }
wonsae is offline
ObscureAlucard
Junior Member
Join Date: Mar 2006
Location: Washington
Old 03-29-2006 , 23:12   Re: adding a player's origin
Reply With Quote #2

Quote:
Originally Posted by wonsae
hi i'm trying to add a player origin on this so the command would be
amx_createcar <target> <model>
so then the model spawns ontop of them but this wouldnt work
help plz
Code:
public purposedrop(id)     {         new itemname[64], player[32], target     read_argv(1, itemname, 31)     read_argv(3, player, 31)     }
Well for one, your itemname len is wrong, it should be 63, not 31 by the way you have it
__________________
ObscureAlucard is offline
Send a message via AIM to ObscureAlucard
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-30-2006 , 00:10  
Reply With Quote #3

Code:
    new Float:originF[3], Float:angles[3]     //get_user_origin(id, origin)     target = cmd_target(id, player, 2)         if(!target) {         return PLUGIN_HANDLED     }     entity_get_vector(target, EV_VEC_origin, originF)     entity_get_vector(target, EV_VEC_angles, angles)     originF[2] += 75.0 // or something
__________________
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
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 03-30-2006 , 16:26  
Reply With Quote #4

thanks i'm gonna go try it
wonsae is offline
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 04-01-2006 , 09:25  
Reply With Quote #5

ok i tried this and it didn't work when i tried to target someone it said client not found
wonsae is offline
Reply


Thread Tools
Display Modes

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 02:27.


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