Raised This Month: $ Target: $400
 0% 

Is this a good script? [admin_respawn.sma]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 03-07-2009 , 11:48   Is this a good script? [admin_respawn.sma]
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
 
#define MAP_MAX   3800.0
 
public plugin_init()
{
 
register_plugin("Admin Spawn""1.0""GameFreak")
 
register_clcmd("say /respawn""cmd_buyspawn")
}
 
public 
cmd_buyspawn(id)
{
 if(
get_user_flags(id) & ADMIN_KICK)
 {
  
set_hudmessage(02550, -1.0, -1.0)
  
show_hudmessage(id"You respawned!")
 
  
random_spawn(id)
 }
 
 else
 {
  
client_print(idprint_center"[CrazY EffecT] You have no acces to this command!")
 }
}
public 
random_spawn(id)
{
 static 
Float:vOrigin[3],iContents
 
 vOrigin
[0] = random_float(-MAP_MAX,MAP_MAX)
 
vOrigin[1] = random_float(-MAP_MAX,MAP_MAX
 
vOrigin[2] = -MAP_MAX
 
 
do
 {
  if(
vOrigin[2] > MAP_MAX)
   return 
random_spawn(id)
 
  
vOrigin[2] += 10.0
  iContents 
PointContents(vOrigin)
 }
 while(
iContents != CONTENTS_EMPTY)
 
 
vOrigin[2] += 200.0
 
if(PointContents(vOrigin) != CONTENTS_EMPTY)
  return 
random_spawn(id)
 
vOrigin[2] -= 160.0
 
 
for(new iCount 0;iCount 2;iCount++)
 {
  for(new 
Float:flDist = -36.0;flDist 36.0;flDist += 36.0)
  {
   
vOrigin[2] += flDist
 
   vOrigin
[iCount] += 33.0
   
if(PointContents(vOrigin) != CONTENTS_EMPTY)
    return 
random_spawn(id)
   
vOrigin[iCount] -= 33.0
 
   vOrigin
[iCount] -= 33.0
   
if(PointContents(vOrigin) != CONTENTS_EMPTY)
    return 
random_spawn(id)
   
vOrigin[iCount] += 33.0  
 
   vOrigin
[2] -= flDist
  
}
 }
 
 new 
iEnt
 
while((iEnt find_ent_in_sphere(iEnt,vOrigin,20.0)) != 0)
  if(
entity_get_int(iEnt,EV_INT_solid) != SOLID_NOT && entity_get_int(id,EV_INT_solid) != SOLID_TRIGGER)
   return 
random_spawn(id)
 
 
entity_set_vector(id,EV_VEC_origin,vOrigin)
 
 if(
entity_get_int(id,EV_INT_flags) & FL_INWATER)
  return 
PLUGIN_CONTINUE
 
 
new iEnts[1]
 
find_sphere_class(id,"player",200.0,iEnts,1)
 
 if(
iEnts[0])
  return 
random_spawn(id)
 
 
set_task(0.1,"fnCheckLocation",id)
 
 return 
PLUGIN_CONTINUE
}
public 
random_spawn_location(id)
{
 new 
iFlags entity_get_int(id,EV_INT_flags)
 if(
iFlags FL_INWATER || iFlags FL_SWIM || iFlags FL_FLOAT)
  
random_spawn(id)

Attached Files
File Type: sma Get Plugin or Get Source (admin_respawn.sma - 569 views - 2.3 KB)
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
 



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 08:50.


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