Raised This Month: $ Target: $400
 0% 

adding a player's origin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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 15:28.


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