AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Spec-CT spawn on place problem (https://forums.alliedmods.net/showthread.php?t=114020)

J4CK 01-01-2010 11:23

Spec-CT spawn on place problem
 
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" :oops:

Xellath 01-01-2010 11:43

Re: Spec-CT spawn on place problem
 
I made that for a guy some time ago.

Here: http://forums.alliedmods.net/showpos...27&postcount=4

J4CK 01-01-2010 12:06

Re: Spec-CT spawn on place problem
 
Quote:

Originally Posted by Xellath (Post 1038985)
I made that for a guy some time ago.

Here: http://forums.alliedmods.net/showpos...27&postcount=4

ty Xellath


All times are GMT -4. The time now is 04:15.

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