Meta tokius warning'us
//// Nezinau.sma
// D:\Program Files\Steam\steamapps\zirualaz\counter-strike\cstrike\addons\amxmo
dx\scripting\Nezinau.sma(78) : warning 204: symbol is assigned a value that is n
ever used: "origin2"
// D:\Program Files\Steam\steamapps\zirualaz\counter-strike\cstrike\addons\amxmo
dx\scripting\Nezinau.sma(78) : warning 204: symbol is assigned a value that is n
ever used: "origin"
Plugin init rašiau šitą:
Code: Select all
register_forward(FM_Touch, "entity_klases_forwardas")
O entity kurimą dėjau čia:
Code: Select all
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_knife", "wp_prim", 1) //čia plugin_init
Code: Select all
public wp_prim(weapon) { static id id = entity_get_int(weapon, EV_ENT_owner) new Float:origin[3], Float:velocity[3] velocity_by_aim(id, 600, velocity) entity_get_vector(id, EV_VEC_origin, origin) new ent = create_entity("info_target") entity_set_int(ent, EV_INT_movetype, MOVETYPE_FLY) entity_set_string(ent, EV_SZ_classname, "entity_klase") entity_set_model(ent, "models/raketa.mdl") entity_set_size(ent, Float:{-15.0, -15.0, -15.0}, Float:{15.0, 15.0, 15.0}) entity_set_int(ent, EV_INT_solid, SOLID_TRIGGER) origin[2]+=10.0 entity_set_origin(ent, origin) entity_set_edict(ent, EV_ENT_owner, id) entity_set_vector(ent, EV_VEC_velocity, velocity)}
Nuėjus į serveri, nieko neįvyksta. :?
-- 2011 Bal 12 12:41 --
Radau alliedmoders tut'a bet kai į servą nueinu, parašau car nieko neivyksta:
Code: Select all
#include <amxmodx>#include <amxmisc>#include <engine> new g_Classname[] = "func_car"new g_Model[] = "models/car.mdl" public plugin_init(){ register_plugin("OMFG","HAX","LOL") register_clcmd("say car","CmdSayCar") register_touch(g_Classname,"player","TouchCar")} public plugin_precache() precache_model(g_Model) public CmdSayCar(id){ new Ent = create_entity("info_target") entity_set_string(Ent,EV_SZ_classname,g_Classname) entity_set_model(Ent,g_Model) entity_set_int(Ent,EV_INT_solid,SOLID_TRIGGER) entity_set_size(Ent,Float:{-50.0,-50.0,-50.0},Float:{50.0,50.0,50.0}) entity_set_edict(Ent,EV_ENT_owner,id)} public TouchCar(Ptd,Ptr){ new Owner = entity_get_edict(Ptd,EV_ENT_owner) if(Owner != Ptr) return client_print(Ptr,print_chat,"You have used this car. Due to time purposes, I'm not going to add code beyond this.")}