HELLO I GOT PROBLEM WITH TRAIL PLUGIN EVERY TIME I TRY TO USE IM TIMING OUT
Code:
#include <sdktools>
public OnMapStart()
{
AddFileToDownloadsTable("materials/sprites/vector_arrow_trail.vtf");
AddFileToDownloadsTable("materials/sprites/vector_arrow_main.vtf");
AddFileToDownloadsTable("materials/sprites/vector_arrow_trail.vmt");
AddFileToDownloadsTable("materials/sprites/vector_arrow_main.vmt");
PrecacheModel("materials/sprites/vector_arrow_main.vmt")
PrecacheModel("materials/sprites/vector_arrow_main.vtf")
PrecacheModel("materials/sprites/vector_arrow_trail.vtf")
PrecacheModel("materials/sprites/vector_arrow_trail.vtf")
PrecacheModel("materials/sprites/vector_arrow_trail")
PrecacheModel("materials/sprites/vector_arrow_main")
}
public OnPluginStart()
{
HookEvent("player_spawn", Hook_PlayerSpawn);
}
public Hook_PlayerSpawn(Handle:event, const String:name[], bool:DontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if(GetUserFlagBits(client) & ADMFLAG_ROOT)
{
Trail_Attach(client)
}
}
void:Trail_Attach(client)
{
decl String:sTempName[64];
Format(sTempName, sizeof(sTempName), "PlayerTrail_%d", GetClientUserId(client));
DispatchKeyValue(client, "targetname", sTempName);
new entIndex = CreateEntityByName("env_spritetrail");
if (entIndex > 0 && IsValidEntity(entIndex))
{
DispatchKeyValue(entIndex, "parentname", sTempName);
DispatchKeyValue(entIndex, "spritename", "materials/sprites/vector_arrow_main");
SetEntPropFloat(entIndex, Prop_Send, "m_flTextureRes", 0.05);
DispatchKeyValue(entIndex, "renderamt", "255");
DispatchKeyValue(entIndex, "rendercolor", "255 255 255");
DispatchKeyValueFloat(entIndex, "lifetime", 1.0);
DispatchKeyValueFloat(entIndex, "startwidth", 22.0);
DispatchKeyValueFloat(entIndex, "endwidth", 0.0);
DispatchKeyValue(entIndex, "rendermode", "5");
DispatchSpawn(entIndex);
new Float:f_origin[3];
GetClientAbsOrigin(client, f_origin);
f_origin[2] += 14.0; // 34
TeleportEntity(entIndex, f_origin, NULL_VECTOR, NULL_VECTOR);
SetVariantString(sTempName);
AcceptEntityInput(entIndex, "SetParent", entIndex, entIndex);
}
}
HELPING ME IN TROUBLE WOULD BE VERY NICE
THANKS YOU