PDA

View Full Version : [solved] spawn an entity , touch bug !


steve139
04-11-2008, 15:43
hello
i m trying to build an amx_spawn
but i can t take spawned entity ...
the entity is spawned but i can t touch it !


part of func for spawn it

if(equal(arg1, "axe")) {

new ent = create_entity("info_target")
if(!ent) return PLUGIN_HANDLED;
set_pev(ent,pev_classname,"axe")
engfunc(EngFunc_SetModel, ent,"models/p_crowbar.mdl")

new team = str_to_num(arg2)
if((team == 1)) {
DispatchKeyValue(ent,"team_no","1");
}
else if((team == 2)) {
DispatchKeyValue(ent,"team_no","2");
}
else if((team == 3)) {
DispatchKeyValue(ent,"team_no","3");
}

else if((team == 4)) {
DispatchKeyValue(ent,"team_no","4");
}
else if((team == 0)) {
DispatchKeyValue(ent,"team_no","0");
}
else {
client_print(id,print_console,"invalide team number")
}

new classe = str_to_num(arg3)
if((classe == 1)) {
DispatchKeyValue(ent,"playerclass","1");
}
else if((classe == 2)) {
DispatchKeyValue(ent,"playerclass","2");
}
else if((classe == 3)) {
DispatchKeyValue(ent,"playerclass","3");
}
else if((classe == 4)) {
DispatchKeyValue(ent,"playerclass","4");
}
else if((classe == 5)) {
DispatchKeyValue(ent,"playerclass","5");
}
else if((classe == 6)) {
DispatchKeyValue(ent,"playerclass","6");
}
else if((classe == 7)) {
DispatchKeyValue(ent,"playerclass","7");
}
else if((classe == 8)) {
DispatchKeyValue(ent,"playerclass","8");
}
else if((classe == 9)) {
DispatchKeyValue(ent,"playerclass","9");
}
else if((classe == 11)) {
DispatchKeyValue(ent,"playerclass","11");
}
else if((classe == 0)) {
DispatchKeyValue(ent,"playerclass","0");
}
else {
client_print(id,print_console,"invalide class number")
}

new Float:Aim[3], Float:origin[3]

velocity_by_aim(id, 64, Aim)
pev(id, pev_origin, origin)

origin[0] += Aim[0]
origin[1] += Aim[1]

set_pev(ent,pev_origin,origin)
set_pev(ent, pev_movetype, MOVETYPE_TOSS)
set_pev(ent,pev_origin,origin)

set_pev(ent, pev_mins, Float:{-16.0, -16.0, -16.0})
set_pev(ent, pev_maxs, Float:{16.0, 16.0, 16.0})

set_pev(ent, pev_solid, SOLID_TRIGGER)

client_print(id,print_console," You spawn <%s> with the id <%i>",arg1,ent)
DispatchSpawn(ent)

}
func for touch it


public fwd_Touch(ptr, ptd) {
if(pev_valid(ptr)) {
new classname[32]
pev(ptr, pev_classname, classname, 31)

if(equal(classname, "axe")) {
if(pev_valid(ptd)) {
new id = ptd
if(id > 0 && id < g_MaxPlayers) {
if(is_user_alive(id)) {
new t_team[32], t_class[32]
get_keyvalue(ptr,"no_team",t_team,31)
get_keyvalue(ptr,"playerclass",t_class,31)
new p_team = str_to_num(t_team)
new p_class = str_to_num(t_class)
if (entity_get_int(id, EV_INT_team) != p_team) {
return PLUGIN_HANDLED
}
if(pev(id,pev_playerclass) != p_class ) {
return PLUGIN_HANDLED
}
give_item(id,"tf_weapon_axe")
pev(ptr,pev_origin,wpn_res_origin)
set_task(20.0,"func_resspawn")


k_team = str_to_num(t_team)


k_class = str_to_num(t_class)
copy( k_classname[31], sizeof classname - 1, classname)
set_pev(ptr, pev_flags, FL_KILLME)
}

}
}
}
else if(equal(classname, "spanner")) {
if(pev_valid(ptd)) {
new id = ptd
if(id > 0 && id < g_MaxPlayers) {
if(is_user_alive(id)) {
new t_team[32], t_class[32]
get_keyvalue(ptr,"no_team",t_team,31)
get_keyvalue(ptr,"playerclass",t_class,31)
new p_team = str_to_num(t_team)
new p_class = str_to_num(t_class)
if (entity_get_int(id, EV_INT_team) != p_team) {
return PLUGIN_HANDLED
}
if(pev(id,pev_playerclass) != p_class ) {
return PLUGIN_HANDLED
}
give_item(id,"tf_weapon_spanner")
pev(ptr,pev_origin,wpn_res_origin)
set_task(20.0,"func_resspawn")


k_team = str_to_num(t_team)


k_class = str_to_num(t_class)
copy( k_classname[31], sizeof classname - 1, classname)
set_pev(ptr, pev_flags, FL_KILLME)
}

}
}
}
}
return FMRES_IGNORED
}
can you help me please ?
in advance thank you

Vet
04-13-2008, 22:45
1) Hint: Instead of all those if/else checks, use switch/case
2) I don't think you can just give_item for something that doesn't already exist in the game.

steve139
04-14-2008, 01:51
but normaly i can touch the entity
i realy find the same
in weaponmod

public fwd_Touch(ptr, ptd)
{
if(!get_pcvar_num(g_Enabled)) return FMRES_IGNORED

if(pev_valid(ptr))
{
new classname[32]
pev(ptr, pev_classname, classname, 31)

if(equal(classname, WPN_ENTITY_NAME))
{
if(pev_valid(ptd))
{
new id = ptd
if(id > 0 && id < g_MaxPlayers)
{
if(!is_user_alive(id)) return PLUGIN_CONTINUE

// Check if player already has this weapon
new wpnid = g_EntInfos[ptr][ent_wpn_index]
new found = -1
for(new i = 0; i < g_UserWpnCount[id]; i++)
{
if(g_UserWpns[id][i][usr_wpn_index] == wpnid)
{
found = i
break
}
}

if(found == -1)
{
// Player hasn't got this weapon, give it to him
give_weapon(id, wpnid, g_EntInfos[ptr][ent_wpn_ammo1], g_EntInfos[ptr][ent_wpn_ammo2])
give_item(id,"tf_weapon_knife")
client_cmd(id,"tf_weapon_knife")
set_pev(ptr, pev_flags, FL_KILLME)
}
}
}
}
}
return FMRES_IGNORED
}

but why it s don t working on my amx_spawn :/ ?

DevconeS
04-16-2008, 05:24
Try setting the entities maxs/mins right after setting the model.

hlstriker
04-16-2008, 11:00
It looks like you're making this for TFC, which I personally have never had any problems spawning entities with. I have however had a ton of problems spawning entities in Counter-Strike and here is how I sometimes fix it.

// Try using DLLFunc_Spawn
dllfunc(DLLFunc_Spawn, ent);

// Use the engfunc for setting the origin and mins/maxs
engfunc(EngFunc_SetSize, ent, Float:{-16.0, -16.0, -16.0}, Float:{16.0, 16.0, 16.0});
engfunc(EngFunc_SetOrigin, ent, origin);

// For some weird reason I found EngFunc_DropToFloor will fix weird problems
engfunc(EngFunc_DropToFloor, ent);

If none of that works just keep playing around with it. Sometimes settings things in a certain order might affect it too.

steve139
04-16-2008, 12:47
kkk thx i will test
in some days becouse i am not in my home :/
thx again :D

steve139
04-18-2008, 16:47
updated :
if(equal(arg1, "axe")) {

new ent = create_entity("info_target")
if(!ent) return PLUGIN_HANDLED;
set_pev(ent,pev_classname,"axe")
engfunc(EngFunc_SetModel, ent,"models/p_crowbar.mdl")
engfunc(EngFunc_SetSize, ent, Float:{-16.0, -16.0, -16.0}, Float:{16.0, 16.0, 16.0});


new team = str_to_num(arg2)
switch(team) {
case 0: DispatchKeyValue(ent,"team_no","0");
case 1: DispatchKeyValue(ent,"team_no","1");
case 2: DispatchKeyValue(ent,"team_no","2");
case 3: DispatchKeyValue(ent,"team_no","3");
case 4: DispatchKeyValue(ent,"team_no","4");
}

new classe = str_to_num(arg3)
switch(classe) {
case 0: DispatchKeyValue(ent,"playerclass","0");
case 1: DispatchKeyValue(ent,"playerclass","1");
case 2: DispatchKeyValue(ent,"playerclass","2");
case 3: DispatchKeyValue(ent,"playerclass","3");
case 4: DispatchKeyValue(ent,"playerclass","4");
case 5: DispatchKeyValue(ent,"playerclass","5");
case 6: DispatchKeyValue(ent,"playerclass","6");
case 7: DispatchKeyValue(ent,"playerclass","7");
case 8: DispatchKeyValue(ent,"playerclass","8");
case 9: DispatchKeyValue(ent,"playerclass","9");
case 11: DispatchKeyValue(ent,"playerclass","11");
}


new Float:Aim[3], Float:origin[3]

velocity_by_aim(id, 64, Aim)
pev(id, pev_origin, origin)

origin[0] += Aim[0]
origin[1] += Aim[1]

set_pev(ent,pev_origin,origin)
engfunc(EngFunc_DropToFloor, ent);
set_pev(ent,pev_origin,origin)


set_pev(ent, pev_solid, SOLID_TRIGGER)

client_print(id,print_console," You spawn <%s> with the id <%i>",arg1,ent)
dllfunc(DLLFunc_Spawn, ent);


}
else if(equal(arg1,"spanner")) {

new ent = create_entity("info_target")
if(!ent) return PLUGIN_HANDLED;
set_pev(ent,pev_classname,"spanner")
engfunc(EngFunc_SetModel, ent,"models/p_spanner.mdl")

new team = str_to_num(arg2)
switch(team) {
case 0: DispatchKeyValue(ent,"team_no","0");
case 1: DispatchKeyValue(ent,"team_no","1");
case 2: DispatchKeyValue(ent,"team_no","2");
case 3: DispatchKeyValue(ent,"team_no","3");
case 4: DispatchKeyValue(ent,"team_no","4");
}

new classe = str_to_num(arg3)
switch(classe) {
case 0: DispatchKeyValue(ent,"playerclass","0");
case 1: DispatchKeyValue(ent,"playerclass","1");
case 2: DispatchKeyValue(ent,"playerclass","2");
case 3: DispatchKeyValue(ent,"playerclass","3");
case 4: DispatchKeyValue(ent,"playerclass","4");
case 5: DispatchKeyValue(ent,"playerclass","5");
case 6: DispatchKeyValue(ent,"playerclass","6");
case 7: DispatchKeyValue(ent,"playerclass","7");
case 8: DispatchKeyValue(ent,"playerclass","8");
case 9: DispatchKeyValue(ent,"playerclass","9");
case 11: DispatchKeyValue(ent,"playerclass","11");
}

DispatchKeyValue(ent,"respawn_delay","5");
new Float:Aim[3], Float:origin[3]

velocity_by_aim(id, 64, Aim)
pev(id, pev_origin, origin)

origin[0] += Aim[0]
origin[1] += Aim[1]

set_pev(ent,pev_origin,origin)
engfunc(EngFunc_DropToFloor, ent);
set_pev(ent,pev_origin,origin)
engfunc(EngFunc_SetSize, ent, Float:{-16.0, -16.0, -16.0}, Float:{16.0, 16.0, 16.0});


set_pev(ent, pev_solid, SOLID_TRIGGER)

client_print(id,print_console," You spawn <%s> with the id <%i>",arg1,ent)
dllfunc(DLLFunc_Spawn, ent);


}public fwd_Touch(ptr, ptd) {
if(pev_valid(ptr)) {
new classname[32]
pev(ptr, pev_classname, classname, 31)

if(equal(classname, "axe")) {
if(pev_valid(ptd)) {
new id = ptd
if(id > 0 && id < g_MaxPlayers) {
if(is_user_alive(id)) {
new t_team[32], t_class[32]
get_keyvalue(ptr,"no_team",t_team,31)
get_keyvalue(ptr,"playerclass",t_class,31)
new p_team = str_to_num(t_team)
new p_class = str_to_num(t_class)
if (entity_get_int(id, EV_INT_team) != p_team) {
return PLUGIN_HANDLED
}
if(pev(id,pev_playerclass) != p_class ) {
return PLUGIN_HANDLED
}
give_item(id,"tf_weapon_axe")
pev(ptr,pev_origin,wpn_res_origin)
set_task(20.0,"func_resspawn")


k_team = str_to_num(t_team)


k_class = str_to_num(t_class)
copy( k_classname[31], sizeof classname - 1, classname)
set_pev(ptr, pev_flags, FL_KILLME)
}

}
}
}
else if(equal(classname, "spanner")) {
if(pev_valid(ptd)) {
new id = ptd
if(id > 0 && id < g_MaxPlayers) {
if(is_user_alive(id)) {
new t_team[32], t_class[32]
get_keyvalue(ptr,"no_team",t_team,31)
get_keyvalue(ptr,"playerclass",t_class,31)
new p_team = str_to_num(t_team)
new p_class = str_to_num(t_class)
if (entity_get_int(id, EV_INT_team) != p_team) {
return PLUGIN_HANDLED
}
if(pev(id,pev_playerclass) != p_class ) {
return PLUGIN_HANDLED
}
give_item(id,"tf_weapon_spanner")
pev(ptr,pev_origin,wpn_res_origin)
set_task(20.0,"func_resspawn")


k_team = str_to_num(t_team)


k_class = str_to_num(t_class)
copy( k_classname[31], sizeof classname - 1, classname)
set_pev(ptr, pev_flags, FL_KILLME)
}

}
}
}
}
return FMRES_IGNORED
}but still dont work D: :cry:
help me please

edit : i also trying whit an other ent name ( wpn_axe and wpn_spanner ) but keep don t wrok :cry:

steve139
04-29-2008, 03:18
*bump* and code update


this works

else if(equal(arg1,"ammopack")) {

new ent = create_entity("info_tfgoal")
if(!ent) return PLUGIN_HANDLED;
set_pev(ent,pev_classname,"info_tfgoal")
engfunc(EngFunc_SetModel, ent,"models/backpack.mdl")

new team = str_to_num(arg2)
switch(team) {
case 0: DispatchKeyValue(ent,"team_no","0");
case 1: DispatchKeyValue(ent,"team_no","1");
case 2: DispatchKeyValue(ent,"team_no","2");
case 3: DispatchKeyValue(ent,"team_no","3");
case 4: DispatchKeyValue(ent,"team_no","4");
}

new classe = str_to_num(arg3)
switch(classe) {
case 0: DispatchKeyValue(ent,"playerclass","0");
case 1: DispatchKeyValue(ent,"playerclass","1");
case 2: DispatchKeyValue(ent,"playerclass","2");
case 3: DispatchKeyValue(ent,"playerclass","3");
case 4: DispatchKeyValue(ent,"playerclass","4");
case 5: DispatchKeyValue(ent,"playerclass","5");
case 6: DispatchKeyValue(ent,"playerclass","6");
case 7: DispatchKeyValue(ent,"playerclass","7");
case 8: DispatchKeyValue(ent,"playerclass","8");
case 9: DispatchKeyValue(ent,"playerclass","9");
case 11: DispatchKeyValue(ent,"playerclass","11");
}
DispatchKeyValue(ent,"ammo_shells","50")
DispatchKeyValue(ent,"ammo_cells","50")
DispatchKeyValue(ent,"ammo_rockets","50")
DispatchKeyValue(ent,"ammo_nails","50")
DispatchKeyValue(ent,"g_a","1")
DispatchKeyValue(ent,"g_e","1")
DispatchKeyValue(ent,"goal_no","0")
DispatchKeyValue(ent,"goal_activation","1")
DispatchKeyValue(ent,"goal_effects","1")
DispatchKeyValue(ent,"goal_result","0")
DispatchKeyValue(ent,"goal_state","2")
DispatchKeyValue(ent,"noise","weapons/scock1.wav")
DispatchKeyValue(ent,"wait","5")
new Float:Aim[3], Float:origin[3]

velocity_by_aim(id, 64, Aim)
pev(id, pev_origin, origin)

origin[0] += Aim[0]
origin[1] += Aim[1]

set_pev(ent,pev_origin,origin)
set_pev(ent, pev_movetype, MOVETYPE_TOSS)
set_pev(ent,pev_origin,origin)

client_print(id,print_console," You spawn <%s> with the id <%i>",arg1,ent)
dllfunc(DLLFunc_Spawn, ent);

}this crash the server on respawn ... why ?
new ent = create_entity("tf_weapon_knife")
if(!ent) return PLUGIN_HANDLED;
set_pev(ent,pev_classname,"tf_weapon_knife")
engfunc(EngFunc_SetModel, ent,"models/p_knife.mdl")

new team = str_to_num(arg2)
switch(team) {
case 0: DispatchKeyValue(ent,"team_no","0");
case 1: DispatchKeyValue(ent,"team_no","1");
case 2: DispatchKeyValue(ent,"team_no","2");
case 3: DispatchKeyValue(ent,"team_no","3");
case 4: DispatchKeyValue(ent,"team_no","4");
}

new classe = str_to_num(arg3)
switch(classe) {
case 0: DispatchKeyValue(ent,"playerclass","0");
case 1: DispatchKeyValue(ent,"playerclass","1");
case 2: DispatchKeyValue(ent,"playerclass","2");
case 3: DispatchKeyValue(ent,"playerclass","3");
case 4: DispatchKeyValue(ent,"playerclass","4");
case 5: DispatchKeyValue(ent,"playerclass","5");
case 6: DispatchKeyValue(ent,"playerclass","6");
case 7: DispatchKeyValue(ent,"playerclass","7");
case 8: DispatchKeyValue(ent,"playerclass","8");
case 9: DispatchKeyValue(ent,"playerclass","9");
case 11: DispatchKeyValue(ent,"playerclass","11");
}

new Float:Aim[3], Float:origin[3]

velocity_by_aim(id, 64, Aim)
pev(id, pev_origin, origin)

origin[0] += Aim[0]
origin[1] += Aim[1]

set_pev(ent,pev_origin,origin)
set_pev(ent, pev_movetype, MOVETYPE_TOSS)
set_pev(ent,pev_origin,origin)
engfunc(EngFunc_SetSize, ent, Float:{-16.0, -16.0, -16.0}, Float:{16.0, 16.0, 16.0});


engfunc(EngFunc_DropToFloor, ent);

client_print(id,print_console," You spawn <%s> with the id <%i>",arg1,ent)
dllfunc(DLLFunc_Spawn, ent);

new ent_2 = create_entity("info_tfgoal")
if(!ent_2) return PLUGIN_HANDLED;
set_pev(ent,pev_classname,"info_tfgoal")
engfunc(EngFunc_SetModel, ent_2,"models/p_knife.mdl")


switch(team) {
case 0: DispatchKeyValue(ent_2,"team_no","0");
case 1: DispatchKeyValue(ent_2,"team_no","1");
case 2: DispatchKeyValue(ent_2,"team_no","2");
case 3: DispatchKeyValue(ent_2,"team_no","3");
case 4: DispatchKeyValue(ent_2,"team_no","4");
}
switch(classe) {
case 0: DispatchKeyValue(ent_2,"playerclass","0");
case 1: DispatchKeyValue(ent_2,"playerclass","1");
case 2: DispatchKeyValue(ent_2,"playerclass","2");
case 3: DispatchKeyValue(ent_2,"playerclass","3");
case 4: DispatchKeyValue(ent_2,"playerclass","4");
case 5: DispatchKeyValue(ent_2,"playerclass","5");
case 6: DispatchKeyValue(ent_2,"playerclass","6");
case 7: DispatchKeyValue(ent_2,"playerclass","7");
case 8: DispatchKeyValue(ent_2,"playerclass","8");
case 9: DispatchKeyValue(ent_2,"playerclass","9");
case 11: DispatchKeyValue(ent_2,"playerclass","11");
}

DispatchKeyValue(ent_2,"g_a","1")
DispatchKeyValue(ent_2,"g_e","1")
DispatchKeyValue(ent_2,"goal_no","0")
DispatchKeyValue(ent_2,"goal_activation","1")
DispatchKeyValue(ent_2,"goal_effects","1")
DispatchKeyValue(ent_2,"goal_result","0")
DispatchKeyValue(ent_2,"goal_state","2")
DispatchKeyValue(ent_2,"noise","weapons/scock1.wav")
DispatchKeyValue(ent_2,"wait","20")

set_pev(ent_2,pev_origin,origin)
set_pev(ent_2, pev_movetype, MOVETYPE_TOSS)
set_pev(ent_2,pev_origin,origin)

client_print(id,print_console,"and model has for id : <%i>",arg1,ent_2)
dllfunc(DLLFunc_Spawn, ent_2);

}and this completly dont work :'(
else if(equal(arg1,"lowgrav")) {

new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
if(!ent) return PLUGIN_HANDLED;
set_pev(ent,pev_classname,"items_lowgrav")
engfunc(EngFunc_SetModel, ent,"models/invis.mdl")
set_pev(ent,pev_mins,Float:{-16.0,-16.0,0.0})
set_pev(ent,pev_maxs,Float:{16.0,16.0,36.0})
set_pev(ent,pev_size,Float:{-16.0,-16.0,0.0,16.0,16.0,36.0})
engfunc(EngFunc_SetSize,ent,Float:{-16.0,-16.0,0.0},Float:{16.0,16.0,36.0})

set_pev(ent,pev_solid,SOLID_BBOX)
set_pev(ent,pev_movetype,MOVETYPE_TOSS)

new team = str_to_num(arg2)
switch(team) {
case 0: DispatchKeyValue(ent,"team_no","0");
case 1: DispatchKeyValue(ent,"team_no","1");
case 2: DispatchKeyValue(ent,"team_no","2");
case 3: DispatchKeyValue(ent,"team_no","3");
case 4: DispatchKeyValue(ent,"team_no","4");
}

new classe = str_to_num(arg3)
switch(classe) {
case 0: DispatchKeyValue(ent,"playerclass","0");
case 1: DispatchKeyValue(ent,"playerclass","1");
case 2: DispatchKeyValue(ent,"playerclass","2");
case 3: DispatchKeyValue(ent,"playerclass","3");
case 4: DispatchKeyValue(ent,"playerclass","4");
case 5: DispatchKeyValue(ent,"playerclass","5");
case 6: DispatchKeyValue(ent,"playerclass","6");
case 7: DispatchKeyValue(ent,"playerclass","7");
case 8: DispatchKeyValue(ent,"playerclass","8");
case 9: DispatchKeyValue(ent,"playerclass","9");
case 11: DispatchKeyValue(ent,"playerclass","11");
}
DispatchKeyValue(ent,"angles","-90 0 0")
DispatchKeyValue(ent,"g_a","1")
DispatchKeyValue(ent,"g_e","1")
DispatchKeyValue(ent,"goal_no","0")
DispatchKeyValue(ent,"goal_activation","1")
DispatchKeyValue(ent,"goal_effects","1")
DispatchKeyValue(ent,"goal_result","0")
DispatchKeyValue(ent,"goal_state","2")
DispatchKeyValue(ent,"noise","weapons/scock1.wav")
DispatchKeyValue(ent,"wait","5")
new Float:Aim[3], Float:origin[3]

velocity_by_aim(id, 64, Aim)
pev(id, pev_origin, origin)

origin[0] += Aim[0]
origin[1] += Aim[1]

set_pev(ent,pev_origin,origin)

client_print(id,print_console," You spawn <%s> with the id <%i>",arg1,ent)
dllfunc(DLLFunc_Spawn, ent);

}new k_team_lowgrav
new k_class_lowgrav
new Float:items_lowgrav_origin[3]
new lowgravcantouch = 0
public FM_touch(id,ent) {
if(is_user_alive(id)) {
new classname[32]
pev(ent, pev_classname, classname, 31)

if(equal(classname, "items_lowgrav")) {
force_use(id,ent)
fake_touch(ent,id)
if((lowgravcantouch == 0)) {
new t_team[32], t_class[32]
get_keyvalue(ent,"no_team",t_team,31)
get_keyvalue(ent,"playerclass",t_class,31)
new p_team = str_to_num(t_team)
new p_class = str_to_num(t_class)
if((get_user_team(id) == p_team)) {
if((ph_tfc_get_user_class(id) == p_class )) {
set_user_gravity(id,0.2)
pev(ent,pev_origin,items_lowgrav_origin)
set_task(5.0,"respawn_lowgrav")


k_team_lowgrav = str_to_num(t_team)
k_class_lowgrav = str_to_num(t_class)

set_pev(ent, pev_flags, FL_KILLME)

lowgravcantouch = 1
}
else if ((p_class == 0)) {
set_user_gravity(id,0.2)
pev(ent,pev_origin,items_lowgrav_origin)
set_task(5.0,"respawn_lowgrav")


k_team_lowgrav = str_to_num(t_team)
k_class_lowgrav = str_to_num(t_class)

set_pev(ent, pev_flags, FL_KILLME)

lowgravcantouch = 1
}

}
else if((p_team == 0)) {
if((ph_tfc_get_user_class(id) == p_class )) {
set_user_gravity(id,0.2)
pev(ent,pev_origin,items_lowgrav_origin)
set_task(5.0,"respawn_lowgrav")


k_team_lowgrav = str_to_num(t_team)
k_class_lowgrav = str_to_num(t_class)

set_pev(ent, pev_flags, FL_KILLME)

lowgravcantouch = 1
}
else if ((p_class == 0)) {
set_user_gravity(id,0.2)
pev(ent,pev_origin,items_lowgrav_origin)
set_task(5.0,"respawn_lowgrav")


k_team_lowgrav = str_to_num(t_team)
k_class_lowgrav = str_to_num(t_class)

set_pev(ent, pev_flags, FL_KILLME)

lowgravcantouch = 1
}
}

}

}
}
}
public lowgrav_canretouch() {
lowgravcantouch = 0
}

public respawn_lowgrav() {
lowgrav_canretouch()
new ent = create_entity("info_tfgoal")
if(!ent) return PLUGIN_HANDLED;
set_pev(ent,pev_classname,"info_tfgoal")
set_pev(ent,pev_classname,"items_lowgrav")
engfunc(EngFunc_SetModel, ent,"models/invis.mdl")
set_pev(ent,pev_mins,Float:{-16.0,-16.0,0.0})
set_pev(ent,pev_maxs,Float:{16.0,16.0,36.0})
set_pev(ent,pev_size,Float:{-16.0,-16.0,0.0,16.0,16.0,36.0})
engfunc(EngFunc_SetSize,ent,Float:{-16.0,-16.0,0.0},Float:{16.0,16.0,36.0})

set_pev(ent,pev_solid,SOLID_BBOX)
set_pev(ent,pev_movetype,MOVETYPE_TOSS)

new team = k_team_lowgrav
switch(team) {
case 0: DispatchKeyValue(ent,"team_no","0");
case 1: DispatchKeyValue(ent,"team_no","1");
case 2: DispatchKeyValue(ent,"team_no","2");
case 3: DispatchKeyValue(ent,"team_no","3");
case 4: DispatchKeyValue(ent,"team_no","4");
}

new classe = k_class_lowgrav
switch(classe) {
case 0: DispatchKeyValue(ent,"playerclass","0");
case 1: DispatchKeyValue(ent,"playerclass","1");
case 2: DispatchKeyValue(ent,"playerclass","2");
case 3: DispatchKeyValue(ent,"playerclass","3");
case 4: DispatchKeyValue(ent,"playerclass","4");
case 5: DispatchKeyValue(ent,"playerclass","5");
case 6: DispatchKeyValue(ent,"playerclass","6");
case 7: DispatchKeyValue(ent,"playerclass","7");
case 8: DispatchKeyValue(ent,"playerclass","8");
case 9: DispatchKeyValue(ent,"playerclass","9");
case 11: DispatchKeyValue(ent,"playerclass","11");
}
DispatchKeyValue(ent,"angles","-90 0 0")
DispatchKeyValue(ent,"g_a","1")
DispatchKeyValue(ent,"g_e","1")
DispatchKeyValue(ent,"goal_no","0")
DispatchKeyValue(ent,"goal_activation","1")
DispatchKeyValue(ent,"goal_effects","1")
DispatchKeyValue(ent,"goal_result","0")
DispatchKeyValue(ent,"goal_state","2")
DispatchKeyValue(ent,"noise","weapons/scock1.wav")
DispatchKeyValue(ent,"wait","5")


set_pev(ent,pev_origin,items_lowgrav_origin)

dllfunc(DLLFunc_Spawn, ent);
return PLUGIN_HANDLED
}i don t understand :|
please
someone can help me :)?