SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 07/09/2009, 03:28 PM   #1
Hiphop
Little Clucker
 
Join Date: Jul 2007
Location: Holland
Posts: 45
Reputation: 0
Default Skin selector, little problem..

Hey,

I made a skin selector because I want each team to choose from there own 3 skins (Grove's 3 grove skins, Ballas 3 ballas skins, etc.).
Almost everything works, but when I press left or right it stays on skin 1, can somebody see what's wrong?

Greets Tom.

http://pastebin.com/m3c974786

Or:

Code:
ClassSel_SetupSelectedSkin(playerid) //Setup for when you choose your skin (camera,positions etc.)
{
	if(gPlayerSkinSelection[playerid] == -1) {
		gPlayerSkinSelection[playerid] = SKIN_1;
	}

	if(gPlayerGangSelection[playerid] == GANG_GROVE) {

		if(gPlayerSkinSelection[playerid] == SKIN_1) {
			SetPlayerSkin(playerid, 105);
			SetPlayerInterior(playerid,11);
			SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
			SetPlayerFacingAngle(playerid,0.0);
	  	SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
			SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);

			TextDrawShowForPlayer(playerid,txtSkin1);
			TextDrawHideForPlayer(playerid,txtSkin2);
			TextDrawHideForPlayer(playerid,txtSkin3);
		}
		else if(gPlayerSkinSelection[playerid] == SKIN_2) {
	 		SetPlayerSkin(playerid, 106);
			SetPlayerInterior(playerid,11);
			SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
			SetPlayerFacingAngle(playerid,0.0);
	  	SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
			SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);

			TextDrawHideForPlayer(playerid,txtSkin1);
			TextDrawShowForPlayer(playerid,txtSkin2);
			TextDrawHideForPlayer(playerid,txtSkin3);
		}
		else if(gPlayerSkinSelection[playerid] == SKIN_3) {
	 		SetPlayerSkin(playerid, 107);
			SetPlayerInterior(playerid,11);
			SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
			SetPlayerFacingAngle(playerid,0.0);
	  	SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
			SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);

			TextDrawHideForPlayer(playerid,txtSkin1);
			TextDrawHideForPlayer(playerid,txtSkin2);
			TextDrawShowForPlayer(playerid,txtSkin3);
		}
	}

	else if(gPlayerGangSelection[playerid] == GANG_BALLAS) {

		if(gPlayerSkinSelection[playerid] == SKIN_1) {
			SetPlayerSkin(playerid, 102);
			SetPlayerInterior(playerid,11);
			SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
			SetPlayerFacingAngle(playerid,0.0);
	  	SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
			SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);

			TextDrawShowForPlayer(playerid,txtSkin1);
			TextDrawHideForPlayer(playerid,txtSkin2);
			TextDrawHideForPlayer(playerid,txtSkin3);
		}
		else if(gPlayerSkinSelection[playerid] == SKIN_2) {
	 		SetPlayerSkin(playerid, 103);
			SetPlayerInterior(playerid,11);
			SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
			SetPlayerFacingAngle(playerid,0.0);
	  	SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
			SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);

			TextDrawHideForPlayer(playerid,txtSkin1);
			TextDrawShowForPlayer(playerid,txtSkin2);
			TextDrawHideForPlayer(playerid,txtSkin3);
		}
		else if(gPlayerSkinSelection[playerid] == SKIN_3) {
	 		SetPlayerSkin(playerid, 104);
			SetPlayerInterior(playerid,11);
			SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
			SetPlayerFacingAngle(playerid,0.0);
	  	SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
			SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);

			TextDrawHideForPlayer(playerid,txtSkin1);
			TextDrawHideForPlayer(playerid,txtSkin2);
			TextDrawShowForPlayer(playerid,txtSkin3);
		}
	}
	
	else if(gPlayerGangSelection[playerid] == GANG_AZTECAS) {

		if(gPlayerSkinSelection[playerid] == SKIN_1) {
			SetPlayerSkin(playerid, 114);
			SetPlayerInterior(playerid,11);
			SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
			SetPlayerFacingAngle(playerid,0.0);
	  	SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
			SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);

			TextDrawShowForPlayer(playerid,txtSkin1);
			TextDrawHideForPlayer(playerid,txtSkin2);
			TextDrawHideForPlayer(playerid,txtSkin3);
		}
		else if(gPlayerSkinSelection[playerid] == SKIN_2) {
	 		SetPlayerSkin(playerid, 115);
			SetPlayerInterior(playerid,11);
			SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
			SetPlayerFacingAngle(playerid,0.0);
	  	SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
			SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);

			TextDrawHideForPlayer(playerid,txtSkin1);
			TextDrawShowForPlayer(playerid,txtSkin2);
			TextDrawHideForPlayer(playerid,txtSkin3);
		}
		else if(gPlayerSkinSelection[playerid] == SKIN_3) {
	 		SetPlayerSkin(playerid, 116);
			SetPlayerInterior(playerid,11);
			SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
			SetPlayerFacingAngle(playerid,0.0);
	  	SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
			SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);

			TextDrawHideForPlayer(playerid,txtSkin1);
			TextDrawHideForPlayer(playerid,txtSkin2);
			TextDrawShowForPlayer(playerid,txtSkin3);
		}
	}
	
	else if(gPlayerGangSelection[playerid] == GANG_VAGOS) {

		if(gPlayerSkinSelection[playerid] == SKIN_1) {
			SetPlayerSkin(playerid, 108);
			SetPlayerInterior(playerid,11);
			SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
			SetPlayerFacingAngle(playerid,0.0);
	  	SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
			SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);

			TextDrawShowForPlayer(playerid,txtSkin1);
			TextDrawHideForPlayer(playerid,txtSkin2);
			TextDrawHideForPlayer(playerid,txtSkin3);
		}
		else if(gPlayerSkinSelection[playerid] == SKIN_2) {
	 		SetPlayerSkin(playerid, 109);
			SetPlayerInterior(playerid,11);
			SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
			SetPlayerFacingAngle(playerid,0.0);
	  	SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
			SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);

			TextDrawHideForPlayer(playerid,txtSkin1);
			TextDrawShowForPlayer(playerid,txtSkin2);
			TextDrawHideForPlayer(playerid,txtSkin3);
		}
		else if(gPlayerSkinSelection[playerid] == SKIN_3) {
	 		SetPlayerSkin(playerid, 110);
			SetPlayerInterior(playerid,11);
			SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
			SetPlayerFacingAngle(playerid,0.0);
	  	SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
			SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);

			TextDrawHideForPlayer(playerid,txtSkin1);
			TextDrawHideForPlayer(playerid,txtSkin2);
			TextDrawShowForPlayer(playerid,txtSkin3);
		}
	}

}

//----------------------------------------------------------

ClassSel_SwitchToNextSkin(playerid)
{
  gPlayerSkinSelection[playerid]++;
	if(gPlayerSkinSelection[playerid] > SKIN_3) {
	  gPlayerSkinSelection[playerid] = SKIN_1;
	}
	PlayerPlaySound(playerid,1052,0.0,0.0,0.0);
	gPlayerLastSkinSelectionTick[playerid] = GetTickCount();
	ClassSel_SetupSelectedSkin(playerid);
}

//----------------------------------------------------------

ClassSel_SwitchToPreviousSkin(playerid)
{
  gPlayerSkinSelection[playerid]--;
	if(gPlayerGangSelection[playerid] < SKIN_1) {
	  gPlayerSkinSelection[playerid] = SKIN_3;
	}
	PlayerPlaySound(playerid,1053,0.0,0.0,0.0);
	gPlayerLastSkinSelectionTick[playerid] = GetTickCount();
	ClassSel_SetupSelectedSkin(playerid);
}

//-----------------------------------------------------------

ClassSel_HandleSkinSelection(playerid)
{
	new Keys,ud,lr;
  GetPlayerKeys(playerid,Keys,ud,lr);

  if(gPlayerSkinSelection[playerid] == -1) {
		ClassSel_SwitchToNextSkin(playerid);
		return;
	}

	// only allow new selection every ~500 ms
	if( (GetTickCount() - gPlayerLastSkinSelectionTick[playerid]) < 500 ) return;

	if(Keys & KEY_FIRE) {
	  gPlayerHasSkinSelected[playerid] = 1;
	  TextDrawHideForPlayer(playerid,txtSkinSelHelper);
		TextDrawHideForPlayer(playerid,txtSkin1);
		TextDrawHideForPlayer(playerid,txtSkin2);
		TextDrawHideForPlayer(playerid,txtSkin3);
	  TogglePlayerSpectating(playerid,0);
	  return;
	}

	if(lr > 0) {
	  ClassSel_SwitchToNextSkin(playerid);
	}
	else if(lr < 0) {
	  ClassSel_SwitchToPreviousSkin(playerid);
	}
}
Hiphop is offline  
Old 08/09/2009, 12:53 PM   #2
Hiphop
Little Clucker
 
Join Date: Jul 2007
Location: Holland
Posts: 45
Reputation: 0
Default Re: Skin selector, little problem..

Nobody?
Hiphop is offline  
Old 08/09/2009, 02:04 PM   #3
Jakku
High-roller
 
Jakku's Avatar
 
Join Date: Apr 2009
Location: Heinola, Finland
Posts: 1,354
Reputation: 157
Default Re: Skin selector, little problem..

Did you configure the left and right buttons for switching skins?
__________________
Jakku is offline  
Old 08/09/2009, 08:13 PM   #4
Hiphop
Little Clucker
 
Join Date: Jul 2007
Location: Holland
Posts: 45
Reputation: 0
Default Re: Skin selector, little problem..

It's in here right?

Code:
ClassSel_HandleSkinSelection(playerid)
{
	new Keys,ud,lr;
  GetPlayerKeys(playerid,Keys,ud,lr);

  if(gPlayerSkinSelection[playerid] == -1) {
		ClassSel_SwitchToNextSkin(playerid);
		return;
	}

	// only allow new selection every ~500 ms
	if( (GetTickCount() - gPlayerLastSkinSelectionTick[playerid]) < 500 ) return;

	if(Keys & KEY_FIRE) {
	  gPlayerHasSkinSelected[playerid] = 1;
	  TextDrawHideForPlayer(playerid,txtSkinSelHelper);
		TextDrawHideForPlayer(playerid,txtSkin1);
		TextDrawHideForPlayer(playerid,txtSkin2);
		TextDrawHideForPlayer(playerid,txtSkin3);
	  TogglePlayerSpectating(playerid,0);
	  return;
	}

	if(lr > 0) {
	  ClassSel_SwitchToNextSkin(playerid);
	}
	else if(lr < 0) {
	  ClassSel_SwitchToPreviousSkin(playerid);
	}
}
Hiphop is offline  
 

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
[FilterScript] [FS] Easy Vehicle Selector MX_Master Filterscripts 12 08/11/2010 10:17 AM
were can i get a ped selector for my script johnathon956 Help Archive 8 23/01/2010 05:52 PM
Orph's skin selector Orpheus Filterscripts 31 29/01/2009 11:59 AM


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


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