Can someone give good code? :<
@edit:
New code:
Code:
public item_piorun(id)
{
if (halflife_time()-gravitytimer[id] <= 10)
{
hudmsg(id,2.0,"Thunder can be used in 10 seconds.")
return PLUGIN_CONTINUE
}
gravitytimer[id] = floatround(halflife_time())
new targetplayer = UTIL_FindNearestOpponent(id,600)
if (targetplayer == -1)
return PLUGIN_HANDLED
new damage = 80+player_intelligence[id]/2
new Hit2[3]
get_user_origin(targetplayer, Hit2)
hudmsg(id, 2.0, "You hit %i dmg", damage)
change_health(targetplayer,-damage,0,"world")
CreateBolt(Hit2)
return PLUGIN_CONTINUE;
}
CreateBolt(Hit2[3]) {
message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
write_byte( 0 )
write_coord( Hit2[ 0 ] )
write_coord( Hit2[ 1 ] )
write_coord( Hit2[ 2 ] + 200)
write_coord( Hit2[ 0 ] )
write_coord( Hit2[ 1 ] )
write_coord( Hit2[ 2 ] )
write_short( light )
write_byte( 1 )
write_byte( 5 )
write_byte( 2 )
write_byte( 20 )
write_byte( 30 )
write_byte( 255 )
write_byte( 255 )
write_byte( 255 )
write_byte( 200 )
write_byte( 200 )
message_end( )
}
All is good, but I can use it only once... I need to use it in 10 seconds... How can I make it?