Raised This Month: $ Target: $400
 0% 

Is this a good script? [admin_respawn.sma]


Post New Thread Reply   
 
Thread Tools Display Modes
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 - 570 views - 2.3 KB)
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
iNspiratioN
Member
Join Date: Feb 2009
Location: Lithuania
Old 03-07-2009 , 12:47   Re: Is this a good script? [admin_respawn.sma]
Reply With Quote #2

What do you mean? You want us to check the code?
iNspiratioN is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 03-07-2009 , 13:05   Re: Is this a good script? [admin_respawn.sma]
Reply With Quote #3

Yes, i'm not a good scripter, i'm still learning
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
iNspiratioN
Member
Join Date: Feb 2009
Location: Lithuania
Old 03-07-2009 , 13:10   Re: Is this a good script? [admin_respawn.sma]
Reply With Quote #4

Got any error's?
iNspiratioN is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 03-07-2009 , 13:46   Re: Is this a good script? [admin_respawn.sma]
Reply With Quote #5

Check Mole from shopmenu @ war3ft.
__________________

anakin_cstrike is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 03-07-2009 , 13:59   Re: Is this a good script? [admin_respawn.sma]
Reply With Quote #6

I don't got errors, but if i type /respawn, i don't respawn

There just is a message: You respawned
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
Starsailor
horrible hahah
Join Date: Aug 2008
Location: Buenos Aires
Old 03-07-2009 , 14:08   Re: Is this a good script? [admin_respawn.sma]
Reply With Quote #7

check this

http://forums.alliedmods.net/showpos...98&postcount=2
__________________
Find my plugins here..

Ex - Spanish Moderator.
Starsailor is offline
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 03-07-2009 , 14:40   Re: Is this a good script? [admin_respawn.sma]
Reply With Quote #8

do you want them to spawn by purchasing it or respawn by typing it?

EDIT: Try This

Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <engine>
new PLUG[] = "Admin Respawn";
new VERS[] = "1.0";
new AUTH[] = "LeviN";
public plugin_init()
{
    register_plugin(PLUG, VERS, AUTH);
    
    RegisterHam(Ham_DeathNotice, "player", "player_death", 1);
    
    register_clcmd("say /respawn", "cmd_buyspawn");
    register_clcmd("say_team /respawn", "cmd_buyspawn");
}
public cmd_buyspawn(id)
{
 if(get_user_flags(id) & ADMIN_KICK)
 {
  set_hudmessage(0, 255, 0, -1.0, -1.0)
  show_hudmessage(id, "You respawned!")
  set_task(1.0, "StartSpawn", id);
 }
 
 else
 {
  client_print(id, print_center, "[CrazY EffecT] You have no acces to this command!")
 }
}
public StartSpawn(id)
{
    if(!is_user_alive(id))
    {
        cs_set_user_team(id, CS_TEAM_T);
        set_task(1.0, "spawn_again", id);
    }
    return PLUGIN_HANDLED;
}
public spawn_again(id)
{
    ExecuteHamB(Ham_CS_RoundRespawn,id);
}
Attached Files
File Type: sma Get Plugin or Get Source (ce_spawn.sma - 561 views - 1.1 KB)
__________________

Last edited by DruGzOG; 03-07-2009 at 14:49.
DruGzOG is offline
Send a message via AIM to DruGzOG
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 03-08-2009 , 06:47   Re: Is this a good script? [admin_respawn.sma]
Reply With Quote #9

None of those works...

@starsailor
I need a plugin when you type /respawn (you need to be admin) that you need to respawn

@DrugZog
Just doesnt work...
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 03-08-2009 , 10:44   Re: Is this a good script? [admin_respawn.sma]
Reply With Quote #10

Try This
Attached Files
File Type: sma Get Plugin or Get Source (ce_spawn.sma - 560 views - 1.1 KB)
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
Reply



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