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


Messages In This Thread
A few errors with clothes purchasing - by jameskmonger - 02.06.2010, 09:59
Re: A few errors with clothes purchasing - by vladi866 - 02.06.2010, 10:03
Re: A few errors with clothes purchasing - by OverLord* - 02.06.2010, 10:04
Re: A few errors with clothes purchasing - by jameskmonger - 02.06.2010, 10:07
Re: A few errors with clothes purchasing - by vladi866 - 02.06.2010, 10:07
Re: A few errors with clothes purchasing - by jameskmonger - 02.06.2010, 10:08
Re: A few errors with clothes purchasing - by Ady.b - 05.07.2010, 19:55

Forum Jump:


Users browsing this thread: 2 Guest(s)