SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 16/04/2016, 01:38 PM   #1
SaiyanZ
Little Clucker
 
SaiyanZ's Avatar
 
Join Date: Nov 2015
Posts: 43
Reputation: 0
Default How to Set Two Skins for one Faction/Team

Hello
I'm new to samp and i have one question, I made teams using gteam one skin per team, I wanna know how do i make Two skins for one team, Here are my team codes.
Code:
#define Green 0
#define Yellow 1
#define Blue 2
#define Red 3
And down.
Code:
AddPlayerClass(287, 1382.8832,794.5979,10.8280,177.3541, 33, 1000, 24, 1000, 25, 1000);
	  AddPlayerClass(124, 754.6019,274.7502,27.3949,3.6705, 33, 1000, 24, 1000, 25, 1000);
	  AddPlayerClass(73, 1511.1772,-71.0189,19.8995,85.5210, 33, 1000, 24, 1000, 25, 1000);
	  AddPlayerClass(117, 1019.3360,-287.2638,73.9931,178.4066, 33, 1000, 24, 1000, 25, 1000);r
And More Down
Code:
SetPlayerPos(playerid,220.3261,1822.9734,7.5368);
	   SetPlayerCameraLookAt(playerid,220.3261,1822.9734,7.5368);
           SetPlayerCameraPos(playerid,226.7491,1823.0441,7.4141);
	
       if(classid == 0) {
	    SetPlayerSkin(playerid, 287);
        GameTextForPlayer(playerid,"~G~Green",1000,4);
	    SetPlayerColor(playerid, GREEN_COLOR);
	    gTeam[playerid] = 0;
 }
 	if(classid == 1) {
	    SetPlayerSkin(playerid, 124);
        GameTextForPlayer(playerid,"~Y~Yellow",1000,4);
	    SetPlayerColor(playerid, YELLOW_COLOR);
	    gTeam[playerid] = 2;
 }
	if(classid == 2) {
	    SetPlayerSkin(playerid, 73);
        GameTextForPlayer(playerid,"~B~Blue",1000,4);
	    SetPlayerColor(playerid, BLUE_COLOR);
	    gTeam[playerid] = 2;
 }
 	if(classid == 3) {
	    SetPlayerSkin(playerid, 117);
        GameTextForPlayer(playerid,"~R~Red",1000,4);
	    SetPlayerColor(playerid, RED_COLOR);
	    gTeam[playerid] = 0;
 }
	return 1;
}
SaiyanZ is offline   Reply With Quote
Old 16/04/2016, 01:41 PM   #2
[WSF]ThA_Devil
Gangsta
 
[WSF]ThA_Devil's Avatar
 
Join Date: Sep 2010
Location: United Kingdom
Posts: 662
Reputation: 55
Default Re: How to Set Two Skins for one Faction/Team

Set gTeam[playerid] to the same number for the skins that are in same team.
__________________
Quote:
Originally Posted by Shinobu View Post
Somebody save me, I am not a server.
[WSF]ThA_Devil is offline   Reply With Quote
Old 16/04/2016, 01:44 PM   #3
SyS
High-roller
 
SyS's Avatar
 
Join Date: Oct 2015
Posts: 1,939
Reputation: 504
Default Re: How to Set Two Skins for one Faction/Team

PHP Code:
           SetPlayerPos(playerid,220.3261,1822.9734,7.5368);
       
SetPlayerCameraLookAt(playerid,220.3261,1822.9734,7.5368);
           
SetPlayerCameraPos(playerid,226.7491,1823.0441,7.4141);
    
           if(
classid == 0
           {
        new 
skin1[] ={287,56}; //secondary skin is 56 
            
new Random random(sizeof(skin1));
            
SetPlayerSkin(playeridskin1[Random]);
            
GameTextForPlayer(playerid,"~G~Green",1000,4);
        
SetPlayerColor(playeridGREEN_COLOR);
        
gTeam[playerid] = 0;
           } 
do this for rest of codes Note it will randomly give players skin
SyS is offline   Reply With Quote
Old 16/04/2016, 02:28 PM   #4
SaiyanZ
Little Clucker
 
SaiyanZ's Avatar
 
Join Date: Nov 2015
Posts: 43
Reputation: 0
Default Re: How to Set Two Skins for one Faction/Team

Thank you, But any way through which player select skin by themself, 2 Options?
SaiyanZ is offline   Reply With Quote
Old 16/04/2016, 03:24 PM   #5
SyS
High-roller
 
SyS's Avatar
 
Join Date: Oct 2015
Posts: 1,939
Reputation: 504
Default Re: How to Set Two Skins for one Faction/Team

make another dialog let it be its id skin selection
first define it @ top of the script
PHP Code:
#define DIALOG_SKIN 456 //change the no according to your wish 
now on this part
PHP Code:
 if(classid == 0) {
        
SetPlayerSkin(playerid287);
        
GameTextForPlayer(playerid,"~G~Green",1000,4);
        
SetPlayerColor(playeridGREEN_COLOR);
        
gTeam[playerid] = 0;
            
ShowPlayerDialog(playerid,DIALOG_SKIN,DIALOG_STYLE_LIST,"Select Skin","Skin 1 for class 0 \nSkin2 for class 0");//name it as your own wish but remember this is only for this class
}
     if(
classid == 1) {
        
SetPlayerSkin(playerid124);
        
GameTextForPlayer(playerid,"~Y~Yellow",1000,4);
        
SetPlayerColor(playeridYELLOW_COLOR);
        
gTeam[playerid] = 2;
  
ShowPlayerDialog(playerid,DIALOG_SKIN,DIALOG_STYLE_LIST,"Select Skin","Skin for class 1 \nSkin 2 class 1");//name it as your own wish but remember this is only for this class
}
//do same for rest.................. 
now on ondialogresponse
PHP Code:
if(dialogid == DIALOG_SKIN)
{
if(
response)
{
if( 
gTeam[playerid] == 0)//for the team 1
{
switch(
listitem)
{
case 
: return SetPlayerSkin(playerid,skinidhere);
case 
1:return SetPlayerSkin(playerid,skinidhere);
}
}
if( 
gTeam[playerid] == 1)//for the team 2
{
switch(
listitem)
{
case 
: return SetPlayerSkin(playerid,skinidhere);
case 
1:return SetPlayerSkin(playerid,skinidhere);
}
}
}

i personally dont tested it but it works as you want
SyS is offline   Reply With Quote
Old 17/04/2016, 11:47 AM   #6
SaiyanZ
Little Clucker
 
SaiyanZ's Avatar
 
Join Date: Nov 2015
Posts: 43
Reputation: 0
Default Re: How to Set Two Skins for one Faction/Team

Thanks for trying but its not working, I found a way by myself
+Rep for you.
SaiyanZ is offline   Reply With Quote
Old 12/03/2019, 10:43 PM   #7
Susenkus
Little Clucker
 
Join Date: Feb 2018
Posts: 7
Reputation: 0
Default Re: How to Set Two Skins for one Faction/Team

Can you pls help me, i wanna make this too but i wanna to do it like the would show in the class selection like there were you have the AddPlayerClass, you know what i mean pls help
Susenkus is offline   Reply With Quote
Old 13/03/2019, 05:28 PM   #8
Susenkus
Little Clucker
 
Join Date: Feb 2018
Posts: 7
Reputation: 0
Default Re: How to Set Two Skins for one Faction/Team

******Rep++ thx
Susenkus 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
Faction Skins Goethe03 Server Support 2 01/03/2014 02:15 PM
[HELP] Restrict certain skins to a faction FreddeN93 Scripting Help 2 05/01/2014 02:19 PM
[HELP] Faction skins Fredden1993 Help Archive 3 22/05/2011 01:27 PM
[HELP] Changing Faction Skins r0v3r Help Archive 4 25/03/2009 11:48 AM


All times are GMT. The time now is 06:05 PM.


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