Raised This Month: $ Target: $400
 0% 

Scripting Help : Random Cords and Take_damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NightWish
Junior Member
Join Date: Apr 2006
Location: Denmark
Old 04-17-2006 , 10:11   Scripting Help : Random Cords and Take_damage
Reply With Quote #1

its for my Lightning plugin
got a native i need help in or just what .inc its in

1 : Take_damage ( how to use and what .inc )

and

Code:
#include <amxmodx> #include <fun> new smoke, lightning, gmsgShake, flaresprite public plugin_init() {     register_plugin("lightning", "1.0", "NightWish")     gmsgShake = get_user_msgid("ScreenShake")     register_clcmd("Light","lightning1") } public plugin_precache(){     lightning = precache_model("sprites/lgtning.spr")     smoke = precache_model("sprites/steam1.spr")     flaresprite = precache_model( "sprites/blueflare2.spr") } public lightning1(id){     new origin[3]     new vec1[3]     get_user_origin(id,origin,3)                vec1[0] = origin[0]     vec1[1] = origin[1]     vec1[2] = origin[2] + 800     message_begin( MSG_BROADCAST,SVC_TEMPENTITY)     write_byte( 0 )     write_coord(vec1[0])     write_coord(vec1[1])     write_coord(vec1[2])     write_coord(origin[0])     write_coord(origin[1])     write_coord(origin[2])     write_short( lightning )     write_byte( 1 )     write_byte( 5 )     write_byte( 2 )     write_byte( 50 )     write_byte( 20 )     write_byte( 200 )     write_byte( 200 )     write_byte( 200 )     write_byte( 200 )     write_byte( 200 )     message_end()     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)            write_byte(27)     write_coord(origin[0])     write_coord(origin[1])     write_coord(origin[2])     write_byte(20)     write_byte(200)     write_byte(200)     write_byte(200)     write_byte(10)     write_byte(15)     message_end()     message_begin( MSG_BROADCAST, SVC_TEMPENTITY )      write_byte( 15 )     write_coord( origin[0])     write_coord( origin[1])     write_coord( origin[2])     write_coord( origin[0])     write_coord( origin[1])     write_coord( origin[2])     write_short( flaresprite )     write_byte( 10 )     write_byte( 1 )     write_byte( 2 )     write_byte( 100 )     write_byte( 50 )     message_end()     message_begin( MSG_BROADCAST,SVC_TEMPENTITY,origin)     write_byte( 5 )     write_coord(origin[0])     write_coord(origin[1])     write_coord(origin[2])     write_short( smoke )     write_byte( 10 )       write_byte( 10 )       message_end()     new players[32]                         new numberofplayers     get_players(players, numberofplayers)     new i     new targetid     new distancebetween     new targetorigin[3]     for (i = 0; i < numberofplayers; ++i){     targetid=players[i]     get_user_origin(targetid,targetorigin,0)     distancebetween=get_distance(origin,targetorigin)         if (distancebetween < 200){         message_begin(MSG_ONE,gmsgShake,{0,0,0},targetid)         write_short( 1<<14 )         write_short( 1<<13 )         write_short( 1<<14 )         message_end()      <b>   take_damage(users[i], 0, origin[i],10.0, DMG_SONIC, "lightning") </b>         } } }

how to spawn the Lightnings Random places ?
so they spawn in random places at random time to make a Lightning Weather plugin

PS : Just switched to AMXX so i suck at it
NightWish is offline
Send a message via MSN to NightWish
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 04-17-2006 , 10:24  
Reply With Quote #2

how bout fakedamage()? its in engine_stocks.inc
Code:
stock fakedamage(idvictim,szClassname[],Float:takedmgdamage,damagetype)

random time would be easy to do, but coords could easily get set outside the map

Code:
new Float:time = random_float(10.0, 30.0) set_task(time, "func", ..)
__________________
plop
p3tsin is offline
NightWish
Junior Member
Join Date: Apr 2006
Location: Denmark
Old 04-17-2006 , 10:29  
Reply With Quote #3

Quote:
Originally Posted by p3tsin
how bout fakedamage()? its in engine_stocks.inc
Code:
stock fakedamage(idvictim,szClassname[],Float:takedmgdamage,damagetype)

random time would be easy to do, but coords could easily get set outside the map

Code:
new Float:time = random_float(10.0, 30.0) set_task(time, "func", ..)
Thx for help
but i still need how to Make the lightnings to spawn at random places

and :
Where is Native : User_spawn and Remove_entities Located ?
NightWish is offline
Send a message via MSN to NightWish
Sandurr
Senior Member
Join Date: Aug 2005
Old 04-17-2006 , 11:25  
Reply With Quote #4

random_num()
Sandurr is offline
Des12
Senior Member
Join Date: Jan 2005
Old 04-17-2006 , 11:52  
Reply With Quote #5

remove_entitiy is in engine, and there is a cs_user_spawn in the counter strike module.

What do you want to do with user spawn exactly?
__________________
-Dest Romano

www.JustRP.com
A TSRP Server

Quote:
Originally Posted by Brad
Don't you go be bringing reality into this.
Des12 is offline
FatalisDK
Senior Member
Join Date: Mar 2006
Location: bacon
Old 04-17-2006 , 13:17  
Reply With Quote #6

Get a players origin then set a task to make lightning at the origin some time later, it will seem random.
__________________
FatalisDK is offline
NightWish
Junior Member
Join Date: Apr 2006
Location: Denmark
Old 04-17-2006 , 13:29  
Reply With Quote #7

Quote:
Originally Posted by FatalisDK
Get a players origin then set a task to make lightning at the origin some time later, it will seem random.
Great idea THNX
NightWish is offline
Send a message via MSN to NightWish
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-17-2006 , 14:35  
Reply With Quote #8

Does fakedamage() handle the death as well?
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
NightWish
Junior Member
Join Date: Apr 2006
Location: Denmark
Old 04-17-2006 , 15:53  
Reply With Quote #9

Quote:
Originally Posted by v3x
Does fakedamage() handle the death as well?
No idea but i cant get it work anyway
NightWish is offline
Send a message via MSN to NightWish
FatalisDK
Senior Member
Join Date: Mar 2006
Location: bacon
Old 04-17-2006 , 16:43  
Reply With Quote #10

Code:
fakedamage(Victim, "Lightning", 69.0, DMG_GENERIC)

Something like that I guess...
__________________
FatalisDK is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:09.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode