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

[TF2]Set Team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iamf2p
Member
Join Date: Nov 2018
Old 12-25-2018 , 03:33   [TF2]Set Team
Reply With Quote #1

sm_setteam <target> <teamnumber or red blue spec>

allow capital and small letter

example:

sm_setteam @me red
sm_setteam @me BlUe
sm_setteam @me blue
sm_setteam @me spec
sm_setteam @me spec
sm_setteam @me 0 = spectator(do not use that!)
sm_setteam @me 1 = spectator
sm_setteam @me 2 = red
sm_setteam @me 3 = blue
sm_setteam @all blue
Attached Files
File Type: smx SetF_Team.smx (6.6 KB, 193 views)
File Type: sp Get Plugin or Get Source (SetF_Team.sp - 353 views - 4.2 KB)
iamf2p is offline
iamf2p
Member
Join Date: Nov 2018
Old 12-25-2018 , 03:39   Re: [TF2]Set Team
Reply With Quote #2

Let me know if there's anything wrong.
iamf2p is offline
iamf2p
Member
Join Date: Nov 2018
Old 12-25-2018 , 03:43   Re: [TF2]Set Team
Reply With Quote #3

I think my plugins has so many problem
iamf2p is offline
iamf2p
Member
Join Date: Nov 2018
Old 12-25-2018 , 03:53   Re: [TF2]Set Team
Reply With Quote #4

navermind!

Last edited by iamf2p; 12-25-2018 at 03:53.
iamf2p is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 12-25-2018 , 10:39   Re: [TF2]Set Team
Reply With Quote #5

Very good for a first plugin. I'd fix the indentation up a bit though, something like this:

PHP Code:
public Action SayCallback(int client, const char[] commandint argc)
{
    if(
TF2_GetClientTeam(client) != TFTeam_Spectator)
    {
        return 
Plugin_Continue;
    }
    else
    {
        return 
Plugin_Handled;
    }

Note the additional indenting of the returns. I newline'd the brackets too, but that's just a stylistic choice on my part. You can keep the brackets wherever you like.

Also, for your "SetTeam" stock, you may want to change that to say "stock void SetTeam" as the function doesn't have any "return" lines. If there's no "return" lines, the datatype for the function should be set to "void".

I went through your plugin and made a few changes to give you an idea of some potentially better ways of doing things as well as some pointers: https://pastebin.com/4SJbMJpP

Last edited by 404UserNotFound; 12-25-2018 at 10:50.
404UserNotFound is offline
iamf2p
Member
Join Date: Nov 2018
Old 12-26-2018 , 02:04   Re: [TF2]Set Team
Reply With Quote #6

Thanks
iamf2p is offline
iamf2p
Member
Join Date: Nov 2018
Old 12-26-2018 , 02:38   Re: [TF2]Set Team
Reply With Quote #7

oh my god
I found that\
iamf2p is offline
iamf2p
Member
Join Date: Nov 2018
Old 12-26-2018 , 02:39   Re: [TF2]Set Team
Reply With Quote #8

wait a second
how to edit attached files?
iamf2p is offline
JoinedSenses
Senior Member
Join Date: Sep 2013
Old 12-26-2018 , 10:35   Re: [TF2]Set Team
Reply With Quote #9

Edit -> Go Advanced -> Manage Attachments
__________________
JoinedSenses is offline
Ronas963
Member
Join Date: Jun 2016
Location: Denmark
Old 05-21-2021 , 16:59   Re: [TF2]Set Team
Reply With Quote #10

Problem is it setteam sentry can shoot me
Ronas963 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 05:02.


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