PDA

View Full Version : [CS:GO] Fade support


iGANGNAM
10-21-2014, 11:51
I found that fade should be supported, but why it don't work for me?


for example


... in some deep function :D
Fade( enemy, 6, 7, 0, 255, 100, 210);
....

and here it goes

public Fade(client , duration , time , r, g, b, a )
{
new Handle:hBf=StartMessageOne("Fade",client);
if(hBf!=INVALID_HANDLE)
{
duration= duration * 400;
time = time *400;
BfWriteShort(hBf,duration); // duration time in seconds
BfWriteShort(hBf,time); // hold time in seconds
BfWriteShort(hBf,FADE_IN);
BfWriteByte(hBf, r);
BfWriteByte(hBf, g);
BfWriteByte(hBf, b);
BfWriteByte(hBf, a);
EndMessage();
}
}

Michalplyoutube
10-21-2014, 12:09
I found that fade should be supported, but why it don't work for me?


for example


... in some deep function :D
Fade( enemy, 6, 7, 0, 255, 100, 210);
....

and here it goes

public Fade(client , duration , time , r, g, b, a )
{
new Handle:hBf=StartMessageOne("Fade",client);
if(hBf!=INVALID_HANDLE)
{
duration= duration * 400;
time = time *400;
BfWriteShort(hBf,duration); // duration time in seconds
BfWriteShort(hBf,time); // hold time in seconds
BfWriteShort(hBf,FADE_IN);
BfWriteByte(hBf, r);
BfWriteByte(hBf, g);
BfWriteByte(hBf, b);
BfWriteByte(hBf, a);
EndMessage();
}
}


enemy is not defined?
its should be client

Mitchell
10-21-2014, 12:24
https://wiki.alliedmods.net/Counter-Strike:_Global_Offensive_UserMessages#Fade

The duration/time show as ints not shorts.

Hes an example for shaking the player's screen:

stock ClientShake(client, Float:Amp=1.0)
{
new Handle:message = StartMessageOne("Shake", client, 1);
PbSetInt(message, "command", 0);
PbSetFloat(message, "local_amplitude", Amp);
PbSetFloat(message, "frequency", 255.0);
PbSetFloat(message, "duration", 5.0);
EndMessage();
}


btw Michalplyoutube, you don't need the same named variable to pass it into a function.

iGANGNAM
10-21-2014, 12:31
enemy is not defined?
its should be client
It doesn't matter how it named, I have 2 players in that function....
https://wiki.alliedmods.net/Counter-Strike:_Global_Offensive_UserMessages#Fade

The duration/time show as ints not shorts.

Hes an example for shaking the player's screen:

stock ClientShake(client, Float:Amp=1.0)
{
new Handle:message = StartMessageOne("Shake", client, 1);
PbSetInt(message, "command", 0);
PbSetFloat(message, "local_amplitude", Amp);
PbSetFloat(message, "frequency", 255.0);
PbSetFloat(message, "duration", 5.0);
EndMessage();
}
btw Michalplyoutube, you don't need the same named variable to pass it into a function.

What is short? I definetly use int numbers :? fade is not shake by the way...

Mitchell
10-21-2014, 13:42
It doesn't matter how it named, I have 2 players in that function....


What is short? I definetly use int numbers :? fade is not shake by the way...

You are using: BfWriteShort instead of BfWriteInt
I never said Shake was the same as Fade.

iGANGNAM
10-21-2014, 14:28
You are using: BfWriteShort instead of BfWriteInt
I never said Shake was the same as Fade.

nvm I found this function https://forums.alliedmods.net/showthread.php?p=2213570

Powerlord
10-21-2014, 16:59
CS:GO doesn't use BitBuffer usermessages... it uses ProtoBuf (https://wiki.alliedmods.net/Protobuf) usermessages instead.

Mitchell
10-21-2014, 17:38
CS:GO doesn't use BitBuffer usermessages... it uses ProtoBuf (https://wiki.alliedmods.net/Protobuf) usermessages instead.

thats what i meant lol. whoops.

iGANGNAM
10-22-2014, 01:00
Problem solved, thank you!