PDA

View Full Version : CS:S func_rotating


neatek
10-25-2014, 05:13
it's real to get entity: func_rotating?

i tried:
GetClientAimTarget(param, false)
and

for(new i = 0; i < fMaxEntities; i++)
{
if(IsValidEntity(i))
{
GetEntPropVector(i, Prop_Send, "m_vecOrigin", position);
if(GetVectorDistance(position, position2, true) < 200)
{
GetEdictClassname(i, name, sizeof(name));
PrintToChatAll("object: #%s",name);
}
}
}


but it doesnt detect func_rotating...

IceCucumber
10-25-2014, 21:24
Something like this? You could save the entity index(es) in a global variable for use elsewhere.


public OnEntityCreated(entity, const String:classname[])
{
if (StrEqual(classname, "func_rotating"))
{
PrintToServer("I found a func_rotating: %i", entity);
AcceptEntityInput(entity, "kill"); // needs <sdktools>
PrintToServer("It's gone now!");
}
}

Oshizu
10-26-2014, 09:18
Hi,

You could try modifying my code:

new i = -1;
while ((i = FindEntityByClassname(i, "logic_relay")) != -1)
{
if(IsValidEntity(i))
{
decl String:strName[50];
GetEntPropString(i, Prop_Data, "m_iName", strName, sizeof(strName));
if(strcmp(strName, "boss_deploy_relay") == 0)
{
AcceptEntityInput(i, "Trigger");
break;
}
}
}

I had similar issue when i tried to find logic_relay using for loop
It's entity index was '-2063759246' and for loop goes from 0 to 2048 :3