Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include <sourcemod>
- #include <sdktools>
- new LaserSprite, Halosprite;
- new bool:g_bTouchedIt[MAXPLAYERS+1];
- new Float:g_FlameTime = 5.0;
- public Plugin:MyInfo =
- {
- name = "CBase entity?",
- author = "Sky-High",
- description = "My first SM entity plugin",
- version = "1.0",
- url = "** AM Spam-Blocker V3.6 **"
- };
- public OnPluginStart()
- {
- LoadTranslations("common.phrases");
- HookEvent("player_death", Event_PlayerDeath);
- //AutoExecConfig(true, "plugin_testplugin"); //autoexec a cfg file if there isnt already one
- }
- public OnMapStart()
- {
- //Precache
- LaserSprite = PrecacheModel("materials/sprites/bluelaser1.vmt");
- Halosprite = PrecacheModel("materials/sprites/halo01.vmt");
- }
- public Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
- {
- new victim_id = GetEventInt(event, "userid");
- //new attacker_id = GetEventInt(event, "attacker");
- new victim = GetClientOfUserId(victim_id);
- //new attacker = GetClientOfUserId(attacker_id);
- new Float:Origin[3];
- GetClientAbsOrigin(victim, Float:Origin);
- CreateSomeEntity(victim, Float:Origin);
- }
- stock CreateSomeEntity(client, Float:Origin[3])
- {
- new entity = CreateEntityByName("my_entity");
- //new EntData[3];
- if (entity != -1)
- {
- SetEntPropVector(entity, Prop_Data, "m_vecOrigin", Origin); // you can use sm_dump_datamaps / sm_dump_netprops server command got all offsets.
- //SetEntityModel(
- SetEntityRenderMode(entity, RENDER_TRANSCOLOR);
- SetEntityRenderFx(entity, RENDERFX_PULSE_SLOW);
- SetEntityRenderColor(entity, 31, 191, 36, 160);
- new Float:SplashStartOrigin[3]/*, Float:SplashEndOrigin[3]*/, Float:BeamStartOrigin[3], Float:BeamEndOrigin[3];
- new BeamColor[4];
- SplashStartOrigin = Origin;
- //SplashEndOrigin = Origin;
- BeamStartOrigin = Origin;
- BeamEndOrigin = Origin;
- SplashStartOrigin[2] = (Origin[2] - 5);
- //SplashEndOrigin[3] = (Origin[3] + 5);
- BeamStartOrigin[2] = (Origin[2] + 40);
- BeamEndOrigin[2] = (Origin[2] - 5);
- BeamColor[0] = 173; //r
- BeamColor[1] = 156; //g
- BeamColor[2] = 28; //b
- BeamColor[3] = 210;//A
- TE_SetupEnergySplash(Float:SplashStartOrigin, Float:Origin, bool:false);
- TE_SetupBeamPoints(BeamStartOrigin, BeamEndOrigin,
- LaserSprite, Halosprite,
- 0, 10, Float:0.8,
- Float:25, Float:20, 3,
- Float:5.0, BeamColor, 185);
- CreateTimer(Float:0.8, Timer:SpawnEntity, any:entity);
- }
- }
- public SpawnEntity(entity)
- {
- if( IsValidEntity(entity) )
- {
- if (DispatchSpawn(entity))
- {
- // if you can't find OnStartTouch output, using SDKHooks
- // http://hg.alliedmods.net/sourcemod-central/file/tip/plugins/include/sdkhooks.inc
- //SDKHook(entity, SDKHook_StartTouch, Entity_OnStartTouch);
- HookSingleEntityOutput(entity, "OnStartTouch", Entity_OnStartTouch);
- // Set the entity on fire as a last effect
- IgniteEntity(entity, Float:g_FlameTime, bool:1);
- }
- }
- }
- public Entity_OnStartTouch(const String:output[], caller, activator, Float:delay)
- {
- if( IsPlayerAlive(activator) )
- {
- //Can i use this to store in the clientindex of the player touched it?
- //SetEntProp(entity, Prop_Data, "PropField_Integer", client);
- g_bTouchedIt[activator] = true;
- if( !AcceptEntityInput(caller, "kill") )
- RemoveEdict(caller);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement