hitmany
03-26-2016, 13:11
Hello!
I need to make a moving sprite which will be in contact with other solid objects. And I need to detect any touch with this entity.
This plugin for CSGO
I tried to move the sprite, but nothing helped.
I decided to use a func_rotating or a prop_physics to move the sprite with SetParent.
Now I am using func_rotating, bcs I cant stop prop_physics fall
new ball = CreateEntityByName("env_sprite_oriented");
new funcrotat = CreateEntityByName("func_rotating");
if(IsValidEntity(ball) && IsValidEntity(funcrotat))
{
new Float:Clientpos[3];
new Float:lookpos[3];
GetClientAbsOrigin(client,Clientpos);
DispatchKeyValue(ball, "model", "materials/sprites/ball.vmt");
DispatchKeyValue(ball, "spawnflags", "1");
DispatchKeyValue(ball, "rendermode", "5");
DispatchKeyValue(funcrotat, "spawnflags", "1");
DispatchKeyValue(funcrotat, "maxspeed", "180");
DispatchKeyValue(funcrotat, "rendermode", "0");
DispatchKeyValue(funcrotat, "renderfx", "0");
DispatchKeyValue(funcrotat, "rendercolor", "0 0 0");
DispatchKeyValue(funcrotat, "renderamt", "0");
//Here was the code for calculate the speed
DispatchSpawn(funcrotat);
DispatchSpawn(ball);
SetVariantString("!activator");
AcceptEntityInput(ball, "SetParent", funcrotat);
HookSingleEntityOutput(ball, "OnStartTouch", OnTouchBall);
SDKHook(funcrotat, OnTrigger, OnStartTouch);
}
public OnTouchFireball(const String:output[], caller, activator, Float:delay) //What data would be in these parameters,
{
//Not working!
}
public OnStartTouch(caller, client)
{
//Working only with player, maybe with entity
}
I saw some plugins use flashbang_projectile to detect touch with wall, maybe we have another way?
I need to make a moving sprite which will be in contact with other solid objects. And I need to detect any touch with this entity.
This plugin for CSGO
I tried to move the sprite, but nothing helped.
I decided to use a func_rotating or a prop_physics to move the sprite with SetParent.
Now I am using func_rotating, bcs I cant stop prop_physics fall
new ball = CreateEntityByName("env_sprite_oriented");
new funcrotat = CreateEntityByName("func_rotating");
if(IsValidEntity(ball) && IsValidEntity(funcrotat))
{
new Float:Clientpos[3];
new Float:lookpos[3];
GetClientAbsOrigin(client,Clientpos);
DispatchKeyValue(ball, "model", "materials/sprites/ball.vmt");
DispatchKeyValue(ball, "spawnflags", "1");
DispatchKeyValue(ball, "rendermode", "5");
DispatchKeyValue(funcrotat, "spawnflags", "1");
DispatchKeyValue(funcrotat, "maxspeed", "180");
DispatchKeyValue(funcrotat, "rendermode", "0");
DispatchKeyValue(funcrotat, "renderfx", "0");
DispatchKeyValue(funcrotat, "rendercolor", "0 0 0");
DispatchKeyValue(funcrotat, "renderamt", "0");
//Here was the code for calculate the speed
DispatchSpawn(funcrotat);
DispatchSpawn(ball);
SetVariantString("!activator");
AcceptEntityInput(ball, "SetParent", funcrotat);
HookSingleEntityOutput(ball, "OnStartTouch", OnTouchBall);
SDKHook(funcrotat, OnTrigger, OnStartTouch);
}
public OnTouchFireball(const String:output[], caller, activator, Float:delay) //What data would be in these parameters,
{
//Not working!
}
public OnStartTouch(caller, client)
{
//Working only with player, maybe with entity
}
I saw some plugins use flashbang_projectile to detect touch with wall, maybe we have another way?