Raised This Month: $ Target: $400
 0% 

Spec-CT spawn on place problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
J4CK
Member
Join Date: Dec 2008
Location: India
Old 01-01-2010 , 11:23   Spec-CT spawn on place problem
Reply With Quote #1

PHP Code:
#include <amxmodx> 
#include <colorchat> 
#include <fakemeta> 
#include <cstrike> 
#include <hamsandwich> 

public plugin_init() 

   
register_clcmd("say /ct""cmdCounterTerrorist"); 
   
register_clcmd("say_team /ct""cmdCounterTerrorist"); 
   
register_clcmd("say /spec""cmdSpectator"); 
   
register_clcmd("say_team /spec""cmdSpectator"); 

   
set_msg_block(get_user_msgid("ClCorpse"), BLOCK_SET); 


public 
cmdSpectator(id

   if(
cs_get_user_team(id) == CS_TEAM_SPECTATOR){ 
      return 
PLUGIN_HANDLED
   } 

   
user_silentkill(id); 

   
cs_set_user_team(idCS_TEAM_SPECTATOR); 

   new 
namex[32]; 
   
get_user_name(idnamex31); 

   
ColorChat(0GREEN"^x04[KZ] %s has been switched to the SPECTATORS by request."namex); 

   return 
PLUGIN_CONTINUE


public 
cmdCounterTerrorist(id

   if(
cs_get_user_team(id) == CS_TEAM_CT){ 
      return 
PLUGIN_HANDLED
   } 

   
cs_set_user_team(idCS_TEAM_CT); 

   
ExecuteHamB(Ham_CS_RoundRespawnid); 

   if(!
user_has_weapon(idCSW_KNIFE)){ 
      
fm_give_item(id"weapon_knife"); 
   } 

   if(!
user_has_weapon(idCSW_USP)){ 
      
fm_give_item(id"weapon_usp"); 
   } 

   new 
namex[32]; 
   
get_user_name(idnamex31); 

   
ColorChat(0GREEN"^x04[KZ] %s has been switched to the CT by request"namex); 

   return 
PLUGIN_CONTINUE


fm_give_item(id, const item[]) 

   new 
ent engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocStringitem)); 

   if(!
pev_valid(ent)){ 
      return 
0
   } 

   new 
Float:origin[3]; 
   
pev(idpev_originorigin); 
   
set_pev(entpev_originorigin); 
   
set_pev(entpev_spawnflagspev(entpev_spawnflags) | SF_NORESPAWN); 
   
dllfunc(DLLFunc_Spawnent); 
   new 
save pev(entpev_solid); 
   
dllfunc(DLLFunc_Touchentid); 

   if(
pev(entpev_solid ) != save){ 
      return 
ent
   } 

   
engfunc(EngFunc_RemoveEntityent); 

   return -
1

When player write "/cp" > "/spec" > "/ct" (player spawn on his checkpoint) its ok

but...
My problem is, when player write "/spec" > "/ct" , he spawn on CT spawn!

Need, when player write "/spec" > "/ct" , he spawn on place where he write "/spec"
J4CK is offline
 


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 04:15.


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