AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Semiclip problems (https://forums.alliedmods.net/showthread.php?t=184403)

Enomine 05-04-2012 21:57

Semiclip problems
 
I've edited the semiclip by connor, but I have some mistakes, sometimes semiclip doesn't work or players get stucked for a while... and map entitys doesn't work too u.u...

What I must do to a great work with no bugs, and how I can set 50% of transparency of the players.

Code:
#include <amxmodx> #include <engine> #include <fakemeta> /* Definition */ #define RefreshPlayersList()        get_players(iPlayers,iNum,szAliveFlags) /* Players */ new iPlayers[32]; new iNum,iPlayer,i; new const szAliveFlags[] = "a"; /* Spectator */ new isSpectating[33]; public plugin_init() {     /* Plugin Registration */     register_plugin("Semiclip", "1.0", "Enomine");         /* Forwards */     register_forward(FM_AddToFullPack, "fwdAddToFullPack", 1);     register_forward(FM_PlayerPreThink, "fwdPlayerPreThink", 1);     register_forward(FM_PlayerPostThink, "fwdPlayerPostThink", 1); } public fwdAddToFullPack(Es,E,iEnt,id,Hostflags,Player,pSet) {     if(Player && id != iEnt)     {         if(iEnt != isSpectating[id])             entity_set_int(Es, EV_INT_solid, SOLID_NOT);     } } public fwdPlayerPreThink(id) {     RefreshPlayersList();         for(i = 0;i < iNum;i++)     {         iPlayer = iPlayers[i];                 if(id != iPlayer)             entity_set_int(iPlayer, EV_INT_solid, SOLID_NOT);     }         if(!is_user_alive(id))         isSpectating[id] = entity_get_int(id, EV_INT_iuser2); } public fwdPlayerPostThink(id) {     RefreshPlayersList();         for(i = 0;i < iNum;i++)     {         iPlayer = iPlayers[i];                 if(id != iPlayer)             entity_set_int(iPlayer, EV_INT_solid, SOLID_SLIDEBOX);     }   }

sorry for my bad english.

ConnorMcLeod 05-05-2012 09:55

Re: Semiclip problems
 
In AddToFullPack you have to use set_es(Es, ES_Solid, SOLID_NOT)

Es is the entity state that is sent from server to player, it is not the real entity var value, with entity_set_int you are setting a real (server) entity variable.

Enomine 05-07-2012 08:33

Re: Semiclip problems
 
Thanks!


All times are GMT -4. The time now is 00:29.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.