AlliedModders Donor
Join Date: Sep 2017
Location: Czech republic
|
01-01-2018
, 06:58
CS:GO Engine error, help
|
#1
|
Hey guys, i am trying to make beam on grabbed player, i did it, but after i drop it, my CS:GO crash and show me this error... And i dont know where is the problem..
Here is the error:
Here is the code:
PHP Code:
public Action_Drop(client)
{
if( IsClientInGame(client) &&
g_Status[client][Grab] )
{
g_Status[client][Grab] = false; // Tell plugin the grabber has dropped his target
if(g_Targetindex[client][Grab] > 0)
{
PrintCenterText(client, "%t", "Dropped");
if( g_Targetindex[client][Grab] > 0 &&
g_Targetindex[client][Grab] <= MaxClients &&
IsClientInGame(g_Targetindex[client][Grab]))
{
g_Grabbed[g_Targetindex[client][Grab]] = false; // Tell plugin the target is no longer being grabbed
SetEntPropFloat(g_Targetindex[client][Grab], Prop_Send, "m_flMaxspeed", g_MaxSpeed[client]); // Set speed back to normal
}
g_Targetindex[client][Grab] = -1;
}
else
PrintCenterText(client, "%t", "Not Found");
}
}
AttachBeam(client)
{
decl String:beamindex[30],String:start[30],String:end[30],String:parentName[64];
Format(parentName, sizeof(parentName), "%i:%N", client, client);
DispatchKeyValue(client, "targetname", parentName);
new Float:vec[3];
GetClientAbsOrigin(client, vec);
new startent = CreateEntityByName("prop_dynamic");
Format(start, sizeof(start), "start%i", startent);
DispatchKeyValue(startent, "targetname", start);
DispatchKeyValue(startent, "model", "models/advisor.mdl");
DispatchKeyValue(startent, "solid", "0");
DispatchKeyValue(startent, "rendermode", "10");
DispatchSpawn(startent);
ActivateEntity(startent);
vec[1] += 100; //add 100 to the y axis, so it's away from the player itself
TeleportEntity(startent, vec, NULL_VECTOR, NULL_VECTOR);
SetVariantString(parentName);
AcceptEntityInput(startent, "SetParent");
SetVariantString("defusekit");
AcceptEntityInput(startent, "SetParentAttachmentMaintainOffset");
new endent = CreateEntityByName("prop_dynamic");
Format(end, sizeof(end), "end%i", endent);
DispatchKeyValue(endent, "targetname", end);
DispatchKeyValue(endent, "model", "models/advisor.mdl");
DispatchKeyValue(endent, "solid", "0");
DispatchKeyValue(endent, "rendermode", "10");
DispatchSpawn(endent);
ActivateEntity(endent);
vec[1] -= 200; // do the same here, only reverse
TeleportEntity(endent, vec, NULL_VECTOR, NULL_VECTOR);
SetVariantString(parentName);
AcceptEntityInput(endent, "SetParent");
SetVariantString("defusekit");
AcceptEntityInput(endent, "SetParentAttachmentMaintainOffset");
new beament = CreateEntityByName("env_beam");
if (IsValidEdict(beament))
{
Format(beamindex, sizeof(beamindex), "Beam%i", beament);
// Set keyvalues on the beam.
DispatchKeyValue(beament, "damage", "0");
DispatchKeyValue(beament, "framestart", "0");
DispatchKeyValue(beament, "BoltWidth", "10");
DispatchKeyValue(beament, "renderfx", "0");
DispatchKeyValue(beament, "TouchType", "3");
DispatchKeyValue(beament, "framerate", "0");
DispatchKeyValue(beament, "decalname", "Bigshot");
DispatchKeyValue(beament, "TextureScroll", "35");
DispatchKeyValue(beament, "HDRColorScale", "1.0");
DispatchKeyValue(beament, "texture", "materials/sprites/laserbeam.vmt");
DispatchKeyValue(beament, "life", "20");
DispatchKeyValue(beament, "targetname", beamindex);
DispatchKeyValue(beament, "LightningStart", start);
DispatchKeyValue(beament, "LightningEnd", end);
DispatchKeyValue(beament, "StrikeTime", "1");
DispatchKeyValue(beament, "spawnflags", "8");
DispatchKeyValue(beament, "NoiseAmplitude", "0");
DispatchKeyValue(beament, "Radius", "50");
DispatchKeyValue(beament, "rendercolor", "255 0 0");
DispatchKeyValue(beament, "renderamt", "100");
DispatchSpawn(beament);
ActivateEntity(beament);
TeleportEntity(beament, vec, NULL_VECTOR, NULL_VECTOR);
CreateTimer(0.5, beam_enable, beament);
}
}
public Action:beam_enable(Handle:timer, any:beam)
{
AcceptEntityInput(beam, "TurnOn");
}
If you know, where is the problem, i will be happy if you tell me how i can fix it, thanks.. ^^
__________________
Last edited by Javierko; 01-01-2018 at 12:12.
|
|