SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 08/09/2016, 03:20 PM   #1
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,857
Reputation: 602
Default Skin Tags (a bunch of skin info)

Skin Tags!

Well, this is simply just a bunch of getter functions for skins. There isn't much to explain.
__________________________________________________ __________________________________________________

Functions:

pawn Code:
GetSkinName(skinid, output[], outlen = sizeof(output))
GetSkinModelName(skinid, output[], outlen = sizeof(output))
GetSkinSex(skinid)
GetSkinGender(skinid)
GetSkinGenderName(skinid, output[], outlen = sizeof(output))
GetSkinRace(skinid)
GetSkinRaceName(skinid, output[], outlen = sizeof(output))
GetSkinGang(skinid)
GetSkinGangName(skinid, output[], outlen = sizeof(output))
GetSkinService(skinid)
GetSkinServiceName(skinid, output[], outlen = sizeof(output))
GetSkinType(skinid)
GetSkinAnimGroup(skinid)
GetSkinAnimGroupName(skinid, output[], outlen = sizeof(output))
GetSkinGroup(skinid)
GetSkinGroupName(skinid, output[], outlen = sizeof(output))
GetSkinFear(skinid)
GetSkinTemper(skinid)
GetSkinLawfullness(skinid)
GetSkinSexAppeal(skinid)
GetSkinAppeal(skinid)
GetSkinFOF(skinid)
Float:GetSkinStrength(skinid)
Float:GetSkinDefence(skinid)
IsPlayerMale(playerid)
IsPlayerFemale(playerid)
IsValidSkin(skinid)
__________________________________________________ __________________________________________________

Definitions:

pawn Code:
SKIN_GENDER_FEMALE
SKIN_GENDER_MALE

SKIN_RACE_WHITE
SKIN_RACE_BLACK
SKIN_RACE_ASIAN
SKIN_RACE_LATIN

SKIN_GANG_NONE
SKIN_GANG_GROVE
SKIN_GANG_BALLA
SKIN_GANG_AZTECA
SKIN_GANG_VAGO
SKIN_GANG_DANANG
SKIN_GANG_RIFA
SKIN_GANG_TRIAD
SKIN_GANG_BIKER
SKIN_GANG_RUSSIAN
SKIN_GANG_ITALIAN

SKIN_SERVICE_NONE
SKIN_SERVICE_LAW
SKIN_SERVICE_POLICE
SKIN_SERVICE_MIB
SKIN_SERVICE_SHERIFF
SKIN_SERVICE_SWAT
SKIN_SERVICE_FBI
SKIN_SERVICE_ARMY
SKIN_SERVICE_FIRE
SKIN_SERVICE_MEDIC

SKIN_TYPE_OTHER
SKIN_TYPE_BEACH
SKIN_TYPE_FARMER
SKIN_TYPE_WHORE
SKIN_TYPE_SPORT
SKIN_TYPE_HOMELESS
SKIN_TYPE_DEALER
SKIN_TYPE_FOOD
SKIN_TYPE_SECURITY
SKIN_TYPE_CONSTRUCTION
SKIN_TYPE_LAW
SKIN_TYPE_MEDIC
SKIN_TYPE_FIRE
SKIN_TYPE_GANG

SKIN_GROUP_PLAYER
SKIN_GROUP_COP
SKIN_GROUP_MEDIC
SKIN_GROUP_FIREMAN
SKIN_GROUP_GANG
SKIN_GROUP_STREET_GUY
SKIN_GROUP_SUIT_GUY
SKIN_GROUP_SENSIBLE_GUY
SKIN_GROUP_GEEK_GUY
SKIN_GROUP_OLD_GUY
SKIN_GROUP_TOUGH_GUY
SKIN_GROUP_STREET_GIRL
SKIN_GROUP_SUIT_GIRL
SKIN_GROUP_SENSIBLE_GIRL
SKIN_GROUP_GEEK_GIRL
SKIN_GROUP_OLD_GIRL
SKIN_GROUP_TOUGH_GIRL
SKIN_GROUP_TRAMP_MALE
SKIN_GROUP_TRAMP_FEMALE
SKIN_GROUP_TOURIST
SKIN_GROUP_PROSTITUTE
SKIN_GROUP_CRIMINAL
SKIN_GROUP_BUSKER
SKIN_GROUP_TAXI_DRIVER
SKIN_GROUP_PSYCHO
SKIN_GROUP_STEWARD
SKIN_GROUP_SPORTS_FAN
SKIN_GROUP_SHOPPER
SKIN_GROUP_OLD_SHOPPER
SKIN_GROUP_BEACH_GUY
SKIN_GROUP_BEACH_GIRL
SKIN_GROUP_SKATER
SKIN_GROUP_MISSION
SKIN_GROUP_COWARD

SKIN_FOF_WEAK
SKIN_FOF_NORMAL
SKIN_FOF_TOUGH

SKIN_ANIM_BUSY_WOMAN
SKIN_ANIM_FAT_MAN
SKIN_ANIM_GANG
SKIN_ANIM_JOGGER
SKIN_ANIM_JOG_WOMAN
SKIN_ANIM_MAN
SKIN_ANIM_OLD_FAT_WOMAN
SKIN_ANIM_OLD_MAN
SKIN_ANIM_OLD_WOMAN
SKIN_ANIM_PLAYER
SKIN_ANIM_PROSTITUTE
SKIN_ANIM_SEXY_WOMAN
SKIN_ANIM_SKATER
SKIN_ANIM_SWAT
SKIN_ANIM_WOMAN
__________________________________________________ __________________________________________________

Example:

pawn Code:
if(GetSkinGender(GetPlayerSkin(playerid)) == SKIN_GENDER_MALE) // then player has a penis
pawn Code:
if(GetSkinRace(GetPlayerSkin(playerid)) == SKIN_RACE_ASIAN) // then player is asian
__________________________________________________ __________________________________________________

Notes:

- FOF means "Fight or Flight", it's based on how GTA's pedestrians react.
- GetSkin[Strength/Defence] returns a float multiplier. This could be used as a melee attack multiplier or something.
- Sex appeal is group assigned, by Rockstar, so your opinion may vary... Like on that old hag prostitute skin... Gross...
__________________________________________________ __________________________________________________

Credits:

Thanks to the people that contributed to the Skins wiki. Most of the information here is based on that.
Thanks to Counterafk. I used his race list.
__________________________________________________ __________________________________________________

Suggestions:

If you think anything else should be added or you have any problems, just let me know.
__________________________________________________ __________________________________________________

Download Here!
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!

Last edited by Crayder; 11/09/2016 at 08:32 PM.
Crayder is offline   Reply With Quote
Old 08/09/2016, 03:23 PM   #2
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,807
Reputation: 831
Default Re: Skin Tags (a bunch of skin info)

Lol, skin shit got real!
__________________

My GitHub:

Gammix is offline   Reply With Quote
Old 08/09/2016, 05:00 PM   #3
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,857
Reputation: 602
Default Re: Skin Tags (a bunch of skin info)

Quote:
Originally Posted by Gammix View Post
Lol, skin shit got real!
Well, I've had the base of this for a while, since around the time the new skins were added. It was meant to be a module in TS for an AddPlayerClass thing I was doing (which I should pick back up now that 1.9 is in the works).

Then when that guy posted the races I added them and made it releasable.

Edit: Just realized I forgot to do return values in the string functions... Also, I'll add invalid ID checks.
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!
Crayder is offline   Reply With Quote
Old 08/09/2016, 05:04 PM   #4
Logic_
High-roller
 
Logic_'s Avatar
 
Join Date: Jun 2015
Location: 666
Posts: 1,491
Reputation: 268
Default Re: Skin Tags (a bunch of skin info)

Cool work, Homie. +rep
__________________
Premium quality and reasonable pricing game Server hosting
Logic_ is offline   Reply With Quote
Old 08/09/2016, 05:22 PM   #5
Crystallize
Banned
 
Join Date: Aug 2013
Posts: 1,595
Reputation: 314
Default Re: Skin Tags (a bunch of skin info)

Nice release Crayder, looks good.
Crystallize is offline   Reply With Quote
Old 08/09/2016, 06:18 PM   #6
Kaliber
Gangsta
 
Kaliber's Avatar
 
Join Date: Jun 2012
Location: Localhost
Posts: 914
Reputation: 123
Default Re: Skin Tags (a bunch of skin info)

You should use
PHP Code:
static const 
, and pack these strings to save space

But gj anyway
__________________
Kaliber is offline   Reply With Quote
Old 08/09/2016, 06:40 PM   #7
Stinged
High-roller
 
Join Date: Feb 2013
Posts: 1,588
Reputation: 187
Default Re: Skin Tags (a bunch of skin info)

Useful for some servers, good job.

But I'm a bit of an "optimization freak" and it'll really bother me if I don't post this, sorry.

Quote:
Code:
s_GangNames[][24]
Should be
Code:
s_GangNames[][18]
-------------------------------------
Quote:
Code:
s_ServiceNames[][24]
Should be
Code:
s_ServiceNames[][13]
-------------------------------------
Quote:
Code:
enum e_SKIN_INFO {
    e_SKIN_MODEL_NAME[32],
    e_SKIN_NAME[64],
    e_SKIN_FLAGS
}
Should be
Code:
enum e_SKIN_INFO {
    e_SKIN_MODEL_NAME[8],
    e_SKIN_NAME[52],
    e_SKIN_FLAGS
}
-------------------------------------
Quote:
Code:
stock GetSkinName(skinid, output[], outlen = sizeof(output)) {
    format(output, outlen, "%s", SkinInfoList[skinid][e_SKIN_NAME]);
}

format(output, outlen, "caucasian");

(and others)
Should be
Code:
stock GetSkinName(skinid, output[], outlen = sizeof(output)) {
    output[0] = 0;
    strcat(output, SkinInfoList[skinid][e_SKIN_NAME], outlen);
}

output[0] = 0;
strcat(output, "caucasian", outlen);

(and others)
Stinged is offline   Reply With Quote
Old 08/09/2016, 06:46 PM   #8
ZiGGi
High-roller
 
ZiGGi's Avatar
 
Join Date: Sep 2008
Location: Russia
Posts: 1,739
Reputation: 355
Default Re: Skin Tags (a bunch of skin info)

I think that better realization should be function like GetSkinFlags, this will make all checks more easier:
PHP Code:
if (GetSkinFlags(skinid) & (SKIN_GENDER_MALE SKIN_RACE_WHITE SKIN_SERVICE_FIRE)) 
and this will simplify realization, instead a lot of ugly defines, we can use enum:
PHP Code:
enum (<<= 1) {
    
SKIN_GENDER_FEMALE 1,
    
SKIN_GENDER_MALE,
    
SKIN_RACE_WHITE,
    
SKIN_RACE_BLACK,
    
SKIN_RACE_ASIAN,
    
SKIN_RACE_LATIN,
    
// ...

P.S. About strings optimization: i've send PR to the repo: https://github.com/Crayder/Skin-Tags/pull/1
ZiGGi is offline   Reply With Quote
Old 08/09/2016, 06:58 PM   #9
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,857
Reputation: 602
Default Re: Skin Tags (a bunch of skin info)

Quote:
Originally Posted by ZiGGi View Post
I think that better realization should be function like GetSkinFlags, this will make all checks more easier:
PHP Code:
if (GetSkinFlags(skinid) & (SKIN_GENDER_MALE SKIN_RACE_WHITE SKIN_SERVICE_FIRE)) 
and this will simplify realization, instead a lot of ugly defines, we can use enum:
PHP Code:
enum (<<= 1) {
    
SKIN_GENDER_FEMALE 1,
    
SKIN_GENDER_MALE,
    
SKIN_RACE_WHITE,
    
SKIN_RACE_BLACK,
    
SKIN_RACE_ASIAN,
    
SKIN_RACE_LATIN,
    
// ...

That's just not how I wanted it set up. I prefer reading the binary myself for things like this. And the way I have it isn't set up for the normal binary options, like you can't have a skin be a sportster and a beach visitor, only one or the other (which is fine since all of the skins follow this except one skater chick).

And about the PR, I'll add it for the packed strings but I am keeping the ternary. Thanks ZiGGi!
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!
Crayder is offline   Reply With Quote
Old 08/09/2016, 07:55 PM   #10
Farzam
Little Clucker
 
Farzam's Avatar
 
Join Date: Sep 2015
Location: on Earth
Posts: 43
Reputation: 12
Default Re: Skin Tags (a bunch of skin info)

Nice one. +rep
Farzam is offline   Reply With Quote
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Skin changeCommand works but doesnt change skin SkillNasr Scripting Help 4 27/06/2016 07:16 PM
[Include] xskins.inc - Skins Info + Skin Check Optimizations Yashas Includes 7 25/01/2014 01:40 PM
Why when choosing skin, the skin doesnt show ? bustern Scripting Help 4 28/08/2013 01:54 PM
Help me to change skin on player class select - read for more info please help! buonggiorno Help Archive 1 19/01/2010 09:17 PM


All times are GMT. The time now is 04:32 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.