Dobry wieczór, mam problem z warunkiem if(equal(szClassEnt_2, "func_wall")), gdy daje blok w bariere to nic się nie dzieje, natomiast granat normalnie działa jak rzucam w bariere to odrzuca i printuje wiadomość.
Fragment pluginu pochodzi z pluginu na bariery z paczki BaseBuilder Turbo(najnowsza wersja na github)
Amxx - 1.9.0.5271, wszystkie moduły odblokowane
public fwd_touch(toucher, touched){
if( !pev_valid(toucher) || !pev_valid(touched) || touched == 0 || toucher == 0 )
return PLUGIN_CONTINUE
new szClassEnt_1[33], szClassEnt_2[33]
pev(toucher, pev_classname, szClassEnt_1, sizeof(szClassEnt_1) )
pev(touched, pev_classname, szClassEnt_2, sizeof(szClassEnt_2) )
if( entity_get_int(toucher, EV_INT_solid) != SOLID_TRIGGER )
return PLUGIN_CONTINUE
if( equal(szClassEnt_1, "blockBarrier") ){
if( equal(szClassEnt_2, "grenade") ){
ColorChat(0, GREEN, "proszę nie rzucac granatem na spawna");
if( pev(touched, pev_iuser1) == 0){
new Float:fVelocity[3]
pev(touched, pev_velocity, fVelocity)
fVelocity[0] *= -1;
fVelocity[1] *= -1;
fVelocity[2] *= -1;
set_pev(touched, pev_velocity, fVelocity)
set_pev(touched, pev_iuser1, 1)
}
}
if(equal(szClassEnt_2, "player")){
if( get_user_team(touched) == 1 && is_user_alive(touched)){
if( task_exists(touched+TASK_GOD) ){
remove_task(touched+TASK_GOD)
}
set_task(0.1, "offBarrierGod", touched+TASK_GOD)
userIsInBarrier[touched]=true
}
}
if(equal(szClassEnt_2, "func_wall")){
ColorChat(0, GREEN, "proszę nie blokowac spawnu");
}
}
if( !equal(szClassEnt_1, "blockBarrier") && !equal(szClassEnt_1, "func_wall"))
return PLUGIN_CONTINUE
if( !equal(szClassEnt_2, "func_wall") ){
return PLUGIN_CONTINUE
}
if( equal(szClassEnt_2, "func_wall" ) && equal(szClassEnt_1, "func_wall") && getLock(toucher) != 2)
return PLUGIN_CONTINUE
if( getOwner(touched) != 0 ){ // -- TO NIE DZIAŁA XD --
ColorChat(0, GREEN, "przeszlo przez warunek ownera");
if( getMover(touched) ){ //0
ColorChat(0, GREEN, "przeszlo przez warunek movera");
new Float:fOrigin[3]
entity_get_vector(touched, EV_VEC_vuser4, fOrigin)
if( fOrigin[0] != 0.0 || fOrigin[1] != 0.0 || fOrigin[2] != 0.0 ){
ColorChat(getLastMover(touched), GREEN, "---^x01 Klocek cofniety!^x04 |^x01 Nie wsadzaj klocka w bariere!^x04 ---")
entity_set_origin(touched, fOrigin)
}else{
//bb_set_claimed(getOwner(touched), bb_get_claimed(getOwner(touched))-1)
if( getLock(touched) == 3 ){
new szClass[10], szTarget[7];
entity_get_string(touched, EV_SZ_classname, szClass, 9);
entity_get_string(touched, EV_SZ_targetname, szTarget, 6);
if( !equal(szClass, "func_wall"))
return PLUGIN_CONTINUE
if( equal(szTarget, "ignore") )
return PLUGIN_CONTINUE
if( equal(szTarget, "barrier") )
return PLUGIN_CONTINUE
if( equal(szClass, "blockBarrier") )
return PLUGIN_CONTINUE
remove_entity(touched)
}else{
set_pev(touched, pev_iuser1, 0)
entity_set_origin(touched, Float:{0.0,0.0,0.0});
}
}
}else{
set_pev(touched,pev_rendermode,kRenderTransColor)
set_pev(touched,pev_rendercolor, Float:{255.0,0.0,0.0} )
set_pev(touched,pev_renderamt, 255.0 )
set_task(0.1, "checkRemove", touched)
}
}
return PLUGIN_CONTINUE
}


Dodatki SourceMod












