AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Scripting Help : Random Cords and Take_damage (https://forums.alliedmods.net/showthread.php?t=27208)

NightWish 04-17-2006 10:11

Scripting Help : Random Cords and Take_damage
 
its for my Lightning plugin :D
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 :D

PS : Just switched to AMXX so i suck at it :(

p3tsin 04-17-2006 10:24

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 :o

Code:
new Float:time = random_float(10.0, 30.0) set_task(time, "func", ..)

NightWish 04-17-2006 10:29

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 :o

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 ?

Sandurr 04-17-2006 11:25

random_num() :roll:

Des12 04-17-2006 11:52

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?

FatalisDK 04-17-2006 13:17

Get a players origin then set a task to make lightning at the origin some time later, it will seem random.

NightWish 04-17-2006 13:29

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

v3x 04-17-2006 14:35

Does fakedamage() handle the death as well?

NightWish 04-17-2006 15:53

Quote:

Originally Posted by v3x
Does fakedamage() handle the death as well?

No idea but i cant get it work anyway :(

FatalisDK 04-17-2006 16:43

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

Something like that I guess...


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

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