Raised This Month: $ Target: $400
 0% 

Skin System 2.33


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay       
DeRoiD
Senior Member
Join Date: Feb 2015
Old 04-27-2015 , 11:54   Skin System 2.33
Reply With Quote #1

Skin System
Version: v2.33
First relase: 2015. 04. 26
Last update: 2015. 05. 03


Description
If you kill enemy with a weapon then have you done +1 weapon point (example ak47) and earn the needed points then collect skin.

Add new skin
Open skins.cfg file [addons/amxmodx/configs/skinsystem/]
Write the new skin
"weapon type" "v mdl (not important)" "p mdl (not important)" "needed kill" "weapon skin name"
examples :
"ak47" "models/papaja_clan/v_ak47.mdl" "" "25" "Asiimov AK47"
"p90" "models/banana_clan/v_p90.mdl" "models/banana_clan/p_p90.mdl" "77" "Carbon P90"

Weapon types
Code:
P228
Scout
He Grenade
XM1014
MAC10
AUG
Elite
Five-Seven
UMP45
SG550
Galil
FAMAS
USP
Glock18
AWP
MP5
M249
M3
M4A1
TMP
G3SG1
Deagle
SG552
AK47
Knife
P90

Cvars
  • skin_s_savemod [Save Mod]
    • 0 - Name (If you have special characters in your player names then use UTF-8 coded. -> save.ini)
    • 1 - Internet Protocol (IP)
    • 2 - Steam ID [default]
Commands
  • My points - /mykills
  • Other player points - /kills "Player name"
  • Show weapon skins - /skins "weapon name"
Screenshots




C
ompatible AMX versions
  • AMX 1.8.0 [Not tested]
  • AMX 1.8.1 [Not tested]
  • AMX 1.8.2 [Tested] (It works)
  • AMX 1.8.3 [Tested] (It works)
Attached Files
File Type: zip cstrike.zip (3.44 MB, 4737 views)
File Type: sma Get Plugin or Get Source (skinsystem.sma - 6212 views - 11.6 KB)
__________________

Last edited by DeRoiD; 05-03-2015 at 05:25.
DeRoiD is offline
taulalan
New Member
Join Date: Apr 2015
Old 04-28-2015 , 05:36   Re: Skin System
Reply With Quote #2

Wonderful.
can do better preservation SteamID?
taulalan is offline
Send a message via Skype™ to taulalan
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 04-28-2015 , 08:08   Re: Skin System
Reply With Quote #3

Why do you save the points by name? Using SteamID is way more secure.
__________________
Kia is offline
tousif
AlliedModders Donor
Join Date: Nov 2014
Location: India
Old 04-28-2015 , 09:15   Re: Skin System
Reply With Quote #4

Quote:
Originally Posted by Kia View Post
Why do you save the points by name? Using SteamID is way more secure.
Yea using steam id is more secure :p as by name , anyone can copy name so use steam id

comming to skins just changing color ,instead of that use different skins, cs:go type skins would be awsome

Last edited by tousif; 04-28-2015 at 09:20.
tousif is offline
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 04-28-2015 , 09:15   Re: Skin System
Reply With Quote #5

Quote:
Originally Posted by Kia View Post
Why do you save the points by name?
Isn't this obvious?
__________________

Mordekay is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 04-28-2015 , 11:17   Re: Skin System
Reply With Quote #6

Quote:
Originally Posted by Mordekay View Post
Isn't this obvious?
It is, just wanted him to say it.
__________________
Kia is offline
DeRoiD
Senior Member
Join Date: Feb 2015
Old 04-29-2015 , 13:23   Re: Skin System 2.2
Reply With Quote #7

I edited.
__________________
DeRoiD is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-29-2015 , 14:23   Re: Skin System 2.2
Reply With Quote #8

This plugin may be cool if it would be done correctly.
PHP Code:
 Skin[31][SKINSPERWEAPONS],
vSkinMdl[31][SKINSPERWEAPONS][64], pSkinMdl[31][SKINSPERWEAPONS][64],
SkinName[31][SKINSPERWEAPONS][32], 
Instead of hardcoded customizations limit you can use dynamic arrays(or even better, tries, as key save the original weapon name), so anyone can add as much things as they want.

For your information, any array that should be used with player index must have 33 as dimension, not 31.

PHP Code:
register_event("CurWeapon","WeaponModel","be","1=1"); 
Use Ham_Item_Deploy, instead of this.

PHP Code:
get_user_name(PlayerName31); 
Use charsmax() to get string-array size.

PHP Code:
set_task(1.0"LoadPoints"Player); 
Why a delay here ?

PHP Code:
new Weapon get_user_weapon(Player); 
This initialization should be done under the check to see if player is valid.

PHP Code:
if(strlen(vSkinMdl[Weapon][x]) > 5)
set_pev(Playerpev_viewmodel2vSkinMdl[Weapon][x]);
if(
strlen(pSkinMdl[Weapon][x]) > 5)
set_pev(Playerpev_weaponmodel2pSkinMdl[Weapon][x]); 
Indent your code properly.

Using static in plugin_precache(which is called only one time) is useless.
read_file is deprecated native, use new file natives. You should also check if model path is fully valid(it has models/player/model_name and also .mdl extension) and if it exists on the server before precaching it(file_exists can do the job).

If I'm not wrong, you read the skin file two times. Why ?
Instead of intializing new strings, parse directly with vSkinMdl[Num][Already[Num]], so you won't have to call copy.

PHP Code:
new Motd[1024], Line[256];
    
formatex(Line255"<body bgcolor=^"black^">^n<font color=^"red^">^n");
    
add(Motd1023Line255);
    
formatex(Line255"<p align=^"center^">%s %s by: %s</p></font>^n<font color=^"greenyellow^">^n"PLUGINVERSIONAUTHOR);
    
add(Motd1023Line255); 
This just get repedeted every time. For me, it seems that you should do this one time, and add later the things that are context dependent(I mean that can get changed).

Don't acces cvar values inside a loop, cache it before.

There are other improvements that can be done, but this is something to start with(the most obvious mistakes).
__________________
HamletEagle is offline
DeRoiD
Senior Member
Join Date: Feb 2015
Old 04-29-2015 , 14:49   Re: Skin System 2.2
Reply With Quote #9

HamletEagle
31 is not Player ID.
31 is weapon ID.
__________________
DeRoiD is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-29-2015 , 15:05   Re: Skin System 2.2
Reply With Quote #10

Ooops, nevermind. Just didn't pay attention on how you fill the array.
__________________
HamletEagle 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 04:53.


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