How to Set Two Skins for one Faction/Team
#1

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;
}
Reply
#2

Set gTeam[playerid] to the same number for the skins that are in same team.
Reply
#3

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
Reply
#4

Thank you, But any way through which player select skin by themself, 2 Options?
Reply
#5

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
Reply
#6

Thanks for trying but its not working, I found a way by myself
+Rep for you.
Reply
#7

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
Reply
#8

******Rep++ thx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)