AlliedModders

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

Troi 10-09-2007 03:12

Visuals
 
Ahh damn i were in wrong forum.. Hey, how to make glowing players only for one player?

something is wrong here ..... I guess everything :D
PHP Code:

public otherplayers(id) {
    if(
is_user_alive(id)) {
        if(
isview[id]!=1) {
            
set_user_rendering(idkRenderFxGlowShell255255 ,255kRenderGlow30)
        } else {
            
set_user_rendering(idkRenderFxNone0,0kRenderNormal255)            
        }
    }



Wilson [29th ID] 10-09-2007 03:44

Re: Visuals
 
Man, I sware there was a topic just like this like a month ago, but I can't find it. If anyone knows where it is, please link it.

Anyway, for something this complex, you will have to hook AddToFullPack. There are two parameters that will guide you in that hook - ent, and host. Host is the viewer, and ent is who is being viewed.

Make sure you check that the arg "player" is true.

It'll look something like this...

Code:
public plugin_init() {    register_forward( FM_AddToFullPack, "hook_AddToFullPack_post", 1 ); } public hook_AddToFullPack_post( es_handle,e,ent,host,hostflags,player,pSet ) {    if( !player ) return FMRES_IGNORED;    if( host == person you want to be viewing && ent == person you want to be viewed )    {       // Make him glow...you can do this more proficiently with set_es()    }    return FMRES_IGNORED; }

Troi 10-10-2007 06:22

Re: Visuals
 
Whitch module have to be included if i want use "register_forward" ?

purple_pixie 10-10-2007 06:28

Re: Visuals
 
Fakemeta.

Troi 10-10-2007 08:02

Re: Visuals
 
Undefined symbol "FM_AddToFullPack"

Is there any other more simlpe way to make that rendering?

purple_pixie 10-10-2007 08:17

Re: Visuals
 
Nope.

FM_AddToFullPack is defined it fakemeta_const.inc, which is included by fakemeta.inc ...

You did include it with:
PHP Code:

#include <fakemeta> 

and not something slightly different right?

Wait ... register_forward() would be undefined otherwise.

Troi 10-10-2007 16:05

Re: Visuals
 
By the way. I always wanted to ask, but im shy couse its very noooobish... what means and what does that thing when writing

PHP Code:

public kasnors(id) {
new 
view[33]
new 
msg[51]
//codes...
//and etc....


I understand that is some constants.... Witch are using somewhere

and when using

PHP Code:

return PLUGIN_HANDLED
return PLUGIN_CONTINUE 

sry for that questions.... But it bothered me a long time...

By the way, is that usage correct?

PHP Code:

 public hook_AddToFullPack_postes_handle,e,ent,host,hostflags,player,pSet ) {
    if( !
player ) return FMRES_IGNORED
    
    
if( host == alien[32] && ent == human[32] ) {
        
set_user_rendering(playerkRenderFxGlowShell080255kRenderTransAlpha200)
    }
    if( 
host == alien[32] && ent == predator[32] ) {
        
set_user_rendering(playerkRenderFxGlowShell02550kRenderTransAlpha200)
    }
    if( 
host == alien[32] && ent == alien[32] ) {
        
set_user_rendering(playerkRenderFxGlowShell25500kRenderTransAlpha200)
    }
    return 
FMRES_IGNORED



purple_pixie 10-11-2007 04:33

Re: Visuals
 
PHP Code:

public kasnors(id) {
new 
view[33]
new 
msg[51]
//codes...
//and etc....


Well those two arrays ( view and msg ) actually only exist while the code is inside the function "kasnors", and they aren't constant.

What was it exactly you didn't get? Variables in general or what?

If it's PAWN in general you don't get, then there are some tutorials about.

return PLUGIN_HANDLED means that after your function has run, the game knows you did something.

return PLUGIN_CONTINUE tells the game to pretend your function never ran.

see the following:

PHP Code:

plugin_init()
{
    
register_clcmd("command","on_command")
}
public 
on_command(id)
{
    return 
PLUGIN_HANDLED ;


when a user puts "command" in their console, nothing will happen.
(the code does nothing except tell the game that you "did" the command)

If we change the PLUGIN_HANDLED to PLUGIN_CONTINUE, the console would say "unrecognised command: command" or whatever, because you told the game that you didn't handle it.


All times are GMT -4. The time now is 16:13.

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