02.06.2010, 09:59
Here's my clothes purchase code (All done via the house)
Here's my IsValidSkin thing:
I get an error on this line (error 047: array sizes do not match, or destination array is too small)
This line (error 035: argument type mismatch (argument 1))
and this line (error 035: argument type mismatch (argument 2))
Here's the dialog thing:
Код:
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;
}
Код:
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;
}
Код:
id = inputtext;
Код:
if IsValidSkin(id) {
Код:
SetPlayerSkin(playerid,id);
Код:
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");
}



)Come on man!