AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [TF2]Set Team (https://forums.alliedmods.net/showthread.php?t=313014)

iamf2p 12-25-2018 03:33

[TF2]Set Team
 
2 Attachment(s)
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

iamf2p 12-25-2018 03:39

Re: [TF2]Set Team
 
Let me know if there's anything wrong.

iamf2p 12-25-2018 03:43

Re: [TF2]Set Team
 
I think my plugins has so many problem

iamf2p 12-25-2018 03:53

Re: [TF2]Set Team
 
navermind!

404UserNotFound 12-25-2018 10:39

Re: [TF2]Set Team
 
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

iamf2p 12-26-2018 02:04

Re: [TF2]Set Team
 
Thanks

iamf2p 12-26-2018 02:38

Re: [TF2]Set Team
 
oh my god
I found that\

iamf2p 12-26-2018 02:39

Re: [TF2]Set Team
 
wait a second
how to edit attached files?

JoinedSenses 12-26-2018 10:35

Re: [TF2]Set Team
 
Edit -> Go Advanced -> Manage Attachments

Ronas963 05-21-2021 16:59

Re: [TF2]Set Team
 
Problem is it setteam sentry can shoot me


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

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