06.04.2015, 14:48
(
Последний раз редактировалось Alpay0098; 09.04.2015 в 16:18.
)
Hi,
mSelection menu doesn't appear.
What I must do?
CMD Code :
Dialog Codes : (List item 0) [DOESN'T WORK]
Accessory Code : [DOESN'T WORK]
mSelection menu doesn't appear.
What I must do?
CMD Code :
PHP код:
if(strcmp(cmd, "/buy", true) == 0)
{
for(new i = 0; i < sizeof(BizInfo); i++)
{
if(IsPlayerInRangeOfPoint(playerid,25.0,BizInfo[i][bInsideX],BizInfo[i][bInsideY],BizInfo[i][bInsideZ]))
{
if(GetPlayerVirtualWorld(playerid) == i)
{
switch(BizInfo[i][bType])
{
case 1: // Clothes Store
{
if(BizInfo[i][bProducts] <= 0)
{
SendClientMessage(playerid, COLOR_GREY, " This business doesn't have any products left.");
return 1;
}
DisplayDialogForPlayer(playerid, 27);
}
default:
{
return SendClientMessage(playerid, COLOR_GREY, " You are not in a business that can sell products");
}
}
}
}
}
return 1;
}
PHP код:
if(dialogid == 77) //buy clothes
{
if(response)
{
if(!IsAtClothShop(playerid)) return SendClientMessage(playerid,COLOR_GREY," You are not inside the Clothes shop");
new biz = GetPlayerVirtualWorld(playerid);
if(!IsNumeric(inputtext))
{
SendClientMessage(playerid, COLOR_GREY, " You must enter a number for the skin ID.");
return 1;
}
if((strval(inputtext) == 294 && PlayerInfo[playerid][pDonateRank] == 0) ||
(strval(inputtext) == 295 && PlayerInfo[playerid][pDonateRank] == 0) ||
(strval(inputtext) == 167) ||
(strval(inputtext) == 0) ||
(strval(inputtext) >= 265 && strval(inputtext) <= 267) ||
(strval(inputtext) == 165) ||
(strval(inputtext) == 166) ||
(strval(inputtext) >= 280 && strval(inputtext) <= 288) ||
(strval(inputtext) >= 274 && strval(inputtext) <= 279) ||
(strval(inputtext) >= 163 && strval(inputtext) <= 166) ||
(strval(inputtext) >= 268 && strval(inputtext) <= 271) ||
(strval(inputtext) == 296) ||
(strval(inputtext) == 71)) return SendClientMessage(playerid,COLOR_GREY," You are not allowed to use this skin.");
new skin = strval(inputtext);
if(skin < 0 || skin > 299) return SendClientMessage(playerid, COLOR_GREY, " Skin can't be below 0 or above 299.");
PlayerTextDrawDestroy(playerid, pModel_t[playerid]);
pModelState[playerid] = 999;
pModel_t[playerid] = CreatePlayerTextDraw(playerid, 220.0, 250.0, "_");
PlayerTextDrawFont(playerid, pModel_t[playerid], TEXT_DRAW_FONT_MODEL_PREVIEW);
PlayerTextDrawTextSize(playerid, pModel_t[playerid], 200.0, 200.0);
PlayerTextDrawSetPreviewModel(playerid, pModel_t[playerid], skin);
PlayerTextDrawUseBox(playerid, pModel_t[playerid], 0);
PlayerTextDrawBackgroundColor(playerid, pModel_t[playerid], 0x00000000);
PlayerTextDrawShow(playerid, pModel_t[playerid]);
pModelState[playerid] = 2;
pModelRot[playerid][0] = 0;
pModelRot[playerid][1] = 0;
pModelRot[playerid][2] = 0;
pModelTimer[playerid] = SetTimerEx("UpdatePreviewModel", 1000, 1, "i", playerid);
ShowPlayerDialog(playerid, 771, DIALOG_STYLE_MSGBOX, "Are you sure?", "Are you sure you would like to by this skin for $500?\n\n{F5DA81}NOTE: Below is a preview of the skin.", "Purchase", "Cancel");
SetPVarInt(playerid, "buyskinbincobiz", biz);
SetPVarInt(playerid, "buyskinbinco", skin);
return 1;
}
}
if(dialogid == 771)
{
PlayerTextDrawDestroy(playerid, pModel_t[playerid]);
pModelState[playerid] = 999;
if(!response) { DeletePVar(playerid, "buyskinbinco"); DeletePVar(playerid, "buyskinbincobiz"); return 1; }
else
{
SendClientMessage(playerid,COLOR_LIGHTBLUE,"* You bought a new set of clothes for $500.");
new skin = GetPVarInt(playerid, "buyskinbinco");
new biz = GetPVarInt(playerid, "buyskinbincobiz");
GiveMoney(playerid, -500);
BizInfo[biz][bTill] += 500;
BizInfo[biz][bProducts] -= 1;
SetPlayerSkin(playerid,skin);
PlayerInfo[playerid][pModel] = skin;
DeletePVar(playerid, "buyskinbinco");
DeletePVar(playerid, "buyskinbincobiz");
}
}
PHP код:
if(dialogid == 24213) // ID is Buying Accessories
{
if(response)
{
if(!IsAtClothShop(playerid)) return SendClientMessage(playerid,COLOR_GREY," You are not at a clothes shop.");
new biz = GetPlayerVirtualWorld(playerid);
if(GetMoney(playerid) < AccessNames[listitem][modprice]) return SendClientMessage(playerid, COLOR_GRAD1, " You do not have enough money to pay for that!");
new freeslot = -1;
for(new i = 0; i < 7; i++)
{
if(Accessories[playerid][i] == 0)
{
freeslot = i;
break;
}
}
if(freeslot == -1) return SendClientMessage(playerid, COLOR_GRAD1, " You do not have enough space in your inventory for that!");
PlayerTextDrawDestroy(playerid, pModel_t[playerid]);
pModelState[playerid] = 999;
pModel_t[playerid] = CreatePlayerTextDraw(playerid, 220.0, 220.0, "_");
PlayerTextDrawFont(playerid, pModel_t[playerid], TEXT_DRAW_FONT_MODEL_PREVIEW);
PlayerTextDrawTextSize(playerid, pModel_t[playerid], 200.0, 200.0);
PlayerTextDrawSetPreviewModel(playerid, pModel_t[playerid], AccessNames[listitem][modid]);
PlayerTextDrawSetPreviewRot(playerid, pModel_t[playerid], -15.0, 0.0, 0.0);
PlayerTextDrawUseBox(playerid, pModel_t[playerid], 0);
PlayerTextDrawBackgroundColor(playerid, pModel_t[playerid], 0x00000000);
PlayerTextDrawShow(playerid, pModel_t[playerid]);
pModelState[playerid] = 1;
pModelRot[playerid][0] = 0;
pModelRot[playerid][1] = 0;
pModelRot[playerid][2] = 0;
pModelTimer[playerid] = SetTimerEx("UpdatePreviewModel", 1000, 1, "i", playerid);
format(string, sizeof(string), "Are you sure you would like to by this accessory for $%d?\n\n{F5DA81}NOTE: Below is a preview of the accessory.", AccessNames[listitem][modprice]);
ShowPlayerDialog(playerid, 772, DIALOG_STYLE_MSGBOX, "Are you sure?", string, "Purchase", "Cancel");
SetPVarInt(playerid, "buyaccbincobiz", biz);
SetPVarInt(playerid, "buyaccbinco", listitem);
}
}
if(dialogid == 772)
{
PlayerTextDrawDestroy(playerid, pModel_t[playerid]);
pModelState[playerid] = 999;
if(!response) { DeletePVar(playerid, "buyaccbincobiz"); DeletePVar(playerid, "buyaccbinco"); return 1; }
else
{
new biz = GetPVarInt(playerid, "buyaccbincobiz");
new accid = GetPVarInt(playerid, "buyaccbinco");
new freeslot = -1;
for(new i = 0; i < 7; i++)
{
if(Accessories[playerid][i] == 0)
{
freeslot = i;
break;
}
}
if(freeslot == -1) return SendClientMessage(playerid, COLOR_GRAD1, " You do not have enough space in your inventory for that!");
Accessories[playerid][freeslot] = AccessNames[accid][modid];
AccessoriesB[playerid][freeslot] = 1;
AccessoriessX[playerid][freeslot] = 1;
AccessoriessY[playerid][freeslot] = 1;
AccessoriessZ[playerid][freeslot] = 1;
BizInfo[biz][bTill] += AccessNames[accid][modprice];
BizInfo[biz][bProducts] -= 1;
GiveMoney(playerid, -AccessNames[accid][modprice]);
SendClientMessage(playerid, COLOR_GRAD1, " Accessory bought! /inventory to use it!");
DeletePVar(playerid, "buyaccbincobiz");
DeletePVar(playerid, "buyaccbinco");
}
}
if(dialogid == 24214) // ID is Inventory
{
if(response)
{
if(listitem == 0)
{
ShowAccessDialog(playerid, 0);
}
}
}
if(dialogid == 24215) // ID is Inventory Accessory List
{
if(response)
{
if(Accessories[playerid][listitem] == 0)
{
SendClientMessage(playerid, COLOR_GRAD1, "That slot is empty! Choose another to edit...");
ShowAccessDialog(playerid, 0);
return 1;
}
else
{
new titlestring[128];
format(titlestring, sizeof(titlestring), "Managing Accessory %d", listitem+1);
SetPVarInt(playerid, "ManageAccessID", listitem);
if(!IsPlayerAttachedObjectSlotUsed(playerid, listitem))
{
ShowPlayerDialog(playerid, 24216, DIALOG_STYLE_LIST, titlestring, "Wear Accessory\nEdit Accessory\nChange Bone\nDelete Accessory", "Select", "Back");
}
else
{
ShowPlayerDialog(playerid, 24216, DIALOG_STYLE_LIST, titlestring, "Remove Accessory\nEdit Accessory\nChange Bone\nDelete Accessory", "Select", "Back");
}
}
}
else
{
ShowPlayerDialog(playerid, 24214, DIALOG_STYLE_LIST, "Player Inventory", "Accessories", "Select", "Cancel");
}
}
if(dialogid == 24216) // ID is Inventory Manage Item
{
if(response)
{
new manageid = GetPVarInt(playerid, "ManageAccessID");
if(listitem == 0)
{
if(GetPVarInt(playerid, "ManageAccessID") < 0 || GetPVarInt(playerid, "ManageAccessID") > 6) return SendClientMessage(playerid, COLOR_RED, "ACCESS DENIED: Hacking attempt!");
if(IsPlayerAttachedObjectSlotUsed(playerid, manageid))
{
RemovePlayerAttachedObject(playerid, manageid);
SendClientMessage(playerid, COLOR_GRAD1, " Accessory removed from your person!");
}
else
{
SetPlayerAttachedObject(playerid,manageid,Accessories[playerid][manageid],AccessoriesB[playerid][manageid],AccessoriesX[playerid][manageid],AccessoriesY[playerid][manageid],AccessoriesZ[playerid][manageid],AccessoriesrX[playerid][manageid],AccessoriesrY[playerid][manageid],AccessoriesrZ[playerid][manageid],AccessoriessX[playerid][manageid],AccessoriessY[playerid][manageid],AccessoriessZ[playerid][manageid]);
SendClientMessage(playerid, COLOR_GRAD1, " You are now wearing the accessory!");
}
DeletePVar(playerid, "ManageAccessID");
}
else if(listitem == 1)
{
if(GetPVarInt(playerid, "ManageAccessID") < 0 || GetPVarInt(playerid, "ManageAccessID") > 6) return SendClientMessage(playerid, COLOR_RED, "ACCESS DENIED: Hacking attempt!");
if(AccessoriesB[playerid][manageid] <= 0)
{
AccessoriesB[playerid][manageid] = 1;
}
if(AccessoriessX[playerid][manageid] <= 0 && AccessoriessY[playerid][manageid] <= 0 && AccessoriessZ[playerid][manageid] <= 0)
{
AccessoriessX[playerid][manageid] = 1;
AccessoriessY[playerid][manageid] = 1;
AccessoriessZ[playerid][manageid] = 1;
}
SetPlayerAttachedObject(playerid,manageid,Accessories[playerid][manageid],AccessoriesB[playerid][manageid],AccessoriesX[playerid][manageid],AccessoriesY[playerid][manageid],AccessoriesZ[playerid][manageid],AccessoriesrX[playerid][manageid],AccessoriesrY[playerid][manageid],AccessoriesrZ[playerid][manageid],AccessoriessX[playerid][manageid],AccessoriessY[playerid][manageid],AccessoriessZ[playerid][manageid]);
EditAttachedObject(playerid, manageid);
SendClientMessage(playerid, COLOR_GRAD1, "Editing the accessory, for help on doing this use /editorhelp.");
}
else if(listitem == 2)
{
if(GetPVarInt(playerid, "ManageAccessID") < 0 || GetPVarInt(playerid, "ManageAccessID") > 6) return SendClientMessage(playerid, COLOR_RED, "ACCESS DENIED: Hacking attempt!");
new bonestring[256+1];
for(new i; i < sizeof(AttachmentBones); i++)
{
format(bonestring, sizeof(bonestring), "%s\n%s", bonestring, AttachmentBones[i]);
}
ShowPlayerDialog(playerid, 24217, DIALOG_STYLE_LIST, "Change Bone", bonestring, "Select", "Back");
}
else if(listitem == 3)
{
if(GetPVarInt(playerid, "ManageAccessID") < 0 || GetPVarInt(playerid, "ManageAccessID") > 6) return SendClientMessage(playerid, COLOR_RED, "ACCESS DENIED: Hacking attempt!");
RemovePlayerAttachedObject(playerid, manageid);
Accessories[playerid][manageid] = 0;
AccessoriesB[playerid][manageid] = 0;
AccessoriesX[playerid][manageid] = 0;
AccessoriesY[playerid][manageid] = 0;
AccessoriesZ[playerid][manageid] = 0;
AccessoriesrX[playerid][manageid] = 0;
AccessoriesrY[playerid][manageid] = 0;
AccessoriesrZ[playerid][manageid] = 0;
AccessoriessX[playerid][manageid] = 0;
AccessoriessY[playerid][manageid] = 0;
AccessoriessZ[playerid][manageid] = 0;
SendClientMessage(playerid, COLOR_GRAD1, " Accessory removed from your inventory successfully!");
DeletePVar(playerid, "ManageAccessID");
}
}
else
{
ShowAccessDialog(playerid, 0);
}
}
Compiler works properly.