10.04.2013, 02:50
Ok, So im trying to make a new 0.3x toy selection, But everytime i click on a toy it just buys a fishingrod...
Here is the code:
buytoys command
toys list command dialog
ShowModelSelectionMenu
So ya, When i go ingame and type /buyitems i click on like a hat on the selection menu buy only buys a fishingrod no matter what item it is. If you can help me add me on skype: skull495
Website: www.variousgaming.net
Here is the code:
buytoys command
Код HTML:
CMD:buyitems(playerid, params[]) { if(AdminDuty[playerid] == 1) return SendClientMessage(playerid,COLOR_WHITE, "You can't use this command while on-duty as admin."); if(IsAtClothShop(playerid)) ShowPlayerDialogEx(playerid, BUYTOYS, DIALOG_STYLE_MSGBOX, "Item Store", "Welcome to the items store! Here you can buy accessories to attach to your player.\n\nFirst, we will choose a slot to store the toy in.\n(Note: Non-Donators can only hold 5 items, Ruby-Diamond Donator can hold 6-8)","Continue", "Cancel"); else SendClientMessage(playerid, COLOR_WHITE, "You're not in a Clothing Shop."); return 1; }
Код HTML:
if((dialogid == BUYTOYS) && response) { new stringg[856]; for(new x;x<MAX_PLAYERTOYS;x++) { new name[24]; format(name, sizeof(name), "None"); for(new i;i<sizeof(HoldingObjectsAll);i++) { if(HoldingObjectsAll[i][holdingmodelid] == PlayerToyInfo[playerid][x][ptModelID]) { format(name, sizeof(name), "%s", HoldingObjectsAll[i][holdingmodelname]); } } format(stringg, sizeof(stringg), "%s(%d) %s (Bone: %s)\n", stringg, x, name, HoldingBones[PlayerToyInfo[playerid][x][ptBone]]); } ShowPlayerDialogEx(playerid, BUYTOYS2, DIALOG_STYLE_LIST, "Select a Slot", stringg, "Select", "Cancel"); } if((dialogid == BUYTOYS2) && response) { if(listitem == 5 && PlayerInfo[playerid][pDonator] < 1) return SendClientMessage(playerid, COLOR_WHITE, "* You must be a Ruby+ Donator to use that slot!"); if(listitem == 6 && PlayerInfo[playerid][pDonator] < 2) return SendClientMessage(playerid, COLOR_WHITE, "* You must be a Sapphire+ Donator to use that slot!"); if(listitem == 7 && PlayerInfo[playerid][pDonator] < 3) return SendClientMessage(playerid, COLOR_WHITE, "* You must be a Diamond+ Donator to use that slot!"); if(PlayerToyInfo[playerid][listitem][ptModelID] != 0) return SendClientMessage(playerid, COLOR_YELLOW, "* You already have something in that slot. Delete it with /items"); slotselection[playerid] = listitem; new stringg[4000]; for(new x;x<sizeof(HoldingObjects);x++) { format(stringg, sizeof(stringg), "%s%s ($%d)\n", stringg, HoldingObjects[x][holdingmodelname], HoldingObjects[x][holdingprice]); } ShowModelSelectionMenu(playerid, toyslist, "Select an Item"); //ShowPlayerDialogEx OLD TOY LIST(playerid, BUYTOYS3, DIALOG_STYLE_LIST, "Select an Item", stringg, "Buy", "Cancel"); }
Код HTML:
if(listid == toyslist)//PaNoULiS - Toys { if(response) { if(GetPlayerCash(playerid) < HoldingObjects[listid][holdingprice]) { SendClientMessage(playerid, COLOR_WHITE, "* You can't afford that!"); } else { GivePlayerCash(playerid, -HoldingObjects[listid][holdingprice]); PlayerToyInfo[playerid][slotselection[playerid]][ptModelID] = HoldingObjects[listid][holdingmodelid]; //new modelid = PlayerToyInfo[playerid][slotselection[playerid]][ptModelID]; if((modelid >= 19006 && modelid <= 19035) || (modelid >= 19138 && modelid <= 19140)) { PlayerToyInfo[playerid][slotselection[playerid]][ptBone] = 2; PlayerToyInfo[playerid][slotselection[playerid]][ptPosX] = 0.9; PlayerToyInfo[playerid][slotselection[playerid]][ptPosY] = 0.0; PlayerToyInfo[playerid][slotselection[playerid]][ptPosZ] = 0.35; PlayerToyInfo[playerid][slotselection[playerid]][ptRotX] = 90.0; PlayerToyInfo[playerid][slotselection[playerid]][ptRotY] = 90.0; PlayerToyInfo[playerid][slotselection[playerid]][ptRotZ] = 0.0; } else if(modelid >= 18891 && modelid <= 18910) { PlayerToyInfo[playerid][slotselection[playerid]][ptBone] = 2; PlayerToyInfo[playerid][slotselection[playerid]][ptPosX] = 0.15; PlayerToyInfo[playerid][slotselection[playerid]][ptPosY] = 0.0; PlayerToyInfo[playerid][slotselection[playerid]][ptPosZ] = 0.0; PlayerToyInfo[playerid][slotselection[playerid]][ptRotX] = 90.0; PlayerToyInfo[playerid][slotselection[playerid]][ptRotY] = 180.0; PlayerToyInfo[playerid][slotselection[playerid]][ptRotZ] = 90.0; } else if(modelid >= 18926 && modelid <= 18935) { PlayerToyInfo[playerid][slotselection[playerid]][ptBone] = 2; PlayerToyInfo[playerid][slotselection[playerid]][ptPosX] = 0.1; PlayerToyInfo[playerid][slotselection[playerid]][ptPosY] = 0.0; PlayerToyInfo[playerid][slotselection[playerid]][ptPosZ] = 0.0; PlayerToyInfo[playerid][slotselection[playerid]][ptRotX] = 0.0; PlayerToyInfo[playerid][slotselection[playerid]][ptRotY] = 0.0; PlayerToyInfo[playerid][slotselection[playerid]][ptRotZ] = 0.0; } else if(modelid >= 18911 && modelid <= 18920) { PlayerToyInfo[playerid][slotselection[playerid]][ptBone] = 2; PlayerToyInfo[playerid][slotselection[playerid]][ptPosX] = 0.1; PlayerToyInfo[playerid][slotselection[playerid]][ptPosY] = 0.035; PlayerToyInfo[playerid][slotselection[playerid]][ptPosZ] = 0.0; PlayerToyInfo[playerid][slotselection[playerid]][ptRotX] = 90.0; PlayerToyInfo[playerid][slotselection[playerid]][ptRotY] = 180.0; PlayerToyInfo[playerid][slotselection[playerid]][ptRotZ] = 90.0; } else if(modelid == 19078 || modelid == 19078) { PlayerToyInfo[playerid][slotselection[playerid]][ptBone] = 16; PlayerToyInfo[playerid][slotselection[playerid]][ptPosX] = 0; PlayerToyInfo[playerid][slotselection[playerid]][ptPosY] = 0; PlayerToyInfo[playerid][slotselection[playerid]][ptPosZ] = 0; PlayerToyInfo[playerid][slotselection[playerid]][ptRotX] = 180.0; PlayerToyInfo[playerid][slotselection[playerid]][ptRotY] = 180.0; PlayerToyInfo[playerid][slotselection[playerid]][ptRotZ] = 0.0; } else if((modelid >= 18641 && modelid <= 18644) || (modelid >= 19080 && modelid <= 19084) || modelid == 18890) { PlayerToyInfo[playerid][slotselection[playerid]][ptBone] = 6; PlayerToyInfo[playerid][slotselection[playerid]][ptPosX] = 0.0; PlayerToyInfo[playerid][slotselection[playerid]][ptPosY] = 0.0; PlayerToyInfo[playerid][slotselection[playerid]][ptPosZ] = 0.0; PlayerToyInfo[playerid][slotselection[playerid]][ptRotX] = 0.0; PlayerToyInfo[playerid][slotselection[playerid]][ptRotY] = 0.0; PlayerToyInfo[playerid][slotselection[playerid]][ptRotZ] = 0.0; } else { PlayerToyInfo[playerid][slotselection[playerid]][ptBone] = 2; PlayerToyInfo[playerid][slotselection[playerid]][ptPosX] = 0.0; PlayerToyInfo[playerid][slotselection[playerid]][ptPosY] = 0.0; PlayerToyInfo[playerid][slotselection[playerid]][ptPosZ] = 0.0; PlayerToyInfo[playerid][slotselection[playerid]][ptRotX] = 0.0; PlayerToyInfo[playerid][slotselection[playerid]][ptRotY] = 0.0; PlayerToyInfo[playerid][slotselection[playerid]][ptRotZ] = 0.0; } PlayerToyInfo[playerid][slotselection[playerid]][ptScaleX] = 1.0; PlayerToyInfo[playerid][slotselection[playerid]][ptScaleY] = 1.0; PlayerToyInfo[playerid][slotselection[playerid]][ptScaleZ] = 1.0; new szQuery[460]; new string[128]; format(szQuery, sizeof(szQuery),"INSERT INTO toys (Owner, ModelID, Bone, PosX, PosY, PosZ, RotX, RotY, RotZ, ScaX, ScaY, ScaZ) VALUES(%d, %d, %d, '%f', '%f', '%f', '%f', '%f', '%f', '%f', '%f', '%f')", PlayerInfo[playerid][pID], PlayerToyInfo[playerid][slotselection[playerid]][ptModelID], PlayerToyInfo[playerid][slotselection[playerid]][ptPosX], PlayerToyInfo[playerid][slotselection[playerid]][ptPosY], PlayerToyInfo[playerid][slotselection[playerid]][ptPosZ], PlayerToyInfo[playerid][slotselection[playerid]][ptRotX], PlayerToyInfo[playerid][slotselection[playerid]][ptRotY], PlayerToyInfo[playerid][slotselection[playerid]][ptRotZ], PlayerToyInfo[playerid][slotselection[playerid]][ptScaleX], PlayerToyInfo[playerid][slotselection[playerid]][ptScaleY], PlayerToyInfo[playerid][slotselection[playerid]][ptScaleZ]); mysql_query(szQuery); PlayerToyInfo[playerid][slotselection[playerid]][ptRealID] = mysql_insert_id(); format(string, sizeof(string), "* You have purchased %s for $%d (Slot: %d)", HoldingObjects[listid][holdingmodelname], HoldingObjects[listid][holdingprice], slotselection[playerid]); SendClientMessage(playerid, COLOR_RED, string); SendClientMessage(playerid, COLOR_WHITE, "HINT: Use /items to wear/edit this"); } } else SendClientMessage(playerid, COLOR_RED, "<!> You have closed the accesories list."); return 1; } return 1; }
Website: www.variousgaming.net