Making certain Skin ID's not able to be used.
#4

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


Messages In This Thread
Making certain Skin ID's not able to be used. - by F9 - 21.02.2012, 16:43
Re: Making certain Skin ID's not able to be used. - by mitchboy - 21.02.2012, 16:44
Re: Making certain Skin ID's not able to be used. - by Konstantinos - 21.02.2012, 16:45
Re: Making certain Skin ID's not able to be used. - by F9 - 21.02.2012, 16:50
Re: Making certain Skin ID's not able to be used. - by Konstantinos - 21.02.2012, 16:55

Forum Jump:


Users browsing this thread: 2 Guest(s)