Results 1 to 3 of 3

Thread: Electric fence

  1. #1
    Private
    Join Date
    Sep 2017
    Posts
    19
    Thanks
    3
    Thanked 15 Times in 15 Posts

    Electric fence

    Why I cannot see "milky ways"? Try to find error.


    PHP Code:
    init()
    {
        
    // Search for an electric fence objects
        
    electricFence GetEntArray("electric_fence""targetname");
        if(
    electricFence.size 1
        {
            return;
        }
        
        
    // Precache models used by this spawner
        
    PrecacheShader("electric_screen_01");
        
    PrecacheShader("electric_screen_02");
        
    PrecacheShader("electric_screen_03");
        for(
    0electricFence.sizei++)
        {
            
    fence electricFence[i];     
            
    fence thread ElectricFence(int(fence.electric_fence_damage));
        }
    }

    ElectricFence(damage)
    {
        for(;;)
        {
            
    self waittill("trigger",user);
            
    self playloopsound("shockerloop");
            
    user [[level.callbackPlayerDamage]](useruserdamage1"MOD_MELEE""zom_mp"user.origin + (0040), vectornormalize(user.origin self.origin), "none"0);
            
    self thread DamagePlayer(user);        
            
    wait 0.5;
            
    self stoploopsound();
        }    
    }


    DamagePlayer(player)
    {
        
    player endon("disconnect");
        
    player notify("endelectric");
        
    player endon("endelectric");

        if(
    IsDefined(player.hud_ElectricScreen))
        {
            for (
    0player.hud_ElectricScreen.sizeb++)
            {
                if (
    isDefined(player.hud_ElectricScreen[b])) player.hud_ElectricScreen[bdestroy();
            }
        }
        else
        {
            
    player.hud_ElectricScreen = [];
        }

        
    amount randomInt(3) + 6;

        
    images = [];
        
    images[images.size] = "electric_screen_01";
        
    images[images.size] = "electric_screen_02";
        
    images[images.size] = "electric_screen_03";

        for (
    0amountb++)
        {
            
    randomInt(640);
            
    randomInt(480);
            
    size randomInt(64) + 256;

            
    player.hud_ElectricScreen[b] = newClientHudElem(player);
            
    player.hud_ElectricScreen[b].horzAlign "fullscreen";
            
    player.hud_ElectricScreen[b].vertAlign "fullscreen";
            
    player.hud_ElectricScreen[b].alignX "center";
            
    player.hud_ElectricScreen[b].alignY "middle";
            
    player.hud_ElectricScreen[b].x;
            
    player.hud_ElectricScreen[b].y;
            
    player.hud_ElectricScreen[b].alpha 1.0;
            
    player.hud_ElectricScreen[b].color = (1.01.01.0);
            
    player.hud_ElectricScreen[bsetShader(images[randomint(images.size)], sizesize);
        }
        
    wait 1;

        for (
    0amountb++)
        {
            
    player.hud_ElectricScreen[bfadeovertime(1);
            
    player.hud_ElectricScreen[b].alpha 0;
        }

        
    wait 1.1;

        for (
    0player.hud_ElectricScreen.sizeb++)
        {
            if (
    isDefined(player.hud_ElectricScreen[b])) player.hud_ElectricScreen[bdestroy();
        }


  2. The Following User Says Thank You to Mariusz For This Useful Post:

    kubislav23 (7th October 2017)

  3. #2
    Private Paho's Avatar
    Join Date
    Feb 2014
    Location
    Russia
    Posts
    82
    Thanks
    37
    Thanked 34 Times in 26 Posts
    Do you have material in .iwd?
    check work shader from simple script:
    Code:
    self.zaebal setShader("electric_screen_01", 640, 480);
    or replace "electric_screen_01" to "stance_stand" and check (+precache)

    write printf("1....."); in all { ... } and find place where stops
    Last edited by Paho; 5th October 2017 at 18:36.

  4. #3
    Private
    Join Date
    Sep 2017
    Posts
    19
    Thanks
    3
    Thanked 15 Times in 15 Posts
    Thank you, I will work on it in a few days.

  5. The Following User Says Thank You to Mariusz For This Useful Post:

    kubislav23 (6th October 2017)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •