Available [ZP] Extra Item: Infection Storm for [ZE] Extra Item

Unpaid Requests, Public Plugins
Post Reply
User avatar
konno
Member
Member
Brazil
Posts: 44
Joined: 6 years ago
Location: Brazil
Contact:

[ZP] Extra Item: Infection Storm for [ZE] Extra Item

#1

Post by konno » 6 years ago

Hi guys, follows a great extra item to convert to our mod ZE, follow the link and sma.

https://forums.alliedmods.net/showthrea ... 7?t=139447

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#2

Post by Raheem » 6 years ago

Here you are:
  • Code: Select all

    #include <zombie_escape>
    
    new g_storm
    new light
    
    public plugin_init() 
    {	
    	register_plugin("[ZE] Extra Item: Infection Storm","1.0","fiendshard")
    	g_storm = ze_register_item("Infection Storm", 15, 0)
    }
    
    public plugin_precache() 
    { 
    	light = precache_model("sprites/lgtning.spr")
    }
    
    public ze_select_item_pre(id, itemid)
    {
        // Return Available and we will block it in Post, So it dosen't affect other plugins
        if (itemid != g_storm)
            return ZE_ITEM_AVAILABLE
       
        // Available for Zombies only, So don't show it for Humans
        if (!ze_is_user_zombie(id))
            return ZE_ITEM_DONT_SHOW
       
        return ZE_ITEM_AVAILABLE
    }
    
    public ze_select_item_post(id, itemid)
    {
        if (itemid != g_storm)
            return
       
    	set_task(0.5,"lightning0",id+1,"",0,"a",60)
    	set_task(1.0,"lightning1",id+2,"",0,"a",60)
    	set_task(1.5,"lightning2",id+3,"",0,"a",60)
    	set_task(2.0,"lightning3",id+4,"",0,"a",60)
    	set_task(2.5,"lightning4",id+5,"",0,"a",60)
    	set_task(3.0,"lightning5",id+6,"",0,"a",60)
    }
    
    public lightning0(id)
    {
    	new xy[2]
    	xy[0] = random_num(-2000,2200)
    	xy[1] = random_num(-2000,2200)
    	message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 
    	write_byte(0) 
    	write_coord(xy[0]) 
    	write_coord(xy[1]) 
    	write_coord(4000) 
    	write_coord(xy[0]) 
    	write_coord(xy[1]) 
    	write_coord(-2000) 
    	write_short(light) 
    	write_byte(1) // framestart 
    	write_byte(5) // framerate 
    	write_byte(2) // life 
    	write_byte(200) // width 
    	write_byte(100) // noise 
    	write_byte(0) // r, g, b 
    	write_byte(255) // r, g, b 
    	write_byte(0) // r, g, b 
    	write_byte(200) // brightness 
    	write_byte(200) //  
    	message_end() 
    	
    	new origin[3];
    	get_user_origin(id, origin, 0)
    	{
    		if((origin[0] = xy[0]) && (origin[1] = xy[1]))
    		ze_set_user_zombie(id)
    	}
    }
    
    public lightning1(id)
    {
    	new xy[2]
    	xy[0] = random_num(-2000,2200)
    	xy[1] = random_num(-2000,2200)
    	message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 
    	write_byte(0) 
    	write_coord(xy[0]) 
    	write_coord(xy[1]) 
    	write_coord(4000) 
    	write_coord(xy[0]) 
    	write_coord(xy[1]) 
    	write_coord(-2000) 
    	write_short(light) 
    	write_byte(1) // framestart 
    	write_byte(5) // framerate 
    	write_byte(2) // life 
    	write_byte(10) // width 
    	write_byte(10) // noise 
    	write_byte(0) // r, g, b 
    	write_byte(255) // r, g, b 
    	write_byte(0) // r, g, b 
    	write_byte(200) // brightness 
    	write_byte(200) //  
    	message_end() 
    	
    	new origin[3];
    	get_user_origin(id, origin)
    	{
    		if((origin[0] = xy[0]) && (origin[1] = xy[1]))
    		ze_set_user_zombie(id)
    	}
    }
    
    public lightning2(id)
    {
    	new xy[2]
    	xy[0] = random_num(-2000,2200)
    	xy[1] = random_num(-2000,2200)
    	message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 
    	write_byte(0) 
    	write_coord(xy[0]) 
    	write_coord(xy[1]) 
    	write_coord(4000) 
    	write_coord(xy[0]) 
    	write_coord(xy[1]) 
    	write_coord(-2000) 
    	write_short(light) 
    	write_byte(1) // framestart 
    	write_byte(5) // framerate 
    	write_byte(2) // life 
    	write_byte(50) // width 
    	write_byte(50) // noise 
    	write_byte(0) // r, g, b 
    	write_byte(255) // r, g, b 
    	write_byte(0) // r, g, b 
    	write_byte(200) // brightness 
    	write_byte(200) //  
    	message_end() 
    	
    	new origin[3];
    	get_user_origin(id, origin)
    	{
    		if((origin[0] = xy[0]) && (origin[1] = xy[1]))
    		ze_set_user_zombie(id)
    	}
    }
    
    public lightning3(id)
    {
    	new xy[2]
    	xy[0] = random_num(-2000,2200)
    	xy[1] = random_num(-2000,2200)
    	message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 
    	write_byte(0) 
    	write_coord(xy[0]) 
    	write_coord(xy[1]) 
    	write_coord(4000) 
    	write_coord(xy[0]) 
    	write_coord(xy[1]) 
    	write_coord(-2000) 
    	write_short(light) 
    	write_byte(1) // framestart 
    	write_byte(5) // framerate 
    	write_byte(2) // life 
    	write_byte(200) // width 
    	write_byte(150) // noise 
    	write_byte(0) // r, g, b 
    	write_byte(255) // r, g, b 
    	write_byte(0) // r, g, b 
    	write_byte(200) // brightness 
    	write_byte(200) //  
    	message_end() 
    	
    	new origin[3];
    	get_user_origin(id, origin)
    	{
    		if((origin[0] = xy[0]) && (origin[1] = xy[1]))
    		ze_set_user_zombie(id)
    	}
    }
    
    public lightning4(id)
    {
    	new xy[2]
    	xy[0] = random_num(-2000,2200)
    	xy[1] = random_num(-2000,2200)
    	message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 
    	write_byte(0) 
    	write_coord(xy[0]) 
    	write_coord(xy[1]) 
    	write_coord(4000) 
    	write_coord(xy[0]) 
    	write_coord(xy[1]) 
    	write_coord(-2000) 
    	write_short(light) 
    	write_byte(1) // framestart 
    	write_byte(5) // framerate 
    	write_byte(2) // life 
    	write_byte(220) // width 
    	write_byte(50) // noise 
    	write_byte(0) // r, g, b 
    	write_byte(255) // r, g, b 
    	write_byte(0) // r, g, b 
    	write_byte(200) // brightness 
    	write_byte(200) //  
    	message_end() 
    	
    	new origin[3];
    	get_user_origin(id, origin)
    	{
    		if((origin[0] = xy[0]) && (origin[1] = xy[1]))
    		ze_set_user_zombie(id)
    	}
    }
    
    public lightning5(id)
    {
    	new xy[2]
    	xy[0] = random_num(-2000,2200)
    	xy[1] = random_num(-2000,2200)
    	message_begin(MSG_BROADCAST,SVC_TEMPENTITY) 
    	write_byte(0) 
    	write_coord(xy[0]) 	// Start X
    	write_coord(xy[1]) 	// Start Y
    	write_coord(4000) 	// Start Z
    	write_coord(xy[0]) 	// End X
    	write_coord(xy[1]) 	// End Y
    	write_coord(-2000) 	// End Z
    	write_short(light) 
    	write_byte(1) // framestart 
    	write_byte(5) // framerate 
    	write_byte(2) // life 
    	write_byte(180) // width 
    	write_byte(70) // noise 
    	write_byte(0) // r, g, b 
    	write_byte(255) // r, g, b 
    	write_byte(0) // r, g, b 
    	write_byte(200) // brightness 
    	write_byte(200) //  
    	message_end() 
    	
    	new origin[3];
    	get_user_origin(id, origin)
    	{
    		if((origin[0] = xy[0]) && (origin[1] = xy[1]))
    		ze_set_user_zombie(id)
    	}	
    }
    
    public ze_user_humanized(id) 
    { 
    	if(task_exists(id+1))
    		remove_task(id+1)
    	if(task_exists(id+2))
    		remove_task(id+2)
    	if(task_exists(id+3))
    		remove_task(id+3)
    	if(task_exists(id+4))
    		remove_task(id+4)
    	if(task_exists(id+5))
    		remove_task(id+5)
    	if(task_exists(id+6))
    		remove_task(id+6)
    }
Screenshot:
  • Image
He who fails to plan is planning to fail

User avatar
konno
Member
Member
Brazil
Posts: 44
Joined: 6 years ago
Location: Brazil
Contact:

#3

Post by konno » 6 years ago

presented an error, it is only falling several rays in the same player in a small interval

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#4

Post by Raheem » 6 years ago

Hmm, Give me your server ip so i join and see error myself.
He who fails to plan is planning to fail

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: Yandex [Bot] and 1 guest