Raised This Month: $51 Target: $400
 12% 

[CS:S] Tempo Advert 1.1


Post New Thread Reply   
 
Thread Tools Display Modes
Author
dordnung
Veteran Member
Join Date: Apr 2010
Plugin ID:
1616
Plugin Version:
1.1
Plugin Category:
Fun Stuff
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Show your current Speed in a HUD Box
    Unapprover:
    Reason for Unapproving:
    Duplicate.
    Old 04-25-2010 , 10:18   [CS:S] Tempo Advert 1.1
    Reply With Quote #1

    Tempo Advert v1.1


    Description:

    This addon simple shows the current speed of each player in a HUD box

    You can turn it on/off with !speed in the chat or sm_speed in the console

    You can choice between KmH and Mph

    Installation:

    Copy the 2 folders in your cstrike folder
    Edit the config file
    Restart your server


    It's my first Sourcemod plugin

    So, have fun with it
    Attached Thumbnails
    Click image for larger version

Name:	speed.jpg
Views:	378
Size:	11.1 KB
ID:	64347  
    Attached Files
    File Type: zip TempoAdvert.zip (6.5 KB, 201 views)
    File Type: sp Get Plugin or Get Source (tempo.sp - 471 views - 2.8 KB)
    __________________

    Last edited by dordnung; 04-25-2010 at 13:01.
    dordnung is offline
    Scone
    Senior Member
    Join Date: Apr 2010
    Location: England
    Old 04-25-2010 , 11:14   Re: [CS:S] Tempo Advert
    Reply With Quote #2

    Instead of hooking the say commands, it's better to hook the commands you want directly (in this case, "sm_speed"). Then SourceMod handles the "!" prefix for you.

    You could get rid of the Command_Say function (and the PlayerWant function) and replace it with:

    PHP Code:
    public Action:Command_Speed(client,args)
    {
        
    playerw[client] = !playerw[client];
        
        if(
    playerw[client]) {
            
    PrintToChat(client"\x03Tempo Advert \x08ON");
        } else {
            
    PrintToChat(client"\x03Tempo Advert \x08OFF");
            
    PrintHintText(client"Tempo Advert OFF");
        }
        
        return 
    Plugin_Handled;

    Then in the OnPluginStart function, hook sm_speed:

    PHP Code:
    RegConsoleCmd("sm_speed"Command_Speed); 
    Just be sure to add a "bool:" tag to the "playerw" array.

    Sorry for the criticism, I know this is your first plugin
    __________________
    Scone is offline
    dordnung
    Veteran Member
    Join Date: Apr 2010
    Old 04-25-2010 , 11:24   Re: [CS:S] Tempo Advert
    Reply With Quote #3

    Yeah, it's good that you say, what would be better, how should I know otherwise

    Can I write it then in the Chat or only in console?
    __________________

    Last edited by dordnung; 04-25-2010 at 11:31.
    dordnung is offline
    Scone
    Senior Member
    Join Date: Apr 2010
    Location: England
    Old 04-25-2010 , 11:28   Re: [CS:S] Tempo Advert
    Reply With Quote #4

    It would let you do it in both: "sm_speed" in console and "!speed" in chat. Plus, users can bind "sm_speed" to a key if they want to turn it on/off quickly.
    __________________
    Scone is offline
    dordnung
    Veteran Member
    Join Date: Apr 2010
    Old 04-25-2010 , 11:32   Re: [CS:S] Tempo Advert
    Reply With Quote #5

    Is there a easyer way for a chat message?
    __________________
    dordnung is offline
    Scone
    Senior Member
    Join Date: Apr 2010
    Location: England
    Old 04-25-2010 , 11:43   Re: [CS:S] Tempo Advert
    Reply With Quote #6

    I don't understand what you mean

    If you remove the hooks for "say" and "sayteam", and replace them with a hook for "sm_speed" as I showed above, SourceMod automatically handles the chat commands ("!speed") for you.
    __________________
    Scone is offline
    dordnung
    Veteran Member
    Join Date: Apr 2010
    Old 04-25-2010 , 11:44   Re: [CS:S] Tempo Advert
    Reply With Quote #7

    Ah ok, thats nice ;)
    __________________
    dordnung is offline
    dordnung
    Veteran Member
    Join Date: Apr 2010
    Old 04-25-2010 , 12:06   Re: [CS:S] Tempo Advert 1.1
    Reply With Quote #8

    Updated to 1.1

    Console CMD sm_speed available
    __________________
    dordnung is offline
    Annihilator
    Senior Member
    Join Date: Nov 2006
    Location: Lithuania
    Old 04-26-2010 , 13:19   Re: [CS:S] Tempo Advert 1.1
    Reply With Quote #9

    Would it be possible to make that when you spectate a person you see his speed too?
    Annihilator is offline
    dordnung
    Veteran Member
    Join Date: Apr 2010
    Old 04-26-2010 , 14:07   Re: [CS:S] Tempo Advert 1.1
    Reply With Quote #10

    i don't think this is possible, but i'am not sure
    __________________
    dordnung is offline
    Reply



    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:36.


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