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

AWP Models [XP System Support]


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay       
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-01-2017 , 08:15   AWP Models [XP System Support]
Reply With Quote #1



AWP Models


Description

  • A simple plugin that adds a menu from which you can choose your AWP skin. The menu can be accessed by typing /awp in the chat.


Cvars

  • am_open_at_spawn "0" -- whether the menu will be automatically opened on first spawn
  • am_save_choice "0" -- whether the selected skin will be saved via SteamID after leaving the server


Adding skins

  • The skins can be added in configs/AWPModels.ini by following the example:

    PHP Code:
    [Skin Name]
    V_MODEL path to v_ model
    P_MODEL 
    path to p_ model 
  • If the skin doesn't have a p_ model, you can choose not to add the P_MODEL field.
  • You can also add a sound when selected, assign a admin flag or a level from the rank system:

    PHP Code:
    [Skin Name]
    V_MODEL path to v_ model
    P_MODEL 
    path to p_ model
    FLAG 
    = if you want the skin to be for VIP users/adminsenter the flag here
    LEVEL 
    required level (requires OciXCrom's Rank System)
    SHOW_RANK = if set to 1, the rank name will be displayed instead of the level number (requires OciXCrom'
    s Rank System)
    XP required XP (requires OciXCrom's Rank System)
    SELECT_SOUND = sound when selecting the skin from the menu 
  • Example:

    PHP Code:
    [My Cool AWP]
    V_MODEL models/v_coolawp.mdl
    P_MODEL 
    models/p_coolawp.mdl
    FLAG 
    b
    LEVEL 
    15
    SHOW_RANK 
    1
    XP 
    5000
    SELECT_SOUND 
    coolawp/select.wav 



__________________

Last edited by OciXCrom; 07-17-2018 at 09:03.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 02-01-2017 , 08:20   Re: AWP Models
Reply With Quote #2

I think adding a cvar for put a message in the menu is not a good idea, do you? Will be better users change them in the .ini file.

I like this, most of users here will like aswell. Will be good with more weapons.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

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

Last edited by EFFx; 02-01-2017 at 08:23.
EFFx is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-01-2017 , 08:46   Re: AWP Models
Reply With Quote #3

Why is it a bad idea? It's usually a bad idea when the message is supposed to be long, but in this case it's only one word with a few colors that needs to fit in one line in the menu, so I don't think that's a problem.

I made this especially for an AWP server, so that's why I didn't add an option for all the other weapons, plus I don't really feel like doing such a big plugin. I also have another one for a knife server with knife models, but I don't know if it is a good idea to post both.
__________________

Last edited by OciXCrom; 02-01-2017 at 09:17.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 02-01-2017 , 13:59   Re: AWP Models
Reply With Quote #4

If you think that it can be how its right now, just do what your mind says.

Yea, the code will be so much long, but just use your knowledge with enumerates and arrays, you know so much things with these formats. You can minimize so much lines with this.

Here's my changes:

1. In ColorChat():

You can cache the value of iPlayers[i] with an interger.
You need not start the iCount with 1
is_user_connected() is not needed

Here:

PHP Code:
message_begin(MSG_ONE_UNRELIABLEg_iSayText_iPlayers[i]) 
You can do .player = Player or your interger's name. Just for skip this '_,'. Just a small thing.

And you're using the g_iSayText just one time, you can cache only if you use a native more than one time. Just add get_user_msgid("SayText").
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

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

Last edited by EFFx; 02-01-2017 at 14:28.
EFFx is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-01-2017 , 15:10   Re: AWP Models
Reply With Quote #5

I don't want to make this code complicated and use .ini files for settings. The least I can do is add a lang file and put all the messages there.

That ColorChat is not even mine, I have been using it since forever and approvers don't have a problem with it. But now that you mention it, you're right, maybe it should be fixed, but I really don't want to experiment with it, since I haven't had any problems with it. It starts from 0 with a reason, take a look at the beginning of the function. However, you're wrong about the SayText part. The code is used every time when ColorChat is called, aka every time a message is sent, so it will search the msgid every time it is used. Caching it in plugin_init will is totally correct.
__________________

Last edited by OciXCrom; 02-01-2017 at 15:13.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 02-01-2017 , 15:13   Re: AWP Models
Reply With Quote #6

Okay.

Yea yea, I was wrong, I've searched and everyone use like this, you're totally right, my mistake. And I knew its not your ColorChat.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

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

Last edited by EFFx; 02-01-2017 at 15:13.
EFFx is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-05-2017 , 13:01   Re: AWP Models
Reply With Quote #7

Update v1.3 @ 05.02.2017
  • Added a lang file from where you can change the text.
  • Removed text cvars.
__________________

Last edited by OciXCrom; 02-05-2017 at 13:01.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 02-05-2017 , 16:07   Re: AWP Models
Reply With Quote #8

PHP Code:
format(szMessage[0], charsmax(szMessage), "%L %s"id id LANG_PLAYER"AM_CHAT_PREFIX"szMessage
I think is something wrong here, do you?

You doesn't make all changes I said on ColorChat().
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

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

Last edited by EFFx; 02-05-2017 at 16:10.
EFFx is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-05-2017 , 16:19   Re: AWP Models
Reply With Quote #9

What's wrong? I didn't do any changes because you said you're wrong, or did you change your mind now?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 02-05-2017 , 16:23   Re: AWP Models
Reply With Quote #10

I said i was wrong about the MsgSayText ._.
And, why would you add a ML for the tag prefix? Or I've readed it wrong?
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

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

Last edited by EFFx; 02-05-2017 at 16:23.
EFFx 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 09:36.


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