RSSy MYGO.pl Opublikowano Październik 9, 2021 o 12:00 RSSy Udostępnij Opublikowano Październik 9, 2021 o 12:00 Hi I wanted to add how to copy blocks from this mod to base builder 6.5 mode That's all I copied and everything works fine PHP Code: new bool:userClone[33] public plugin_init() { register_impulse(100, "impulseClone") } public impulseClone(id){ userClone[id]=!userClone[id] return PLUGIN_CONTINUE } public fw_PlayerPreThink(id) { if( userClone[id] && g_iOwnedEnt[id] != 0){ new newEnt = createClone(g_iOwnedEnt[id]) if( newEnt != -1 ){ cmdStopEnt(id) g_iOwnedEnt[id]=newEnt } userClone[id]=false } } public fw_Traceline(Float:start[3], Float:end[3], conditions, id, trace) { if( BlockLocker(ent) == 1) return 0 else if( BlockLocker(ent) == 2 ){ new newEnt = createClone(ent) if( newEnt != -1 ){ ent = newEnt; }else return 0; } } public createClone(entView){ new ent=create_entity("func_wall") if( !pev_valid(ent) ){ return -1; } new szClassName[16] pev(entView, pev_classname, szClassName, sizeof(szClassName)) set_pev(ent,pev_classname, szClassName) pev(entView, pev_model, szClassName, sizeof(szClassName)) set_pev(ent,pev_model, szClassName) set_pev(ent,pev_solid, pev(entView, pev_solid)) set_pev(ent,pev_movetype, pev(entView, pev_movetype)) set_pev(ent,pev_modelindex, pev(entView, pev_modelindex)) set_pev(ent,pev_body, pev(entView, pev_body)) set_pev(ent,pev_skin, pev(entView, pev_skin)) set_pev(ent,pev_flags, pev(entView, pev_flags)) set_pev(ent,pev_spawnflags, pev(entView, pev_spawnflags)) set_pev(ent,pev_team, pev(entView, pev_team)) new Float:fFloat[3] pev(entView, pev_mins, fFloat) set_pev(ent, pev_mins, fFloat) pev(entView, pev_maxs, fFloat) set_pev(ent, pev_maxs, fFloat) pev(entView, pev_vuser3, fFloat) set_pev(ent, pev_vuser3, fFloat) pev(entView, pev_vuser1, fFloat) set_pev(ent, pev_vuser1, fFloat) pev(entView, pev_origin, fFloat) entity_set_origin(ent, fFloat) set_pev(ent, pev_iuser4, 3) return ent; } But the problem is I can not delete the copied blocks in the next round I do not understand this part PHP Code: public resetBlocks(){ new szClass[10], szTarget[7]; new Float:fOrigin[3]; for(new ent=maxPlayers; ent<maxEnts;ent ++){ if( !pev_valid(ent) ) continue; if( ent == gBarrier ) continue; entity_get_string(ent, EV_SZ_classname, szClass, sizeof(szClass)); entity_get_string(ent, EV_SZ_targetname, szTarget, sizeof(szTarget)); if( !equal(szClass, "func_wall") || containi(szTarget, "ignore") !=-1 || equal(szTarget, "barrier")) continue; unSetBlock( ent ); if( getLock(ent) == 3 ) remove_entity(ent); else if(getLock(ent) == 2){ entity_get_vector(ent, EV_VEC_vuser3, fOrigin ); entity_set_vector(ent, EV_VEC_vuser4, fOrigin ); engfunc( EngFunc_SetOrigin, ent, fOrigin ); }else{ engfunc( EngFunc_SetOrigin, ent, Float:{0.0,0.0,0.0} ); set_pev(ent,pev_rendermode,kRenderNormal); set_pev(ent,pev_rendercolor, Float:{ 0.0, 0.0, 0.0 }); set_pev(ent,pev_renderamt, 255.0 ); } } return PLUGIN_CONTINUE; } Which I must add to this section PHP Code: public ev_RoundStart() { remove_task(TASK_BUILD) remove_task(TASK_PREPTIME) arrayset(g_iOwnedEntities, 0, MAXPLAYERS+1) arrayset(g_iColor, 0, MAXPLAYERS+1) arrayset(g_iColorOwner, 0, MAX_COLORS) arrayset(g_boolRepick, true, MAXPLAYERS+1) g_boolRoundEnded = false g_boolCanBuild = true g_fRoundStartTime = get_gametime() if (g_iResetEnt) { new szClass[10], szTarget[7]; for (new iEnt = g_iMaxPlayers+1; iEnt < MAXENTS; iEnt++) { if (is_valid_ent(iEnt)) entity_get_string(iEnt, EV_SZ_classname, szClass, 9); entity_get_string(iEnt, EV_SZ_targetname, szTarget, 6); if (!BlockLocker(iEnt) && iEnt != g_iEntBarrier && equal(szClass, "func_wall") && !equal(szTarget, "ignore")) { set_pev(iEnt,pev_rendermode,kRenderNormal) engfunc( EngFunc_SetOrigin, iEnt, Float:{ 0.0, 0.0, 0.0 } ); UnsetLastMover(iEnt); UnsetEntMover(iEnt); } else if (g_iLockBlocks && BlockLocker(iEnt)) { UnlockBlock(iEnt) set_pev(iEnt,pev_rendermode,kRenderNormal) engfunc( EngFunc_SetOrigin, iEnt, Float:{ 0.0, 0.0, 0.0 } ); UnsetLastMover(iEnt); UnsetEntMover(iEnt); } } } } Przeczytaj cały wpis Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi