Raised This Month: $32 Target: $400
 8% 

make anything for CT only


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yas17sin
Veteran Member
Join Date: Oct 2016
Location: Morocco/Sale
Old 01-28-2017 , 14:07   make anything for CT only
Reply With Quote #1

Hi guys

i need to know how to restict something from Ts .

and make it for CTs only so Ts can't be able to pickup it or purchase it or any other thing.

but when Ts transfer to CTs he can get it then.
yas17sin is offline
Send a message via ICQ to yas17sin
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-28-2017 , 14:30   Re: make anything for CT only
Reply With Quote #2

https://www.amxmodx.org/api/cstrike/cs_get_user_team
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
yas17sin
Veteran Member
Join Date: Oct 2016
Location: Morocco/Sale
Old 01-28-2017 , 15:09   Re: make anything for CT only
Reply With Quote #3

i am just beginner at this stuff and i can't know directley from the examples you give me and also i don't have a good english please explain me more esasy.

Last edited by yas17sin; 01-28-2017 at 15:10.
yas17sin is offline
Send a message via ICQ to yas17sin
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-28-2017 , 16:30   Re: make anything for CT only
Reply With Quote #4

The API says all.

id = Player's ID
model = Player's team ( CS_TEAM_T, CS_TEAM_CT, CS_TEAM_SPECTATOR and CS_TEAM_UNASIGNED )

In your case, you should just use

PHP Code:
if(cs_get_user_team(playerid) == CS_TEAM_CT 
Try make what I'm doing aswell, searching API for learn how to do something. And if you doesn't find anything on the API related to what you're seaching for ( what's hard ), search that stuff here, most of them already exists or already someone are using him and you can copy it.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 01-28-2017 at 16:33.
EFFx is offline
yas17sin
Veteran Member
Join Date: Oct 2016
Location: Morocco/Sale
Old 01-28-2017 , 19:00   Re: make anything for CT only
Reply With Quote #5

Quote:
Originally Posted by EFFx View Post
The API says all.

id = Player's ID
model = Player's team ( CS_TEAM_T, CS_TEAM_CT, CS_TEAM_SPECTATOR and CS_TEAM_UNASIGNED )

In your case, you should just use

PHP Code:
if(cs_get_user_team(playerid) == CS_TEAM_CT 
Try make what I'm doing aswell, searching API for learn how to do something. And if you doesn't find anything on the API related to what you're seaching for ( what's hard ), search that stuff here, most of them already exists or already someone are using him and you can copy it.
Thanks EFFx for your usefull comment i appreciate your help.
yas17sin is offline
Send a message via ICQ to yas17sin
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-29-2017 , 16:26   Re: make anything for CT only
Reply With Quote #6

PHP Code:
if(cs_get_user_team(id) == CS_TEAM_T
         return;                                                     
/* Restrict Terrorists from using */

else 
         
//.. code ..//                                              /* What can CTs do with it */ 
__________________

Last edited by edon1337; 01-29-2017 at 16:26.
edon1337 is offline
yas17sin
Veteran Member
Join Date: Oct 2016
Location: Morocco/Sale
Old 01-29-2017 , 16:45   Re: make anything for CT only
Reply With Quote #7

Quote:
Originally Posted by edon1337 View Post
PHP Code:
if(cs_get_user_team(id) == CS_TEAM_T
         return;                                                     
/* Restrict Terrorists from using */

else 
         
//.. code ..//                                              /* What can CTs do with it */ 
okay Tanks i understand how to do that .
yas17sin is offline
Send a message via ICQ to yas17sin
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 01-29-2017 , 17:24   Re: make anything for CT only
Reply With Quote #8

Quote:
Originally Posted by edon1337 View Post
PHP Code:
if(cs_get_user_team(id) == CS_TEAM_T
         return;                                                     
/* Restrict Terrorists from using */

else 
         
//.. code ..//                                              /* What can CTs do with it */ 
Dont do that. Despite it it will work, but there is no reason for the dangling `else` unbraced.

Do something like:
PHP Code:
if(cs_get_user_team(id) == CS_TEAM_T
{
    return;                                                     
/* Restrict Terrorists from using */
}
else 
{
    
//.. code ..//                                             /* What can CTs do with it */

or
PHP Code:
if(cs_get_user_team(id) == CS_TEAM_T
    return;                                                         
/* Restrict Terrorists from using */

//.. code ..//                                                      /* What can CTs do with it */ 
or
PHP Code:
if(cs_get_user_team(id) == CS_TEAM_T) return;                       /* Restrict Terrorists from using */

//.. code ..//                                                      /* What can CTs do with it */ 
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 01-29-2017 at 18:28.
addons_zz is offline
yas17sin
Veteran Member
Join Date: Oct 2016
Location: Morocco/Sale
Old 01-29-2017 , 18:19   Re: make anything for CT only
Reply With Quote #9

Quote:
Originally Posted by edon1337 View Post
PHP Code:
if(cs_get_user_team(id) == CS_TEAM_T) return;                       /* Restrict Terrorists from using */

//.. code ..//                                                       /* What can CTs do with it */ 
that's look more easy and simple. Thanks For making examples.
yas17sin is offline
Send a message via ICQ to yas17sin
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-30-2017 , 07:59   Re: make anything for CT only
Reply With Quote #10

Quote:
Originally Posted by addons_zz View Post
Dont do that. Despite it it will work, but there is no reason for the dangling `else` unbraced.

Do something like:
PHP Code:
if(cs_get_user_team(id) == CS_TEAM_T
{
    return;                                                     
/* Restrict Terrorists from using */
}
else 
{
    
//.. code ..//                                             /* What can CTs do with it */

or
PHP Code:
if(cs_get_user_team(id) == CS_TEAM_T
    return;                                                         
/* Restrict Terrorists from using */

//.. code ..//                                                      /* What can CTs do with it */ 
or
PHP Code:
if(cs_get_user_team(id) == CS_TEAM_T) return;                       /* Restrict Terrorists from using */

//.. code ..//                                                      /* What can CTs do with it */ 
Braces weren't needed in this example.

@yas17in I don't suggest skipping 'else', you might mess up sometimes.
__________________
edon1337 is offline
Reply


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


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