Raised This Month: $ Target: $400
 0% 

Light on func_targer model entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarthMan
Veteran Member
Join Date: Aug 2011
Old 02-26-2017 , 05:21   Light on func_targer model entity
Reply With Quote #1

Hello. For the info_target entity, how can I make the model to be brighter ?
I mean that after the task is executed, the model should be brighter than it was before.
The entity uses a variable ent_info_target so it should look for that 1 and set the light.

Code:
entity_set_model(ent_info_target, model_path)
This code sets the model of the entity, and the model_path is defined to look for the map name and set the model according to the name of the map but I failed at making it brighter on task execution.
Thanks !
DarthMan is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 02-26-2017 , 05:50   Re: Light on func_targer model entity
Reply With Quote #2

Not sure if this will help, but here u go:
Code:
#include <amxmodx> #include <fakemeta> //#include <hamsandwich> //#include <D7Debug> public plugin_init() {     register_plugin("D7 Render Entities Map", "0.0.5", "D i 5 7 i n c T")         set_pev(0, pev_rendermode, kRenderTransTexture);     set_pev(0, pev_renderamt, 128.0)         new iIDEnt = -1, iSzLenght;         while ((iIDEnt = engfunc(EngFunc_FindEntityInSphere, iIDEnt, Float:{ 0.0, 0.0, 0.0 }, 9000.0)) != 0)     {         if (!pev_valid(iIDEnt))             continue;                 static szEntInfo[32];         pev(iIDEnt, pev_classname, szEntInfo, charsmax(szEntInfo))                 //ftD7Log(_, _, "[plugin_init] iIDEnt: %d. Class name: ^"%s^".", iIDEnt, szEntInfo)                 pev(iIDEnt, pev_model, szEntInfo, charsmax(szEntInfo))                 //ftD7Log(_, _, "[plugin_init] iIDEnt: %d. Model: ^"%s^".^n", iIDEnt, szEntInfo)                 if (szEntInfo[0] != '*')         {             iSzLenght = strlen(szEntInfo);                         if (iSzLenght < 4)                 continue;                         if (equali(szEntInfo[iSzLenght - 4], ".mdl"))             {                 set_pev(iIDEnt, pev_rendermode, kRenderNormal)                 set_pev(iIDEnt, pev_renderfx, kRenderFxGlowShell)                 set_pev(iIDEnt, pev_rendercolor, Float:{ 255.0, 255.0, 255.0 })                 set_pev(iIDEnt, pev_renderamt, 15.0)             }             else if (equali(szEntInfo[iSzLenght - 4], ".spr"))             {                 set_pev(iIDEnt, pev_renderamt, 191.0)             }         }         else         {             set_pev(iIDEnt, pev_rendermode, kRenderTransTexture);             set_pev(iIDEnt, pev_renderamt, 128.0)         }     } }
Attached Files
File Type: sma Get Plugin or Get Source (D7RenderEntitiesMap.sma - 482 views - 1.4 KB)
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-26-2017 , 05:52   Re: Light on func_targer model entity
Reply With Quote #3

Quote:
Originally Posted by georgik57 View Post
Not sure if this will help, but here u go:
Code:
#include <amxmodx> #include <fakemeta> //#include <hamsandwich> //#include <D7Debug> public plugin_init() {     register_plugin("D7 Render Entities Map", "0.0.5", "D i 5 7 i n c T")         set_pev(0, pev_rendermode, kRenderTransTexture);     set_pev(0, pev_renderamt, 128.0)         new iIDEnt = -1, iSzLenght;         while ((iIDEnt = engfunc(EngFunc_FindEntityInSphere, iIDEnt, Float:{ 0.0, 0.0, 0.0 }, 9000.0)) != 0)     {         if (!pev_valid(iIDEnt))             continue;                 static szEntInfo[32];         pev(iIDEnt, pev_classname, szEntInfo, charsmax(szEntInfo))                 //ftD7Log(_, _, "[plugin_init] iIDEnt: %d. Class name: ^"%s^".", iIDEnt, szEntInfo)                 pev(iIDEnt, pev_model, szEntInfo, charsmax(szEntInfo))                 //ftD7Log(_, _, "[plugin_init] iIDEnt: %d. Model: ^"%s^".^n", iIDEnt, szEntInfo)                 if (szEntInfo[0] != '*')         {             iSzLenght = strlen(szEntInfo);                         if (iSzLenght < 4)                 continue;                         if (equali(szEntInfo[iSzLenght - 4], ".mdl"))             {                 set_pev(iIDEnt, pev_rendermode, kRenderNormal)                 set_pev(iIDEnt, pev_renderfx, kRenderFxGlowShell)                 set_pev(iIDEnt, pev_rendercolor, Float:{ 255.0, 255.0, 255.0 })                 set_pev(iIDEnt, pev_renderamt, 15.0)             }             else if (equali(szEntInfo[iSzLenght - 4], ".spr"))             {                 set_pev(iIDEnt, pev_renderamt, 191.0)             }         }         else         {             set_pev(iIDEnt, pev_rendermode, kRenderTransTexture);             set_pev(iIDEnt, pev_renderamt, 128.0)         }     } }
Declare iIDEnt as static.
__________________
edon1337 is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 02-26-2017 , 06:26   Re: Light on func_targer model entity
Reply With Quote #4

Quote:
Originally Posted by georgik57 View Post
Not sure if this will help, but here u go:
Code:
#include <amxmodx> #include <fakemeta> //#include <hamsandwich> //#include <D7Debug> public plugin_init() {     register_plugin("D7 Render Entities Map", "0.0.5", "D i 5 7 i n c T")         set_pev(0, pev_rendermode, kRenderTransTexture);     set_pev(0, pev_renderamt, 128.0)         new iIDEnt = -1, iSzLenght;         while ((iIDEnt = engfunc(EngFunc_FindEntityInSphere, iIDEnt, Float:{ 0.0, 0.0, 0.0 }, 9000.0)) != 0)     {         if (!pev_valid(iIDEnt))             continue;                 static szEntInfo[32];         pev(iIDEnt, pev_classname, szEntInfo, charsmax(szEntInfo))                 //ftD7Log(_, _, "[plugin_init] iIDEnt: %d. Class name: ^"%s^".", iIDEnt, szEntInfo)                 pev(iIDEnt, pev_model, szEntInfo, charsmax(szEntInfo))                 //ftD7Log(_, _, "[plugin_init] iIDEnt: %d. Model: ^"%s^".^n", iIDEnt, szEntInfo)                 if (szEntInfo[0] != '*')         {             iSzLenght = strlen(szEntInfo);                         if (iSzLenght < 4)                 continue;                         if (equali(szEntInfo[iSzLenght - 4], ".mdl"))             {                 set_pev(iIDEnt, pev_rendermode, kRenderNormal)                 set_pev(iIDEnt, pev_renderfx, kRenderFxGlowShell)                 set_pev(iIDEnt, pev_rendercolor, Float:{ 255.0, 255.0, 255.0 })                 set_pev(iIDEnt, pev_renderamt, 15.0)             }             else if (equali(szEntInfo[iSzLenght - 4], ".spr"))             {                 set_pev(iIDEnt, pev_renderamt, 191.0)             }         }         else         {             set_pev(iIDEnt, pev_rendermode, kRenderTransTexture);             set_pev(iIDEnt, pev_renderamt, 128.0)         }     } }
It doesn't work fine, should find every info_target entities only and make them brighter.
What it does now is that it shows white colors brighted 100% for a few secs, they dissapear and appear on other places. It should light every single info_target entity constantly and u should see the entity not a white background image. Also i don't want the image color to glow, i want it to be static.

Last edited by DarthMan; 02-26-2017 at 06:36.
DarthMan is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 02-26-2017 , 06:38   Re: Light on func_targer model entity
Reply With Quote #5

Quote:
Originally Posted by edon1337 View Post
Declare iIDEnt as static.
Why?
__________________
HamletEagle is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 02-26-2017 , 07:02   Re: Light on func_targer model entity
Reply With Quote #6

Quote:
Originally Posted by DarthMan View Post
It doesn't work fine, should find every info_target entities only and make them brighter.
What it does now is that it shows white colors brighted 100% for a few secs, they dissapear and appear on other places. It should light every single info_target entity constantly and u should see the entity not a white background image. Also i don't want the image color to glow, i want it to be static.
I didn't say it does exactly what you want. I gave it to you as an example.
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-26-2017 , 07:10   Re: Light on func_targer model entity
Reply With Quote #7

Quote:
Originally Posted by HamletEagle View Post
Why?
Because of the while loop?
__________________
edon1337 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 02-26-2017 , 07:43   Re: Light on func_targer model entity
Reply With Quote #8

Is iIDEnt declared in the loop? No.
__________________
HamletEagle is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-26-2017 , 07:46   Re: Light on func_targer model entity
Reply With Quote #9

Quote:
Originally Posted by HamletEagle View Post
Is iIDEnt declared in the loop? No.
But it's used in the loop, so it will be called until loop returns true.
__________________
edon1337 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-26-2017 , 08:29   Re: Light on func_targer model entity
Reply With Quote #10

You're misunderstanding the purpose of "static". It means just that unlike 'new', the variable is not initialized and the value will remain after the function is executed.
You don't need that in the current context.

You can read the Pawn Language Guide about static local declaration

:
__________________

Last edited by Arkshine; 02-26-2017 at 08:30.
Arkshine is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:34.


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