SA-MP Forums Archive
Making certain Skin ID's not able to be used. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Making certain Skin ID's not able to be used. (/showthread.php?tid=320097)



Making certain Skin ID's not able to be used. - F9 - 21.02.2012

Hello,
Im using Vortex Roleplay 2, and I want to know if there is anyway to make skin IDS: 163, 164, 165, 166.
Is this possible, if yes, how?

Regards,
F9.


Re: Making certain Skin ID's not able to be used. - mitchboy - 21.02.2012

i think the skin id's are in the sa folder, so i don't know if you could do that, but i saw some custom vehicles in servers too so i'm not sure about it.


Re: Making certain Skin ID's not able to be used. - Konstantinos - 21.02.2012

pawn Код:
switch( GetPlayerSkin( playerid )
{
    case 163, 164, 165, 166:
    {
        // Code for these skins!
    }
}



Re: Making certain Skin ID's not able to be used. - F9 - 21.02.2012

Quote:
Originally Posted by Dwane
Посмотреть сообщение
pawn Код:
switch( GetPlayerSkin( playerid )
{
    case 163, 164, 165, 166:
    {
        // Code for these skins!
    }
}
And how do I make people unable to purchase the skin with this?
/buyclothes command
Код:
CMD:buyclothes(playerid, params[]) {
	if(GetPlayerVirtualWorld(playerid)-BUSINESS_VIRTUAL_WORLD >= 1) {

		new
			skinID,
			slotID,
			iPrice,
			houseID = getPlayerHouseID(playerid),
			businessID = GetPlayerVirtualWorld(playerid) - BUSINESS_VIRTUAL_WORLD;
			
		if(businessID > 0) {
			for(new i = 0; i < MAX_BUSINESS_ITEMS; i++) {
				if(businessItems[i][bItemType] == 18 && businessItems[i][bItemBusiness] == businessID)
				    iPrice = businessItems[i][bItemPrice];
			}
		}

		if(businessVariables[businessID][bType] == 2) {
			if(houseID >= 1) {
				if(sscanf(params, "dd", skinID, slotID)) {
					return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/buyclothes [skinid] [house slot]");
				}
				else if(!IsValidSkin(skinID)) {
					return SendClientMessage(playerid, COLOR_GREY, "Invalid skin ID.");
				}
				else if(!IsPublicSkin(skinID) && playerVariables[playerid][pGroup] != 1) {
					return SendClientMessage(playerid, COLOR_GREY, "You can't purchase this skin.");
				}
				else if(slotID < 1 || slotID > 5) {
					return SendClientMessage(playerid, COLOR_GREY, "Invalid slot specified.");
				}
				else if(playerVariables[playerid][pMoney] >= 500) {
					playerVariables[playerid][pMoney] -= 500;
					businessVariables[businessID][bVault] += 500;
					playerVariables[playerid][pSkin] = skinID;
					houseVariables[houseID][hWardrobe][slotID - 1] = skinID;
					return SetPlayerSkin(playerid, skinID);
				}
				else {
				    format(szMessage, sizeof(szMessage), "You don't have $%d available.", iPrice);
					SendClientMessage(playerid, COLOR_GREY, szMessage);
				}
			}
			else if(!isnull(params)) {
				skinID = strval(params);

				if(!IsValidSkin(skinID)) {
					return SendClientMessage(playerid, COLOR_GREY, "Invalid skin ID.");
				}
				else if(!IsPublicSkin(skinID) && playerVariables[playerid][pGroup] != 1) {
					return SendClientMessage(playerid, COLOR_GREY, "You can't purchase this skin.");
				}
				else {
				    if(playerVariables[playerid][pMoney] >= iPrice) {
						playerVariables[playerid][pMoney] -= iPrice;
						businessVariables[businessID][bVault] += iPrice;
						playerVariables[playerid][pSkin] = skinID;
						return SetPlayerSkin(playerid, skinID);
					} else {
					    format(szMessage, sizeof(szMessage), "You don't have $%d available.", iPrice);
						SendClientMessage(playerid, COLOR_GREY, szMessage);
					}
				}
			}
			else {
   				format(szMessage, sizeof(szMessage), "Skins here cost $%d", iPrice);
				SendClientMessage(playerid, COLOR_GREY, szMessage);
				SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/buyclothes [skinid] (Skins cost $500.)");
			}
		}
	}
	return 1;
}



Re: Making certain Skin ID's not able to be used. - Konstantinos - 21.02.2012

Just added in the command
pawn Код:
switch( GetPlayerSkin( playerid )
{
    case 163, 164, 165, 166:
    {
        // These skins can buy clothes
        // Code for buying here
    }
    default: SendClientMessage( playerid, -1, "You cannot buy this!" );
}