sourcegod
Дата: Понедельник, 11.01.2016, 10:40:50 | Сообщение # 1
Сообщений: 69
Репутация: 0 [ +/- ]
Суть в том, что эффекты должны быть, и ротация с поднятием пробывал через таймер, никак
Код
public Action:Event_BombPlanted( Handle:event, const String:name[], bool:dontBroadcast ) { SourceGod_Plant_Index = FindEntityByClassname(MaxClients + 1, "planted_c4"); if (SourceGod_Plant_Index > 0) { // модель decl String:model[125]; GetConVarString(c4_model, model, 125); if (StrContains(model, "models") == 0 && StrContains(model, ".mdl") > 1) { PrecacheModel(model, true); SetEntityModel(SourceGod_Plant_Index, model); } // приподнять decl Float:c4_ground_pos[3]; GetEntPropVector(SourceGod_Plant_Index, Prop_Send, "m_vecOrigin", c4_ground_pos); new Float:z = GetConVarFloat(c4_z); if (z > 0.0) { decl Float:c4_air_pos[3]; c4_air_pos[0] = c4_ground_pos[0]; c4_air_pos[1] = c4_ground_pos[1]; c4_air_pos[2] = c4_ground_pos[2] + z; TeleportEntity(SourceGod_Plant_Index, c4_air_pos, NULL_VECTOR, NULL_VECTOR); // луч if (GetConVarBool(c4_z_beam) && (SourceGod_Pbeam_Index = CreateEntityByName("env_beam")) > MaxClients) { SetEntityModel(SourceGod_Pbeam_Index, SourceGod_BEAM_MODEL); DispatchKeyValue(SourceGod_Pbeam_Index, "texture", SourceGod_BEAM_MODEL); DispatchKeyValue(SourceGod_Pbeam_Index, "renderamt", "255"); DispatchKeyValue(SourceGod_Pbeam_Index, "rendercolor", "255 0 0"); SetEntPropFloat(SourceGod_Pbeam_Index, Prop_Send, "m_fAmplitude", GetConVarFloat(c4_z_beam_noise)); DispatchKeyValueFloat(SourceGod_Pbeam_Index, "BoltWidth", GetConVarFloat(c4_z_beam_width)); DispatchKeyValue(SourceGod_Pbeam_Index, "life", "0"); DispatchSpawn(SourceGod_Pbeam_Index); TeleportEntity(SourceGod_Pbeam_Index, c4_air_pos, NULL_VECTOR, NULL_VECTOR); SetEntPropVector(SourceGod_Pbeam_Index, Prop_Send, "m_vecEndPos", c4_ground_pos); AcceptEntityInput(SourceGod_Pbeam_Index, "TurnOn"); } } // вращение if (GetConVarBool(c4_rotate)) { new rotator = CreateEntityByName("func_rotating"); if (rotator > 0) { DispatchKeyValueVector(rotator, "origin", c4_ground_pos); decl String:rotator_name[20]; Format(rotator_name, 20, "rt_%d", rotator); DispatchKeyValue(rotator, "targetname", rotator_name); DispatchKeyValue(rotator, "maxspeed", "200"); DispatchKeyValue(rotator, "dmg", "0"); DispatchKeyValue(rotator, "solid", "0"); DispatchKeyValue(rotator, "spawnflags", "64"); DispatchSpawn(rotator); SetVariantString(rotator_name); AcceptEntityInput(SourceGod_Plant_Index, "SetParent"); AcceptEntityInput(rotator, "Start"); } } } if(GetConVarInt(gBombPlanted) == 1) { new id = GetClientOfUserId(GetEventInt(event, "userid")); decl String:Name[32]; GetClientName(id, Name, sizeof(Name) - 1); switch(GetConVarInt(gPrintType)) { case 1: PrintHintTextToAll("%t", "bombplanted1", Name); case 2: PrintToChatAll("\x07FF00FF%t", "bombplanted2", Name); case 3: PrintCenterTextAll("%t", "bombplanted3", Name); case 4: { new String:g_Msg[200]; Format(g_Msg, 150, "%t", "bombplanted4", id); new Handle:Messages = StartMessageAll("KeyHintText"); if (Messages != INVALID_HANDLE) { BfWriteByte(Messages, 1); BfWriteString(Messages, g_Msg); EndMessage(); } } } } CreateTimer(1.0, Timer_Func); return Plugin_Continue; } public Action:Timer_Func(Handle:timer) { g_iSmokeEntity = CreateEntityByName("env_smokestack"); AcceptEntityInput(g_iSmokeEntity, "TurnOn"); DispatchKeyValue(g_iSmokeEntity, "SmokeMaterial", "particle/smokestack.vmt"); DispatchKeyValue(g_iSmokeEntity, "BaseSpread", "30"); DispatchKeyValue(g_iSmokeEntity, "Speed", "100"); DispatchKeyValue(g_iSmokeEntity, "StartSize", "10"); DispatchKeyValue(g_iSmokeEntity, "Rate", "100"); DispatchKeyValue(g_iSmokeEntity, "JetLength", "150"); DispatchKeyValue(g_iSmokeEntity, "Twist", "70"); DispatchKeyValue(g_iSmokeEntity, "rendercolor", "255 16 5"); DispatchKeyValue(g_iSmokeEntity, "RenderAmt", "255"); DispatchKeyValue(g_iSmokeEntity, "Angles", "0"); new Planted_C4=-1; Planted_C4 = FindEntityByClassname(Planted_C4, "planted_c4"); new Float:flc4_position[3]; GetEntPropVector(Planted_C4, Prop_Send, "m_vecOrigin", flc4_position); TeleportEntity(g_iSmokeEntity, flc4_position, NULL_VECTOR, NULL_VECTOR); DispatchSpawn(g_iSmokeEntity); AcceptEntityInput(g_iSmokeEntity, "TurnOn"); }
так тоже безполезно, как правильно?
Код
public Action:Event_BombPlanted( Handle:event, const String:name[], bool:dontBroadcast ) { SourceGod_Plant_Index = FindEntityByClassname(MaxClients + 1, "planted_c4"); if (SourceGod_Plant_Index > 0) { // модель decl String:model[125]; GetConVarString(c4_model, model, 125); if (StrContains(model, "models") == 0 && StrContains(model, ".mdl") > 1) { PrecacheModel(model, true); SetEntityModel(SourceGod_Plant_Index, model); } // приподнять decl Float:c4_ground_pos[3]; GetEntPropVector(SourceGod_Plant_Index, Prop_Send, "m_vecOrigin", c4_ground_pos); new Float:z = GetConVarFloat(c4_z); if (z > 0.0) { decl Float:c4_air_pos[3]; c4_air_pos[0] = c4_ground_pos[0]; c4_air_pos[1] = c4_ground_pos[1]; c4_air_pos[2] = c4_ground_pos[2] + z; TeleportEntity(SourceGod_Plant_Index, c4_air_pos, NULL_VECTOR, NULL_VECTOR); // луч if (GetConVarBool(c4_z_beam) && (SourceGod_Pbeam_Index = CreateEntityByName("env_beam")) > MaxClients) { SetEntityModel(SourceGod_Pbeam_Index, SourceGod_BEAM_MODEL); DispatchKeyValue(SourceGod_Pbeam_Index, "texture", SourceGod_BEAM_MODEL); DispatchKeyValue(SourceGod_Pbeam_Index, "renderamt", "255"); DispatchKeyValue(SourceGod_Pbeam_Index, "rendercolor", "255 0 0"); SetEntPropFloat(SourceGod_Pbeam_Index, Prop_Send, "m_fAmplitude", GetConVarFloat(c4_z_beam_noise)); DispatchKeyValueFloat(SourceGod_Pbeam_Index, "BoltWidth", GetConVarFloat(c4_z_beam_width)); DispatchKeyValue(SourceGod_Pbeam_Index, "life", "0"); DispatchSpawn(SourceGod_Pbeam_Index); TeleportEntity(SourceGod_Pbeam_Index, c4_air_pos, NULL_VECTOR, NULL_VECTOR); SetEntPropVector(SourceGod_Pbeam_Index, Prop_Send, "m_vecEndPos", c4_ground_pos); AcceptEntityInput(SourceGod_Pbeam_Index, "TurnOn"); } } // вращение if (GetConVarBool(c4_rotate)) { new rotator = CreateEntityByName("func_rotating"); if (rotator > 0) { DispatchKeyValueVector(rotator, "origin", c4_ground_pos); decl String:rotator_name[20]; Format(rotator_name, 20, "rt_%d", rotator); DispatchKeyValue(rotator, "targetname", rotator_name); DispatchKeyValue(rotator, "maxspeed", "200"); DispatchKeyValue(rotator, "dmg", "0"); DispatchKeyValue(rotator, "solid", "0"); DispatchKeyValue(rotator, "spawnflags", "64"); DispatchSpawn(rotator); SetVariantString(rotator_name); AcceptEntityInput(SourceGod_Plant_Index, "SetParent"); AcceptEntityInput(rotator, "Start"); } } } g_iSmokeEntity = CreateEntityByName("env_smokestack"); AcceptEntityInput(g_iSmokeEntity, "TurnOn"); DispatchKeyValue(g_iSmokeEntity, "SmokeMaterial", "particle/smokestack.vmt"); DispatchKeyValue(g_iSmokeEntity, "BaseSpread", "30"); DispatchKeyValue(g_iSmokeEntity, "Speed", "100"); DispatchKeyValue(g_iSmokeEntity, "StartSize", "10"); DispatchKeyValue(g_iSmokeEntity, "Rate", "100"); DispatchKeyValue(g_iSmokeEntity, "JetLength", "150"); DispatchKeyValue(g_iSmokeEntity, "Twist", "70"); DispatchKeyValue(g_iSmokeEntity, "rendercolor", "255 16 5"); DispatchKeyValue(g_iSmokeEntity, "RenderAmt", "255"); DispatchKeyValue(g_iSmokeEntity, "Angles", "0"); new Planted_C4=-1; Planted_C4 = FindEntityByClassname(Planted_C4, "planted_c4"); new Float:flc4_position[3]; GetEntPropVector(Planted_C4, Prop_Send, "m_vecOrigin", flc4_position); TeleportEntity(g_iSmokeEntity, flc4_position, NULL_VECTOR, NULL_VECTOR); DispatchSpawn(g_iSmokeEntity); AcceptEntityInput(g_iSmokeEntity, "TurnOn"); if(GetConVarInt(gBombPlanted) == 1) { new id = GetClientOfUserId(GetEventInt(event, "userid")); decl String:Name[32]; GetClientName(id, Name, sizeof(Name) - 1); switch(GetConVarInt(gPrintType)) { case 1: PrintHintTextToAll("%t", "bombplanted1", Name); case 2: PrintToChatAll("\x07FF00FF%t", "bombplanted2", Name); case 3: PrintCenterTextAll("%t", "bombplanted3", Name); case 4: { new String:g_Msg[200]; Format(g_Msg, 150, "%t", "bombplanted4", id); new Handle:Messages = StartMessageAll("KeyHintText"); if (Messages != INVALID_HANDLE) { BfWriteByte(Messages, 1); BfWriteString(Messages, g_Msg); EndMessage(); } } } } return Plugin_Continue; }
Добавлено (11.01.2016, 10:40:50) --------------------------------------------- Помогите приз
Сообщение отредактировал sourcegod - Суббота, 09.01.2016, 13:36:52