A few errors with clothes purchasing
#1

Here's my clothes purchase code (All done via the house)
Код:
  if(dialogid == DABOX+10)
	{
		if(response)
		{
		  new id[128];
			id = inputtext;
			format(ufile, sizeof(ufile), "Roleplay/Houses/Users/%s.ini", pName(playerid));
			if(!dini_Exists(ufile)) AddUser(playerid);
	 		new howner[256]; howner = dini_Get(hfile, "Owner");
			new nigname[MAX_PLAYER_NAME]; nigname = pName(playerid);
			if(strfind(howner, nigname, true) == -1) return ShowPlayerDialog(playerid, DABOX-1, DIALOG_STYLE_MSGBOX, "House - Options", "You are not the owner of this house!", "Ok", "");
	      if IsValidSkin(id) {
					SetPlayerSkin(playerid,id);
					GivePlayerCash(playerid,-100);
					SendClientMessage(playerid, COLOR_WHITE, "Clothes purchased, $-100.");
					pInfo[playerid][pSkin] = GetPlayerSkin(playerid);
					return 1;
		 		} else {
  					SendClientMessage(playerid, COLOR_RED, "Invalid Skin ID!");
		 	}
		}
    return 1;
  }
Here's my IsValidSkin thing:
Код:
stock IsValidSkin(skinid)
{
  #define	MAX_BAD_SKINS 22
  new badSkins[MAX_BAD_SKINS] =
  {
    3, 4, 5, 6, 8, 42, 65, 74, 86,
    119, 149, 208, 265, 266, 267,
    268, 269, 270, 271, 272, 273, 289
  };
  if (skinid < 0 || skinid > 299) return false;
  for (new i = 0; i < MAX_BAD_SKINS; i++)
  {
    if (skinid == badSkins[i]) return false;
  }
  #undef MAX_BAD_SKINS
  return 1;
}
I get an error on this line (error 047: array sizes do not match, or destination array is too small)
Код:
			id = inputtext;
This line (error 035: argument type mismatch (argument 1))
Код:
if IsValidSkin(id) {
and this line (error 035: argument type mismatch (argument 2))
Код:
SetPlayerSkin(playerid,id);
Here's the dialog thing:
Код:
 					case 5:
 					{
 						format(hfile, sizeof(hfile), "Roleplay/Houses/%d.ini", GetEntID(playerid));
 					  new howner[256]; howner = dini_Get(hfile, "Owner");
						new nigname[MAX_PLAYER_NAME]; nigname = pName(playerid);
						if(strfind(howner, nigname, true) == -1) return ShowPlayerDialog(playerid, DABOX-1, DIALOG_STYLE_MSGBOX, "House - Options", "You are not the owner of this house!", "Ok", "");
						ShowPlayerDialog(playerid, DABOX+10, DIALOG_STYLE_INPUT, "House - Change Clothes", "Type in the skin ID you want.", "Ok", "Cancel");
 					}
Reply
#2

I cant understand anything because you did The HOuse sys with the clothes sys so how can you want that it will work...
Reply
#3

Try

id = strval(inputtext);
Reply
#4

Quote:
Originally Posted by vladi866
I cant understand anything because you did The HOuse sys with the clothes sys so how can you want that it will work...
You go to your house, a menu comes up and you click buy clothes.
Reply
#5

oh I understand now but why you will buy it if it in you house so why buy?
Reply
#6

Quote:
Originally Posted by vladi866
oh I understand now but why you will buy it if it in you house so why buy?
I don't know, I'll consider that when the system actually works.
Reply
#7

Short)Come on man!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)