Ok, tnx. I have 2 more q, is sound emitted with client_cmd( id , spk...) heard by everyone or just that player, and is it ok to remove is_valid_ent check if i change
PHP Code:
public pfn_touch(ptr,ptd) {
if(!is_valid_ent(ptd)) { // invalid toucher
return PLUGIN_CONTINUE;
}
// now check for more invalid entities or players
if(!is_valid_ent(ptr) || !is_valid_ent(ptd) || !is_user_connected(ptd)) {
return PLUGIN_CONTINUE;
}
new classname[32];
entity_get_string(ptr,EV_SZ_classname,classname,31); // get name of touched
if(equal(classname,g_ent_classname)) {
// ASSIGN OWNER TO QUAD
g_quad_owner = ptd
// REMOVE ENTRY
remove_entity(ptr);
// enable quad for user
quad_enable(ptd);
return PLUGIN_CONTINUE;
}
return PLUGIN_CONTINUE;
}
with
PHP Code:
register_touch("dm_quad","player","touched")
public touched(quad,id)
{
if(!is_valid_ent(quad) || !is_valid_ent(id) || !is_user_connected(id))
{
return PLUGIN_CONTINUE;
}
// ASSIGN OWNER TO QUAD
g_quad_owner = id
// REMOVE ENTRY
remove_entity(quad);
// enable quad for user
quad_enable(id);
return PLUGIN_CONTINUE;
}
__________________