So basically what I really want to do is make the same change to all entities on all maps on the server. I am trying to change the value of the OrientationType on both the classnames func_tanktrain and path_track to a value of 0.
However, I am really new to SM coding, but I really did my best. However, it ended up being more advanced than it had to, and it might be the cause I get an error on compile.
The error is: :
Code:
error 017: undefined symbol "EntIndex"
I don't know how this can not be a defined symbol, as everywhere I have looked it is.
Here are my source code.
Code:
public OnPluginStart()
{
RegConsoleCmd("sm_spinfix", commandfixent, "");
}
public Action:commandfixent(client, args)
{
new ent = GetClientAimTarget(client, false);
if(ent != -1 && IsValidEntity(ent))
{
new String:classname[32];
GetEdictClassname(ent, classname, 32);
if(StrContains(classname, "tanktrain") != -1)
{
DispatchKeyValueFloat(EntIndex, "orientationtype", 0.0);
} else {
ReplyToCommand(client,"You're not aiming at a bug!") ;
}
}
else
{
ReplyToCommand(client,"Please aim at a entity") ;
}
return Plugin_Handled;
}
An easier way would be to just delete all that extra stuff about aiming at the entity, but rather just apply it to all the tanktrain and path_track entities so that every one of those entities on every map always have that setting.
I am sorry if I am unclear, this is my first try at creating something useful.
Thanks a lot.