AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Spec plugin (https://forums.alliedmods.net/showthread.php?t=75064)

AntiBots 07-29-2008 21:43

Spec plugin
 
Hi friends. I have a problem.

This plugin change people that are in spec to CT o T
Well, when a player change to a X team, dont have HP, AP, CrossMirror.
That I have to do:

PHP Code:

/* Script generated by Pawn Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <colorchat>
#define PLUGIN "Spec To CT o T"
#define AUTHOR "ReymonARG"
#define VERSION "1.0"
#define CS_TEAM_SPEC 3
public plugin_init()
{
 
register_plugin(PLUGINVERSIONAUTHOR)
 
register_clcmd("say /ct""gotoct")
 
register_clcmd("say /tt""gotott")
}

public 
gotoct(id) {
    if(
get_user_team(id) == CS_TEAM_SPEC)
    {
      
cs_set_user_team(idCS_TEAM_CT);
    }
 
 if(
get_user_team(id) !== CS_TEAM_SPEC)
 {
 
ColorChat(id,RED,"No tiene permitido cambiarte de Equipo");
 }
}  
public 
gotott(id) {
    if(
get_user_team(id) == CS_TEAM_SPEC)
    {
       
cs_set_user_team(idCS_TEAM_T);
    }
 
 if(
get_user_team(id) !== CS_TEAM_SPEC)
 {
 
ColorChat(id,RED,"No tiene permitido cambiarte de Equipo");
 }



ot_207 07-30-2008 03:41

Re: Spec plugin
 
When a player is spectator and his team is changed from spectator to CT/T then the respective player will be dead.
In this case you need to respawn him.
A good example in this script is AMXX SUPER which from what I remember had an /spec /unspec function which transfered you to spectator and to your old team.

Amxx Super

AntiBots 07-30-2008 13:05

Re: Spec plugin
 
Thank :D

Dores 08-14-2008 20:58

Re: Spec plugin
 
I'm pretty sure that:

wrong
PHP Code:

!== 

right
PHP Code:

!= 



All times are GMT -4. The time now is 05:34.

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