Quote:
Originally Posted by minimoney1
Use the "Shake" usermessage
|
okay, i will try... thx , but i know it...
PHP Code:
public OnPluginStart()
{
HookEvent("player_blind", nK_FlashBang);
}
public nK_FlashBang(Handle:Event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(Event,"userid"));
CreateTimer(4.0, ShakeCamera, client);
}
public Action:ShakeCamera(Handle:timer, any:client)
{
if(Client_IsIngame(client) && Client_IsValid(client))
{
ScreenShake(client, 50.0, 6.0, 0.1);
}
}
stock ScreenShake(target, Float:intensity=30.0, Float:duration=10.0, Float:frequency=3.0)
{
new Handle:bf;
if ((bf = StartMessageOne("Shake", target)) != INVALID_HANDLE)
{
BfWriteByte(bf, 0);
BfWriteFloat(bf, intensity);
BfWriteFloat(bf, duration);
BfWriteFloat(bf, frequency);
EndMessage();
}
}
What values for the frequency and others need to be?
__________________