SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 23/06/2016, 02:48 PM   #1
MayaEU
Huge Clucker
 
Join Date: Nov 2015
Posts: 384
Reputation: 2
Default Please help me with this command

I have this toys system, at the beginning every toy object ids was in one. but i have made it in
diffrent classes, clothes1, clothes2 and toys1.. But when i type /toys it doesnt show the right item name
i hope anyone can help me. and sorry for my bad English


pawn Code:
if((dialogid == TOYS) && response)
    {
        if(PlayerToyInfo[playerid][listitem][ptModelID] == 0)
        {
            ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Toy Menu: Attach/Deattach", "Woops! You don't have anything to put on from that slot", "OK", "");
        }
        else
        {
            if(IsPlayerAttachedObjectSlotUsed(playerid, listitem))
            {
                new name[24];
                format(name, sizeof(name), "None");

                for(new i;i<sizeof(HoldingObjectsToys1);i++)
                {
                    if(HoldingObjectsToys1[i][holdingmodelid] == PlayerToyInfo[playerid][listitem][ptModelID])
                    {
                        format(name, sizeof(name), "%s", HoldingObjectsToys1[i][holdingmodelname]);
                    }
                }
                new string[400];
                format(string, sizeof(string), "Successfully unequipped %s (Bone: %s) (Slot: %d)", name, HoldingBones[PlayerToyInfo[playerid][listitem][ptBone]], listitem);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                RemovePlayerAttachedObject(playerid, listitem);
            }
            else
            {
                SetPlayerAttachedObject(playerid, listitem, PlayerToyInfo[playerid][listitem][ptModelID], PlayerToyInfo[playerid][listitem][ptBone], PlayerToyInfo[playerid][listitem][ptPosX], PlayerToyInfo[playerid][listitem][ptPosY], PlayerToyInfo[playerid][listitem][ptPosZ], PlayerToyInfo[playerid][listitem][ptRotX],
                PlayerToyInfo[playerid][listitem][ptRotY], PlayerToyInfo[playerid][listitem][ptRotZ], PlayerToyInfo[playerid][listitem][ptScaleX], PlayerToyInfo[playerid][listitem][ptScaleY], PlayerToyInfo[playerid][listitem][ptScaleZ]);
                new name[24];
                format(name, sizeof(name), "None");

                for(new i;i<sizeof(HoldingObjectsToys1);i++)
                {
                    if(HoldingObjectsToys1[i][holdingmodelid] == PlayerToyInfo[playerid][listitem][ptModelID])
                    {
                        format(name, sizeof(name), "%s", HoldingObjectsToys1[i][holdingmodelname]);
                    }
                }
                new string[400];
                format(string, sizeof(string), "Successfully equipped %s (Bone: %s) (Slot: %d)", name, HoldingBones[PlayerToyInfo[playerid][listitem][ptBone]], listitem);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
            }
        }
    }



pawn Code:
if (strcmp("/toys", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog( playerid, TOYS, DIALOG_STYLE_LIST, "Toy Menu", "Equip/Unequip\nEdit\nDelete\nEquip All\nUnequip All","Select", "Cancel" );
        return 1;
    }

pawn Code:
new HoldingObjectsClothes1[90][HoldingEnumAll] = {
{19141,2500,"SWATHelmet1"},
{19142,2500,"SWATArmour1"},
{18636,1000,"PoliceCap1"},
{19099,1000,"PoliceCap2"},
{19100,1000,"PoliceCap3"},
{18637,1000,"PoliceShield1"},
{19161,1000,"PoliceHat1"},
{19162,1000,"PoliceHat2"},
{19200,1000,"PoliceHelmet1"},
{19138,1000,"PoliceGlasses1"},
{19139,1000,"PoliceGlasses2"},//80
{19140,1000,"PoliceGlasses3"},
{18638,500,"HardHat"},
{19093,500,"HardHat2"},
{19160,500,"HardHat3"},
{18639,500,"BlackHat"},
{18640,700,"Hair"},
{18975,700,"Hair2"},
{19136,700,"Hair3"},
{19274,700,"Hair4"},
{18891,500,"Bandana1"},
{18892,500,"Bandana2"},
{18893,500,"Bandana3"},
{18894,500,"Bandana4"},
{18895,500,"Bandana5"},
{18896,500,"Bandana6"},
{18897,500,"Bandana7"},
{18898,500,"Bandana8"},
{18899,500,"Bandana9"},
{18900,500,"Bandana10"},
{18901,750,"Bandana11"},//60
{18902,750,"Bandana12"},
{18903,750,"Bandana13"},
{18904,750,"Bandana14"},
{18905,750,"Bandana15"},
{18906,750,"Bandana16"},
{18907,750,"Bandana17"},
{18908,750,"Bandana18"},
{18909,750,"Bandana19"},
{18910,750,"Bandana20"},
{18911,1000,"Mask1"},
{18912,1000,"Mask2"},
{18913,1000,"Mask3"},
{18914,1000,"Mask4"},
{18915,1000,"Mask5"},
{18916,1000,"Mask6"},
{18917,1000,"Mask7"},
{18918,1000,"Mask8"},
{18919,1000,"Mask9"},
{18920,1000,"Mask10"},
{18921,500,"Beret1"},//40
{18922,500,"Beret2"},
{18923,750,"Beret3"},
{18924,1000,"Beret4"},
{18925,1000,"Beret5"},
{18926,500,"Hat1"},
{18927,500,"Hat2"},
{18928,500,"Hat3"},
{18929,500,"Hat4"},
{18930,500,"Hat5"},
{18931,1000,"Hat6"},
{18932,1000,"Hat7"},
{18933,1000,"Hat8"},
{18934,1000,"Hat9"},
{18935,1000,"Hat10"},
{18936,500,"Helmet1"},
{18937,750,"Helmet2"},
{18938,1000,"Helmet3"},
{18939,750,"CapBack1"},
{18940,750,"CapBack2"},
{18941,750,"CapBack3"},//20
{18942,1000,"CapBack4"},
{18943,1000,"CapBack5"},
{18944,1000,"HatBoater1"},
{18945,1250,"HatBoater2"},
{18946,1500,"HatBoater3"},
{18947,1000,"HatBowler1"},
{18948,1000,"HatBowler2"},
{18949,1000,"HatBowler3"},
{18950,1000,"HatBowler4"},
{18951,1000,"HatBowler5"},
{19064,10000, "SantaHat1"},
{19065,20000, "SantaHat2"},
{19066,30000, "SantaHat3"},
{19067,1000, "HoodyHat1"},
{19068,1000, "HoodyHat2"},
{19069,1000, "HoodyHat3"},
{19090,1500, "PomPomBlue"},
{19091,1500, "PomPomRed"},
{19092,1500, "PomPomGreen"}
};

new HoldingObjectsClothes2[97][HoldingEnumAll] = {
{18952,1500,"BoxingHelmet"},
{18953,500,"CapKnit1"},
{18954,750,"CapKnit2"},
{18955,750,"CapOverEye1"},
{18956,750,"CapOverEye2"},
{18957,750,"CapOverEye3"},
{18958,750,"CapOverEye4"},
{18959,750,"CapOverEye5"},
{18960,1000,"CapRimUp1"},
{18961,750,"CapTrucker1"},
{18962,750,"CowboyHat2"},
{18964,1000,"SkullyCap1"},
{18965,1250,"SkullyCap2"},
{18966,1500,"SkullyCap3"},
{18967,1000,"HatMan1"},
{18968,1000,"HatMan2"},
{18969,1000,"HatMan3"},
{18970,2000,"HatTiger"}, //80
{18971,1000,"HatCool1"},
{18972,1250,"HatCool2"},
{18973,1500,"HatCool3"},
{18974,10000,"MaskZorro1"},
{18645,1500,"MotorcycleHelmet"},
{18976,1000,"MotorcycleHelmet2"},
{18977,1000,"MotorcycleHelmet3"},
{18978,1250,"MotorcycleHelmet4"},
{18979,1500,"MotorcycleHelmet5"},
{19006,500,"GlassesType1"},
{19007,500,"GlassesType2"},
{19008,500,"GlassesType3"},
{19009,500,"GlassesType4"},
{19010,500,"GlassesType5"},
{19011,500,"GlassesType6"},
{19012,500,"GlassesType7"},
{19013,500,"GlassesType8"},
{19014,500,"GlassesType9"},
{19015,500,"GlassesType10"},
{19016,1000,"GlassesType11"},//60
{19017,1000,"GlassesType12"},
{19018,1000,"GlassesType13"},
{19019,1000,"GlassesType14"},
{19020,1000,"GlassesType15"},
{19021,1000,"GlassesType16"},
{19022,1000,"GlassesType17"},
{19023,1000,"GlassesType18"},
{19024,1000,"GlassesType19"},
{19025,1000,"GlassesType20"},
{19026,1500,"GlassesType21"},
{19027,1500,"GlassesType22"},
{19028,1500,"GlassesType23"},
{19029,1500,"GlassesType24"},
{19030,1500,"GlassesType25"},
{19031,1500,"GlassesType26"},
{19032,1500,"GlassesType27"},
{19033,1500,"GlassesType28"},
{19034,1500,"GlassesType29"},
{19035,1500,"GlassesType30"},
{19036,2000,"HockeyMask1"},//40
{19037,2000,"HockeyMask2"},
{19038,2000,"HockeyMask3"},
{19039,500,"WatchType1"},
{19040,500,"WatchType2"},
{19041,500,"WatchType3"},
{19042,500,"WatchType4"},
{19043,500,"WatchType5"},
{19044,500,"WatchType6"},
{19045,500,"WatchType7"},
{19046,1000,"WatchType8"},
{19047,1000,"WatchType9"},
{19048,1000,"WatchType10"},
{19049,1000,"WatchType11"},
{19050,1000,"WatchType12"},
{19051,1000,"WatchType13"},
{19052,1000,"WatchType14"},
{19053,1000,"WatchType15"},
{19094,2000, "BurgerShotHat"},
{19095,500, "CowboyHat1"},
{19096,500, "CowboyHat3"},// 20
{19097,1000, "CowboyHat4"},
{19098,1000, "CowboyHat5"},
{19107,4000, "ArmyHelmet7"},
{19108,4000, "ArmyHelmet8"},
{19109,4000, "ArmyHelmet9"},
{19110,4000, "ArmyHelmet10"},
{19111,4000, "ArmyHelmet11"},
{19112,4000, "ArmyHelmet12"},
{19113,1000, "SillyHelmet1"},
{19114,2000, "SillyHelmet2"},
{19115,3000, "SillyHelmet3"},
{19116,500, "PlainHelmet1"},
{19117,500, "PlainHelmet2"},
{19118,750, "PlainHelmet3"},
{19119,1000, "PlainHelmet4"},
{19120,1000, "PlainHelmet5"},
{19137,5000, "CluckinBellHat"},
{18875,750, "Pager"},
{19163,1000, "GimpMask"}
};

new HoldingObjectsToys1[65][HoldingEnumAll] = {
{18642,1000,"Taser1"},
{18643,10000,"LaserPointer1"},
{19080,10000,"LaserPointer2"},
{19081,10000,"LaserPointer3"},
{19082,10000,"LaserPointer4"},
{19083,10000,"LaserPointer5"}, // 60
{19084,10000,"LaserPointer6"},
{19086,5000,"ChainsawDildo1"},
{18675,10000,"SmokePuff"},
{19701,10000,"SmallFlame"},
{18693,10000,"LargeFlame"},
{18698,10000,"Insects"},
{18708,10000,"Bubbles"},
{18632,1000,"Fishing Rod"},
{18633,1500,"Wrench"},
{18634,1000,"Crowbar"},
{18635,1000,"Hammer"},
{18641,1000,"Flashlight"},
{18644,5000,"Screwdriver"},
{18865,500,"MobilePhone1"},
{18866,500,"MobilePhone2"},
{18867,500,"MobilePhone3"},
{18868,500,"MobilePhone4"},
{18869,500,"MobilePhone5"},
{18870,1000,"MobilePhone6"},
{18871,1000,"MobilePhone7"}, // 40
{18872,1000,"MobilePhone8"},
{18873,1000,"MobilePhone9"},
{18874,1000,"MobilePhone10"},
{18890,500,"Rake"},
{19078,7500, "TheParrot1"},
{19079,7500, "TheParrot2"},
{19085,5000, "EyePatch"},
{1659,500, "WineGlass"},
{1661,500, "Bottle"},
{19348,500, "Cane01"},
{19350,500, "moustache01"},
{19352,500, "Tophat"},
{19346,500, "Hotdog"},
{19317,500, "BassGuitar"},
{19319,500, "WarlockGuitar"},
{19318,500, "flyingvGuitar"},
{19315,500, "Deer"},
{19349,500, "monocle01"},
{19472,500, "gasmask01"},
{1271,500, "CardboardBox"}, // 20
{1252,500, "BombItem"},
{1310,500, "Backpack"},
{1578,500, "Pizzabox"},
{1646,500, "Petrolcan"},
{1658,500, "Beerglass"},
{1947,500, "Cigar"},
{3040,500, "PaperContract"},
{3050,500, "Shoebox"},
{3058,500, "PizzaSlice"},
{3059,500, "Burger"},
{3068,500, "Mop"},
{3125,500, "Burrito"},
{3186,500, "Nastydish"},
{2470,500, "Basketball"},
{2318,500, "Record"},
{1210,500, "Briefcase"},
{19088,500, "Rope"},
{18663,500, "Tattoo1"},
{19469,500, "Scarf"}
};
MayaEU is offline   Reply With Quote
Old 23/06/2016, 03:24 PM   #2
MayaEU
Huge Clucker
 
Join Date: Nov 2015
Posts: 384
Reputation: 2
Default Re: Please help me with this command

Anyone?
MayaEU is offline   Reply With Quote
Old 23/06/2016, 03:27 PM   #3
Owen007
Big Clucker
 
Owen007's Avatar
 
Join Date: Jun 2016
Location: Earth
Posts: 183
Reputation: 26
Default Re: Please help me with this command

the toys are not in order because u have to organise them in order in your dialog option or wherever u doing it.
__________________
My Work:

[FS]OAdmin+Register System V1.0

[GM]Zombie VS Human Apocalypse V1.4.0 All bugs Fixed.



Anyone Interested in making a whole new Los Santos Zombie Apocalypse? With Some extra Cool Features DM Me Now!
Owen007 is offline   Reply With Quote
Old 23/06/2016, 03:49 PM   #4
MayaEU
Huge Clucker
 
Join Date: Nov 2015
Posts: 384
Reputation: 2
Default Re: Please help me with this command

I dont understand what you mean
MayaEU is offline   Reply With Quote
Old 23/06/2016, 03:57 PM   #5
[KHK]Khalid
Gangsta
 
[KHK]Khalid's Avatar
 
Join Date: Jan 2012
Location: Alexandria, Egypt
Posts: 854
Reputation: 136
Default Re: Please help me with this command

Quote:
Originally Posted by MayaEU View Post
at the beginning every toy object ids was in one. but i have made it in
diffrent classes, clothes1, clothes2 and toys1
You most likely messed up the correct ordering. You have to figure out what went wrong and re-organize the lists. I don't expect someone will do it for you.
[KHK]Khalid is offline   Reply With Quote
Old 23/06/2016, 04:29 PM   #6
MayaEU
Huge Clucker
 
Join Date: Nov 2015
Posts: 384
Reputation: 2
Default Re: Please help me with this command

Well i think the problem is here

pawn Code:
if((dialogid == TOYS) && response)
    {
        if(PlayerToyInfo[playerid][listitem][ptModelID] == 0)
        {
            ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Toy Menu: Attach/Deattach", "Woops! You don't have anything to put on from that slot", "OK", "");
        }
        else
        {
            if(IsPlayerAttachedObjectSlotUsed(playerid, listitem))
            {
                new name[24];
                format(name, sizeof(name), "None");

                for(new i;i<sizeof(HoldingObjectsToys1);i++)
                {
                    if(HoldingObjectsToys1[i][holdingmodelid] == PlayerToyInfo[playerid][listitem][ptModelID])
                    {
                        format(name, sizeof(name), "%s", HoldingObjectsToys1[i][holdingmodelname]);
                    }
                }
                new string[400];
                format(string, sizeof(string), "Successfully unequipped %s (Bone: %s) (Slot: %d)", name, HoldingBones[PlayerToyInfo[playerid][listitem][ptBone]], listitem);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                RemovePlayerAttachedObject(playerid, listitem);
            }
            else
            {
                SetPlayerAttachedObject(playerid, listitem, PlayerToyInfo[playerid][listitem][ptModelID], PlayerToyInfo[playerid][listitem][ptBone], PlayerToyInfo[playerid][listitem][ptPosX], PlayerToyInfo[playerid][listitem][ptPosY], PlayerToyInfo[playerid][listitem][ptPosZ], PlayerToyInfo[playerid][listitem][ptRotX],
                PlayerToyInfo[playerid][listitem][ptRotY], PlayerToyInfo[playerid][listitem][ptRotZ], PlayerToyInfo[playerid][listitem][ptScaleX], PlayerToyInfo[playerid][listitem][ptScaleY], PlayerToyInfo[playerid][listitem][ptScaleZ]);
                new name[24];
                format(name, sizeof(name), "None");

                for(new i;i<sizeof(HoldingObjectsToys1);i++)
                {
                    if(HoldingObjectsToys1[i][holdingmodelid] == PlayerToyInfo[playerid][listitem][ptModelID])
                    {
                        format(name, sizeof(name), "%s", HoldingObjectsToys1[i][holdingmodelname]);
                    }
                }
                new string[400];
                format(string, sizeof(string), "Successfully equipped %s (Bone: %s) (Slot: %d)", name, HoldingBones[PlayerToyInfo[playerid][listitem][ptBone]], listitem);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
            }
        }
    }
MayaEU is offline   Reply With Quote
Old 23/06/2016, 05:27 PM   #7
MayaEU
Huge Clucker
 
Join Date: Nov 2015
Posts: 384
Reputation: 2
Default Re: Please help me with this command

it takes the ids from this
but i need to add HoldingObjectsClothes1 and HoldingObjectsClothes2 can anyone help me?

pawn Code:
for(new i;i<sizeof(HoldingObjectsToys1);i++)
                {
                    if(HoldingObjectsToys1[i][holdingmodelid] == PlayerToyInfo[playerid][listitem][ptModelID])
                    {
                        format(name, sizeof(name), "%s", HoldingObjectsToys1[i][holdingmodelname]);
                    }
                }
MayaEU is offline   Reply With Quote
Old 24/06/2016, 07:15 AM   #8
MayaEU
Huge Clucker
 
Join Date: Nov 2015
Posts: 384
Reputation: 2
Default Re: Please help me with this command

Anyone?
MayaEU is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with YCMD proces command and problem with "Server:Unknown command JoDe Scripting Help 1 20/04/2018 12:12 PM
[Plugin] mcmd Command Engine - Plugin based command processing Mellnik Plugin Development 108 08/05/2016 01:55 PM
i had this command in my gamemode, when i type this in game,it tells server unknow command? Chrisli520 Scripting Help 3 24/11/2013 10:02 AM
Executed ZCMD command returns SERVER: Unknown Command SexTourist Scripting Help 12 03/01/2012 03:38 PM
Slap command returns an Unknown Command when player is not connected HydraX Help Archive 16 01/08/2011 05:19 AM


All times are GMT. The time now is 10:40 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.