Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Action:ReplaceDefibs(Handle:timer)
- {
- if (!IsServerProcessing())
- {
- return Plugin_Continue;
- }
- new i = -1;
- while ((i = FindEntityByClassname(i, "weapon_defibrillator")) != INVALID_ENT_REFERENCE)
- {
- if (!IsDefibOwned(i))
- {
- new entity;
- new String:modelname[128];
- GetEntPropString(i, Prop_Data, "m_ModelName", modelname, 128);
- entity = CreateEntityByName("weapon_defibrillator_spawn");
- SetEntityModel(entity, modelname);
- new Float:g_Origin[3];
- new Float:g_Angle[3];
- GetEntPropVector(i, Prop_Send, "m_vecOrigin", g_Origin);
- GetEntPropVector(i, Prop_Send, "m_angRotation", g_Angle);
- AcceptEntityInput(i, "kill");
- TeleportEntity(entity, g_Origin, g_Angle, NULL_VECTOR);
- DispatchSpawn(entity);
- return Plugin_Continue;
- }
- }
- return Plugin_Continue;
- }
Advertisement
Add Comment
Please, Sign In to add comment