AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Code, that does tray after player (https://forums.alliedmods.net/showthread.php?t=215451)

danonix 05-08-2013 01:33

Code, that does tray after player
 
Hello,

Could someone help me with cut function from there http://forums.alliedmods.net/showthread.php?t=19328, or make new one which does trail after player - need it in green, yellow, blue, violet, orange, white and black. I can't get, which code does it. I need it, because I want to do trail after player in other plugin.

I don't want whole plugin, because it would be too long. I just need function, that respond for writing for example black tray after player.

Thanks very much.

Cheers

wickedd 05-08-2013 01:48

Re: Code, that does tray after player
 
Here you go.

Kia 05-08-2013 10:01

Re: Code, that does tray after player
 
PHP Code:

public Util_TE_BEAMFOLLOW(identityspritelifewidthredgreenbluebrightness

    
message_begin(id MSG_ONE MSG_ALLSVC_TEMPENTITY_id); 
    
write_byte(TE_BEAMFOLLOW); 
    
write_short(entity); 
    
write_short(sprite); 
    
write_byte(life); // life in 0.1's 
    
write_byte(width); // line width in 0.1's 
    
write_byte(red); 
    
write_byte(green); 
    
write_byte(blue); 
    
write_byte(brightness); 
    
message_end(); 



danonix 05-08-2013 11:42

Re: Code, that does tray after player
 
Thank you very much Kia! Got only one question, what should I enter for sprite? Because I have got no idea. Tried to enter sprite, tried to define new things, got argument mismatch.

Thanks!

Kia 05-08-2013 11:51

Re: Code, that does tray after player
 
PHP Code:

new const szSprite[] = "sprites/wasabi.spr" 

.
.
.
PHP Code:

precache_model(szSprite

.
.
.
PHP Code:

write_short(szSprite


danonix 05-08-2013 12:02

Re: Code, that does tray after player
 
Could you tell me what im doing wrong? Thanks you very much for your help, I have just got no idea what's wrong
Code:

new sprite
new const szSprite[] = "sprites/laserbeam.spr"
....
precache_model(szSprite)
....
Util_TE_BEAMFOLLOW(player, id, sprite, 20, 5, 0, 255, 0, 100)
....
public Util_TE_BEAMFOLLOW(id, entity, sprite, life, width, red, green, blue, brightness)
{
    message_begin(id ? MSG_ONE : MSG_ALL, SVC_TEMPENTITY, _, id);
    write_byte(TE_BEAMFOLLOW);
    write_short(entity);
    write_short(szSprite);
    write_byte(life);
    write_byte(width);
    write_byte(red);
    write_byte(green);
    write_byte(blue);
    write_byte(brightness);
    message_end();
}


Backstabnoob 05-08-2013 12:03

Re: Code, that does tray after player
 
Quote:

Originally Posted by Kia (Post 1948162)
PHP Code:

new const szSprite[] = "sprites/wasabi.spr" 

.
.
.
PHP Code:

precache_model(szSprite

.
.
.
PHP Code:

write_short(szSprite


Um, you are aware that szSprite is a string, not short right?

Not sure but I think it needs the sprite index instead.

Code:
new const szSprite[ ] = "sprites/wasabi.spr" new iSprIndex public plugin_precache( ) {     iSprIndex = precache_model( szSprite ) } write_short( iSprIndex )

danonix 05-08-2013 12:30

Re: Code, that does tray after player
 
Ok, there are no errors now in compilation, thanks, will tell if it works!

Thanks one more time

Kia 05-08-2013 12:39

AW: Code, that does tray after player
 
Don't forget that the trail will only last as long as you specify in the parameter, to continue it you need to make a task.

danonix 05-08-2013 12:51

Re: Code, that does tray after player
 
Everything works perfectly, you are great guys!

Thank you very much, have a nice day!


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

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