AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   set_user_rendering [SOLVED] (https://forums.alliedmods.net/showthread.php?t=56196)

Def 06-08-2007 16:12

set_user_rendering [SOLVED]
 
Hello everyone.:)

I have a problem with setting player invisible, here is the code:

Code:

public eventPlayerSpawn(id) {
    if(is_user_connected(id)) { 
        if(INVLVL > 0) {
            set_user_rendering(id,kRenderFxNone,0,0,0,kRenderTransTexture,255 - INVLVL * 40);
            client_print(id,print_chat,"TEST WORKING %i",INVLVL);
        }
    }
}

This is just a part of a code. Then i spawn i get the message "TEST WORKING 5" but I'm still totaly visible. Where can be a problem ?

Thanks in advice!

Oskar 06-08-2007 16:16

Re: set_user_rendering
 
public eventPlayerSpawn(id) {
if(is_user_connected(id)) {
if(INVLVL > 0) {
set_user_rendering(id,kRenderFxNone,0,0,0,kRe nderTransTexture,255 - INVLVL * 40);
client_print(id,print_chat,"TEST WORKING %i",INVLVL);
}
}
}

Def 06-08-2007 16:39

Re: set_user_rendering
 
Oops, i've prolly deleted ) when posted code here. In the .sma is everyhing ok.

Def 06-09-2007 03:02

Re: set_user_rendering
 
So anybody knows a solution ?

regalis 06-09-2007 04:24

Re: set_user_rendering
 
Try this:
Code:

set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255 - INVLVL * 40)
greetz regalis

Def 06-09-2007 08:39

Re: set_user_rendering
 
Quote:

Originally Posted by regalis (Post 487300)
Try this:
Code:

set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255 - INVLVL * 40)
greetz regalis

It's not working too:cry: The wierd thing is that when I buy that invisibility skill i become invisible with the same command, but it's not working in newRound event.

regalis 06-09-2007 08:51

Re: set_user_rendering
 
Then you should test if it works on player spawn (resetHud event)
Maybe add a little delay (set_task(0.2, ....)

greetz regalis

Def 06-09-2007 09:13

Re: set_user_rendering
 
Quote:

Originally Posted by regalis (Post 487361)
Then you should test if it works on player spawn (resetHud event)
Maybe add a little delay (set_task(0.2, ....)

greetz regalis

I've tried to put 1.0 sec delay and now it says in the server console "[FUN] Player out of range (0)".

Def 06-09-2007 09:44

Re: set_user_rendering
 
Oh, i've just forgot to type ",id" at the end of the set_task, now it doesnt give any error BUT it doesnt make me invisible aswell:|

Def 06-09-2007 10:07

Re: set_user_rendering
 
I saw some guy wrote that this function(set_user_rendering) doesn't work in the events, you have to use it with commands. So how I can make a player invisible every new round ?

P.S. I was thinking about forcing user to use a command, but I don't really know how to do that. Anyone can help me ? Or I would like to make that u become invisible only when you use a knife, but I dunno what event I should use.


All times are GMT -4. The time now is 10:35.

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