public Event_RoundChange(Handle:event, String:name[], bool:dontBroadcast)
public Event_RoundChange(Handle:event, String:name[], bool:dontBroadcast)
{
{
PortalUseDelay = false;
PortalUseDelay = false;
PortalSeperated = false;
PortalSeperated = false;
PortalsActive = false;
//PortalsActive = false;
}
}
public Action:Start_Portal(client, args)
public Action:Start_Portal(client, args)
{
{
//PrintToChat(client,"portals started");
//PrintToChat(client,"portals started");
if (!PortalsActive)
//good idea to kill them when starting again or you will have an entity leak and other touch hooked portal entities will interfere that were not killed.
if(IsValidEntRef(BluePortal))
{
{
decl Float:pos[3];
AcceptEntityInput(BluePortal , "Kill" );
decl Float:ang[3];
}
GetClientAbsOrigin(client, pos);
if(IsValidEntRef(RedPortal))
GetClientEyeAngles(client, ang);
{
AcceptEntityInput(RedPortal , "Kill" );
ang[0] = NULL_VECTOR[0];
}
ang[2] = NULL_VECTOR[2];
new Blue;
decl Float:pos[3];
new Red;
decl Float:ang[3];
GetClientAbsOrigin(client, pos);
Blue = CreateEntityByName("prop_physics_override");
GetClientEyeAngles(client, ang);
DispatchKeyValue(Blue, "model", PORTAL_MDL);
DispatchKeyValue( Blue, "Solid", "6");
ang[0] = NULL_VECTOR[0];
DispatchKeyValueVector( Blue, "Origin", pos );
ang[2] = NULL_VECTOR[2];
DispatchKeyValueVector( Blue, "Angles", ang );
DispatchSpawn(Blue);
new Blue;
new Red;
Blue = CreateEntityByName("prop_physics_override");
public Action BlockDMG(int victim, int &attacker, int &inflictor, float &damage, int &damagetype, int &weapon, float damageForce[3], float damagePosition[3])
{
//i'm not sure if prop damage is what is killing your entity just incase the tank punches it ect, we just block all damage.
return Plugin_Handled;
}
public Action:TouchBlue(entity, other)
public Action:TouchBlue(entity, other)
{
{
// if portals arent indelay and have been seperated and are active
// if portals arent indelay and have been seperated and are active
public Action:resetportal(Handle:hTimer, any:client)
public Action:resetportal(Handle:hTimer, any:client)
{
{
PortalUseDelay = false;
PortalUseDelay = false;
}
}
public Action:Blue_Move(client, args)
public Action:Blue_Move(client, args)
{
{
decl Float:Ang[3];
decl Float:Ang[3];
new Blue;
new Blue;
if(IsValidEntRef(BluePortal))
if(IsValidEntRef(BluePortal))
{
{
Blue = EntRefToEntIndex(BluePortal)
Blue = EntRefToEntIndex(BluePortal);
}
}
else
else
{
{
PrintToChat(client,"!!!Blue portal broke, tell an admin!!!")
PrintToChat(client,"!!!Blue portal broke, tell an admin!!!"); //this could be removed unless you need it, i suggest using ReplyToCommand() and saying portals need to be created.
public bool:TraceFilter(entity, contentsMask, any:client)
public bool:TraceFilter(entity, contentsMask, any:client)
{
{
if( entity == client )return false;
if( entity == client )return false;
return true;
return true;
}
}
SetGlowRed(gun)
SetGlowRed(gun)
{
{
//since you not passing a reference here anyway no point is passing a reference either way if index is invalid or different entity will still be wrong.