Raised This Month: $ Target: $400
 0% 

adding 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-14-2006 , 18:23   adding player's origin
Reply With Quote #1

hi how would i add player to this like
amx_createcar car_skyline wonsae then it would spawn on top of the player heres the code

Code:
public purposedrop(id)     {     if(!is_user_alive(id)) return PLUGIN_HANDLED     if(!access(id,ADMIN_IMMUNITY)) return PLUGIN_HANDLED         new itemname[64], save1[6], szFilename[64]     read_argv(1, itemname, 31)     read_argv(2, save1, 5)     if(!access(id,ADMIN_IMMUNITY)) {         client_print(id,print_console,"You do not have access to this command.")         return PLUGIN_HANDLED     }     if(equal(itemname, "") || equal(save1, "")) {         client_print(id,print_console,"Usage: amx_createcar <model> <save 1/0>")         return PLUGIN_HANDLED     }         new save = str_to_num(save1)     new origin[3], Float:originF[3]     get_user_origin(id,origin)         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:angles[3] = { 0.0, 0.0, 0.0 }         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(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_BBOX)         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)     if(save == 1 || equal(save1, "1")) {         get_cvar_string("rp_carsfile",szFilename,63)         if (!file_exists(szFilename)) return PLUGIN_HANDLED                 new message[64]         format(message, 63, "amx_makecar %s %i %i %i 0", itemname, origin[0], origin[1], origin[2])         write_file(szFilename,message,-1)     }     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 20:19.


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