[Convert] Clothing system
#1

Hi guys, i want to use this fs in my gamemode, but i was tried to converting ShowPlayerDialog to easydialog and i also tried to converting MySQL R34 to R20 But nothing I ever plan works out, pls help me thanks all!

PHP код:
/*
Clothing System by Paul AKA ImTheGod
Enjoy!! COPY RIGHTS RESERVED.
*/
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <h_colors>
#include <a_mysql>
new query[256], msg[500], dstr[500];
#define NEXT_PAGE_SLOT 50
//Dialog ID's
#define D_CLOTHES 1000
#define D_BUY_CLOTHES 1001
//Dialog Stats
#define ON_CLOTHES_LIST 500
#define ON_CLOTHES_NONE 501
#define ON_CLOTHES_CHOSE 502
#define ON_CLOTHES_BONE 503
#define ON_CLOTHES_BUY 504
/**************************************************************************************/
#define MAX_MODELS 5
enum _PLAYER_MODELS
{
    
cID,
    
cModelID,
    
cBoneID,
    
Float:cOffsetX,
    
Float:cOffsetY,
    
Float:cOffsetZ,
    
Float:cRotX,
    
Float:cRotY,
    
Float:cRotZ,
    
Float:cScaleX,
    
Float:cScaleY,
    
Float:cScaleZ,
    
bool:cOn,
}
new 
ClothesInfo[MAX_PLAYERS][MAX_MODELS][_PLAYER_MODELS];
/**************************************************************************************/
enum _MODELS_INFO
{
    
modelID,
    
modelName[128],
    
modelPrice,
    
modelBone
}
new 
ModelsInfo[][_MODELS_INFO] = {
{
18926"Army Hat"7002},
{
18927"Azure Hat"7002},
{
18928"Funky Hat"7002},
{
18929"Dark Gray Hat"7002},
{
18930"Fire Hat"7002},
{
18931"Dark Blue Hat"7002},
{
18932"Orange Hat"7002},
{
18933"Light Gray Hat"7002},
{
18934"Pink Hat"7002},
{
18935"Yellow Hat"7002},
{
18944"Fire Hat Boater"10002},
{
18945"Gray Hat Boater"10002},
{
18946"Gray Hat Boater 2"10002},
{
18947"Black Hat Bowler"10002},
{
18948"Azure Hat Bowler"10002},
{
18949"Green Hat Bowler"10002},
{
18950"Red Hat Bowler"10002},
{
18951"Light Green Hat Bowler"10002},
{
19488"White Hat Bowler"10002},
{
18967"Simple Black Hat"5002},
{
18968"Simple Gray Hat"5002},
{
18969"Simple Orange Hat"5002},
{
18970"Tiger Hat"10002},
{
18971"Black & White Cool Hat"10002},
{
18972"Black & Orange Cool Hat"10002},
{
18973"Black & Green Cool Hat"10002},
{
19066"Santa Hat"30002},
{
19067"Red Hoody Hat"5002},
{
19068"Tiger Hoody Hat"5002},
{
19069"Black Hoody Hat"5002},
{
19093"White Dude Hat"13002},
{
19095"Brown Cowboy Hat"13002},
{
19096"Black Cowboy Hat"13002},
{
19097"Black Cowboy Hat 2"13002},
{
19098"Brown Cowboy Hat 2"13002},
{
19352"Black Top Hat"20002},
{
19487"White Top Hat"20002},
{
18964"Black Skully Cap"7002},
{
18965"Brown Skully Cap"7002},
{
18966"Funky Skully Cap"7002},
{
18921"Blue Beret"5002},
{
18922"Red Beret"5002},
{
18923"Dark Blue Beret"5002},
{
18924"Army Beret"5002},
{
18925"Red Army Beret"5002},
{
18939"Dark Blue CapBack"10002},
{
18940"Azure CapBack"10002},
{
18941"Black CapBack"10002},
{
18942"Gray CapBack"10002},
{
18943"Green CapBack"10002},
{
19006"Red Glasses"10002},
{
19007"Green Glasses"10002},
{
19008"Yellow Glasses"10002},
{
19009"Azure Glasses"10002},
{
19010"Pink Glasses"10002},
{
19011"Funky Glasses"10002},
{
19012"Gray Glasses"10002},
{
19013"Funky Glasses 2"10002},
{
19014"Black & White Glasses"10002},
{
19015"White Glasses"10002},
{
19016"X-Ray Glasses"30002},
{
19017"Covered Yellow Glasses"10002},
{
19018"Covered Orange Glasses"10002},
{
19019"Covered Red Glasses"10002},
{
19020"Covered Blue Glasses"10002},
{
19021"Covered Green Glasses"10002},
{
19022"Cool Black Glasses"10002},
{
19023"Cool Azure Glasses"10002},
{
19024"Cool Blue Glasses"10002},
{
19025"Cool Pink Glasses"10002},
{
19026"Cool Red Glasses"10002},
{
19027"Cool Orange Glasses"10002},
{
19028"Cool Yellow Glasses"10002},
{
19029"Cool Yellow Glasses"10002},
{
19030"Pink Nerd Glasses"15002},
{
19031"Green Nerd Glasses"15002},
{
19032"Red Nerd Glasses"15002},
{
19033"Black Nerd Glasses"15002},
{
19034"Black & White Nerd Glasses"15002},
{
19035"Ocean Nerd Glasses"15002},
{
18891"Purple Bandana"12002},
{
18892"Red Bandana"12002},
{
18893"Red&White Bandana"12002},
{
18894"Orange Bandana"12002},
{
18895"Skull Bandana"12002},
{
18896"Black Bandana"12002},
{
18897"Blue Bandana"12002},
{
18898"Green Bandana"12002},
{
18899"Pink Bandana"12002},
{
18900"Funky Bandana"12002},
{
18901"Tiger Bandana"12002},
{
18902"Yellow Bandana"12002},
{
18903"Azure Bandana"12002},
{
18904"Dark Blue Bandana"12002},
{
18905"Olive Bandana"12002},
{
18906"Orange&Yellow Bandana"8002},
{
18907"Funky Bandana 2"8002},
{
18907"Blue Bandana 2"8002},
{
18907"Azure Bandana 2"8002},
{
18907"Fire Bandana"8002},
{
18911"Skull Bandana Mask"120018},
{
18912"Black Bandana Mask"120018},
{
18913"Green Bandana Mask"120018},
{
18914"Army Bandana Mask"120018},
{
18915"Funky Bandana Mask"120018},
{
18916"Light Bandana Mask"120018},
{
18917"Dark Blue Bandana Mask"120018},
{
18918"Gray Bandana Mask"120018},
{
18919"White Bandana Mask"120018},
{
18920"Colorful Bandana Mask"120018},
{
19421"White Headphones"20002},
{
19422"Black Headphones"20002},
{
19423"Gray Headphones"20002},
{
19424"Blue Headphones"20002},
{
19036"White Hockey Mask"12002},
{
19037"Red Hockey Mask"12002},
{
19038"Green Hockey Mask"12002},
{
19472"Gas Mask"20002},
{
2919"Sports Bag"15005},
{
3026"Jansport Backpack"15001},
{
18645"Red&White Motorcycle Helmet"40002},
{
18976"Blue Motorcycle Helmet"40002},
{
18977"Red Motorcycle Helmet"40002},
{
18978"White Motorcycle Helmet"40002},
{
18979"Purple Motorcycle Helmet"40002},
{
19317"Bass Guitar"14000 ,1},
{
19318"Flying Guitar"150001},
{
19319"Warlock Guitar"160001}
};
/**************************************************************************************/
stock LoadPlayerClothes(playerid)
{
    
format(querysizeof(query), "SELECT * FROM `clothes` WHERE `holder` = '%s'"GetName(playerid));
    
mysql_function_query(1querytrue"OnClothesLoad""i"playerid);
}
forward OnClothesLoad(playerid);
public 
OnClothesLoad(playerid)
{
    new 
rowsfields;
    
cache_get_data(rowsfields);
    if(
rows)
    {
        for(new 
0rowsi++)
        {
            
ClothesInfo[playerid][i][cID] = cache_get_row_int(i0);
            
ClothesInfo[playerid][i][cModelID] = cache_get_row_int(i2);
            
ClothesInfo[playerid][i][cBoneID] = cache_get_row_int(i3);
            
ClothesInfo[playerid][i][cOffsetX] = cache_get_row_float(i4);
            
ClothesInfo[playerid][i][cOffsetY] = cache_get_row_float(i5);
            
ClothesInfo[playerid][i][cOffsetZ] = cache_get_row_float(i6);
            
ClothesInfo[playerid][i][cRotX] = cache_get_row_float(i7);
            
ClothesInfo[playerid][i][cRotY] = cache_get_row_float(i8);
            
ClothesInfo[playerid][i][cRotZ] = cache_get_row_float(i9);
            
ClothesInfo[playerid][i][cScaleX] = cache_get_row_float(i10);
            
ClothesInfo[playerid][i][cScaleY] = cache_get_row_float(i11);
            
ClothesInfo[playerid][i][cScaleZ] = cache_get_row_float(i12);
            
ClothesInfo[playerid][i][cOn] = true;
        }
    }
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    
LoadPlayerClothes(playerid);
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    
SavePlayerClothes(playerid);
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    return 
1;
}
public 
OnPlayerDeath(playeridkilleridreason)
{
    
ResetClothes(playerid);
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    new 
status GetPVarInt(playerid"DialogStatus");
    if(
dialogid == D_CLOTHES)
    {
        switch(
status)
        {
            case 
ON_CLOTHES_LIST:
            {
                if(
response)
                {
                    new 
listitem;
                    if(!
ClothesInfo[playerid][i][cOn])
                    {
                        
ShowDialog(playeridD_CLOTHESDIALOG_STYLE_MSGBOX"Clothing List""Empty index...""<<<"""ON_CLOTHES_NONE);
                    }
                    else
                    {
                        
SetPVarInt(playerid"IndexChose"i);
                        
ClothesEditDialog(playeridi);
                    }
                }
            }
            case 
ON_CLOTHES_NONE:
            {
                if(
response || !response)
                {
                    
DisplayClothing(playerid);
                }
            }
            case 
ON_CLOTHES_CHOSE:
            {
                if(
response)
                {
                    new 
slot GetPVarInt(playerid"IndexChose");
                    switch(
listitem)
                    {
                        case 
0
                        {
                            
EditClothing(playeridslot);
                        }
                        case 
1:
                        {
                            
ShowDialog(playeridD_CLOTHESDIALOG_STYLE_LIST"Change The Bone Slot""Spine\nHead\nLeft Upper Arm\nRight Upper Arm\nLeft Hand\nRight Hand\nLeft Thigh\nRight Thigh\nLeft Food\nRight Foot\nRight Calf\nLeft Calf\nLeft Forearm\nRight forearm\nLeft Clavicle\nRight Clavicle\nNeck\nJaw""Select""<<<"ON_CLOTHES_BONE);
                        }
                        case 
2:
                        {
                            
PlaceClothing(playeridslot);
                            
ClothesEditDialog(playeridslot);
                        }
                    }
                }
                else
                {
                    
DisplayClothing(playerid);
                }
            }
            case 
ON_CLOTHES_BONE:
            {
                new 
index GetPVarInt(playerid"IndexChose");
                if(
response)
                {
                    new 
bone listitem 1;
                    
format(msgsizeof(msg), "You have adjusted your clothing index %d to bone %s."indexGetBoneName(bone));
                    
SendClientMessage(playeridCOLOR_WHITEmsg);
                    
ClothesInfo[playerid][index][cBoneID] = bone;
                    if(
IsPlayerAttachedObjectSlotUsed(playeridindex))
                    {
                        
ReplaceClothing(playeridindex);
                    }
                    
ClothesEditDialog(playeridindex);
                }
                else
                {
                    
ClothesEditDialog(playeridindex);
                }
            }        
        }
    }
    
/******************************************************************************/
    
if(dialogid == D_BUY_CLOTHES)
    {
        switch(
status)
        {
            case 
ON_CLOTHES_BUY:
            {
                if(
response)
                {
                    new 
slot GetPVarInt(playerid"FromSlot");
                    if(
listitem != NEXT_PAGE_SLOT)
                    {
                        new 
slot listitem;
                        new 
price ModelsInfo[i][modelPrice];
                        new 
freeslot GetFreeSlot(playerid);
                        if(
GetPlayerMoney(playerid) >= price)
                        {
                            if(
freeslot != -1)
                            {
                                
SendClientMessage(playerid, -1"Before you complete the purchase you may take a look at the item and adjust it.");
                                
SendClientMessage(playerid, -1"Press {FFFF00}ESC{FFFFFF} to cancel the purchase.");
                                
SetPVarInt(playerid"SelectedItem"1);
                                
SetPVarInt(playerid"ItemIndex"i);
                                
SetPVarInt(playerid"FreeSlot"freeslot);
                                
SetPlayerAttachedObject(playeridfreeslotModelsInfo[i][modelID], ModelsInfo[i][modelBone]);
                                
EditAttachedObject(playeridfreeslot);
                            }
                            else
                            {
                                
SendClientMessage(playeridCOLOR_LIGHTRED"Purchase failed, you do not possess any free slots.");
                            }
                        }
                        else
                        {
                            
format(msgsizeof(msg), "You are lacking money, ${FFFF00}%d"ModelsInfo[i][modelPrice]);
                            
SendClientMessage(playerid, -1msg);
                        }
                    }
                    else
                    {
                        
ShowClothesDialog(playeridslot NEXT_PAGE_SLOT);
                    }
                }
                else
                {
                    
DeletePVar(playerid"FromSlot");
                }
            }
        }
    }
    return 
1;
}
stock GetFreeSlot(playerid)
{
    for(new 
0MAX_MODELSi++)
    {
        if(!
ClothesInfo[playerid][i][cOn])
            return 
i;
    }
    return -
1;
}
stock OnBuyClothes(playeridindexmodelboneFloat:fOffsetXFloat:fOffsetYFloat:fOffsetZFloat:fRotXFloat:fRotYFloat:fRotZFloat:fScaleXFloat:fScaleYFloat:fScaleZ)
{
    
format(querysizeof(query), "INSERT INTO `clothes` (holder, model, bone, offestx, offesty, offestz, rotx, roty, rotz, scalex, scaley, scalez) VALUES ('%s', %d, %d, %f, %f, %f, %f, %f, %f, %f, %f, %f)",
    
GetName(playerid), modelbonefOffsetXfOffsetYfOffsetZfRotXfRotYfRotZfScaleXfScaleYfScaleZ);
    
mysql_function_query(1querytrue"OnFinishPurchase""id"playeridindex);
}
forward OnFinishPurchase(playeridindex);
public 
OnFinishPurchase(playeridindex)
{
    
ClothesInfo[playerid][index][cID] = cache_insert_id(1);
    return 
1;
}
stock ClothesEditDialog(playeridindex)
{
    if(
IsPlayerAttachedObjectSlotUsed(playeridindex))
    {
        
ShowDialog(playeridD_CLOTHESDIALOG_STYLE_LIST"Clothing List""Adjust The Item\nChange Bone Slot\nTake Off""Select""<<<"ON_CLOTHES_CHOSE);
    }
    else
    {
        
ShowDialog(playeridD_CLOTHESDIALOG_STYLE_LIST"Clothing List""Adjust The Item\nChange Bone Slot\nPlace On""Select""<<<"ON_CLOTHES_CHOSE);
    }
}
public 
OnPlayerEditAttachedObject(playeridresponseindexmodelidboneidFloat:fOffsetXFloat:fOffsetYFloat:fOffsetZFloat:fRotXFloat:fRotYFloat:fRotZFloat:fScaleXFloat:fScaleYFloat:fScaleZ)
{
    if(
GetPVarInt(playerid"EditingNow") == 1)
    {
        new 
GetPVarInt(playerid"EditingSlot");
        if(
response)
        {
            
ClothesInfo[playerid][i][cOffsetX] = fOffsetX;
            
ClothesInfo[playerid][i][cOffsetY] = fOffsetY;
            
ClothesInfo[playerid][i][cOffsetZ] = fOffsetZ;
            
ClothesInfo[playerid][i][cRotX] = fRotX;
            
ClothesInfo[playerid][i][cRotY] = fRotY;
            
ClothesInfo[playerid][i][cRotZ] = fRotZ;
            
ClothesInfo[playerid][i][cScaleX] = fScaleX;
            
ClothesInfo[playerid][i][cScaleY] = fScaleY;
            
ClothesInfo[playerid][i][cScaleZ] = fScaleZ;
        }
        
DeletePVar(playerid"EditingSlot");
        
DeletePVar(playerid"EditingNow");
        
ReplaceClothing(playeridi);
    }
    if(
GetPVarInt(playerid"SelectedItem") == && GetPVarInt(playerid"EditingNow") == 0)
    {
        new 
GetPVarInt(playerid"ItemIndex");
        new 
slot GetPVarInt(playerid"FreeSlot");
        if(
response)
        {
            
OnBuyClothes(playeridslotModelsInfo[i][modelID], ModelsInfo[i][modelBone], fOffsetXfOffsetYfOffsetZfRotXfRotYfRotZfScaleXfScaleYfScaleZ);
            
GivePlayerMoney(playerid, -ModelsInfo[i][modelPrice]);
            
format(msgsizeof(msg), "You have successfully purchased a {FFFF00}%s{FFFFFF} for ${FFFF00}%d"ModelsInfo[i][modelName], ModelsInfo[i][modelPrice]);
            
SendClientMessage(playerid, -1msg);
            
ClothesInfo[playerid][slot][cModelID] = ModelsInfo[i][modelID];
            
ClothesInfo[playerid][slot][cBoneID] = ModelsInfo[i][modelBone];
            
ClothesInfo[playerid][slot][cOffsetX] = fOffsetX;
            
ClothesInfo[playerid][slot][cOffsetY] = fOffsetY;
            
ClothesInfo[playerid][slot][cOffsetZ] = fOffsetZ;
            
ClothesInfo[playerid][slot][cRotX] = fRotX;
            
ClothesInfo[playerid][slot][cRotY] = fRotY;
            
ClothesInfo[playerid][slot][cRotZ] = fRotZ;
            
ClothesInfo[playerid][slot][cScaleX] = fScaleX;
            
ClothesInfo[playerid][slot][cScaleY] = fScaleY;
            
ClothesInfo[playerid][slot][cScaleZ] = fScaleZ;
            
ClothesInfo[playerid][slot][cOn] = true;
        }
        else
        {
            
SendClientMessage(playeridCOLOR_LIGHTRED"You've canceled the purchase of this item.");
            
RemovePlayerAttachedObject(playeridindex);
        }
        
DeletePVar(playerid"SelectedItem");
        
DeletePVar(playerid"ItemIndex");
        
DeletePVar(playerid"FreeSlot");
    }
    return 
1;
}
CMD:clothing(playeridparams[])
{
    new 
option[11], secoption;
    if(
GetPVarInt(playerid"SelectedItem") == 1)
        return 
SendClientMessage(playeridCOLOR_LIGHTRED"Please finish the current operation.");
    if(
sscanf(params"s[11]D(-1)"optionsecoption))
    {
        
SyntaxMSG(playerid"/clothing [place | adjust | delete]");
        
DisplayClothing(playerid);
        return 
1;
    }
    else if(!
strcmp(option"place"true))
    {
        new 
slot;
        if(
sscanf(params"{s[7]}d"slot))
        {
            
SyntaxMSG(playerid"/clothing place [slot]");
            for(new 
0MAX_MODELSi++)
            {
                if(
ClothesInfo[playerid][i][cOn])
                {
                    
format(msgsizeof(msg), "%d. %s"iGetModelName(ClothesInfo[playerid][i][cModelID]));
                    
SendClientMessage(playerid, -1msg);
                }
                else
                {
                    
format(msgsizeof(msg), "%d. EMPTY"i);
                    
SendClientMessage(playerid, -1msg);
                }
            }
            return 
1;
        }
        if(
slot MAX_MODELS || slot 0) return SendClientMessage(playerid, -1"Invalid slot.");
        if(!
ClothesInfo[playerid][slot][cOn]) return SendClientMessage(playerid, -1"No such item.");
        
PlaceClothing(playeridslot);
    }
    else if(!
strcmp(option"adjust"true)) 
    {
        new 
slot;
        if(
sscanf(params"{s[7]}d"slot)) return SyntaxMSG(playerid"/clothing adjust [slot]");
        if(
slot MAX_MODELS || slot 0) return SendClientMessage(playerid, -1"Invalid slot.");
        if(!
ClothesInfo[playerid][slot][cOn]) return SendClientMessage(playerid, -1"No such item.");
        
EditClothing(playeridslot);
    }
    else if(!
strcmp(option"delete"true)) 
    {
        new 
slot;
        if(
sscanf(params"{s[7]}d"slot)) return SyntaxMSG(playerid"/clothing drop [slot]");
        if(
slot MAX_MODELS || slot 0) return SendClientMessage(playerid, -1"Invalid slot.");
        if(!
ClothesInfo[playerid][slot][cOn]) return SendClientMessage(playerid, -1"No such item.");
        
format(msgsizeof(msg), "You have dropped your {00FF00}%s{FFFFFF}, and will be no longer available."GetModelName(ClothesInfo[playerid][slot][cModelID]));
        
SendClientMessage(playerid, -1msg);
        
RemoveFromSlot(playeridslot);
    }
    else
    {
        
SendClientMessage(playeridCOLOR_LIGHTRED"Invalid parameter.");
    }
    return 
1;
}
stock ShowClothesDialog(playeridfromslot)
{
    new 
string[2000];
    for(new 
fromslotfromslot NEXT_PAGE_SLOTi++)
    {
        if( 
sizeofModelsInfo ) )
        {
            
format(msgsizeof(msg), "%d - %s - {FFFF00}$%d\n"i+1ModelsInfo[i][modelName], ModelsInfo[i][modelPrice]);
            
strcat(stringmsg);
        }
        if( 
== ( fromslot NEXT_PAGE_SLOT ) - && sizeofModelsInfo ) )
            
strcat(string"{FFFF00}Next Page\n");
    }
    
SetPVarInt(playerid"FromSlot"fromslot);
    
ShowDialog(playeridD_BUY_CLOTHESDIALOG_STYLE_LIST"Select your item"string"Select""Cancel"ON_CLOTHES_BUY);
}
CMD:buyclothes(playeridparams[])
{
    if(
GetPVarInt(playerid"SelectedItem") == 1)
        return 
SendClientMessage(playeridCOLOR_LIGHTRED"Please finish the current operation.");
    
ShowClothesDialog(playerid0);
    return 
1;
}
stock SavePlayerClothes(playerid)
{
    for(new 
0MAX_MODELSi++)
    {
        if(
ClothesInfo[playerid][i][cOn])
        {
            
UpdatePlayerToy(playeridi);
        }
    }
    return 
1;
}
stock UpdatePlayerToy(playeridslot)
{
    
format(querysizeof(query), "UPDATE `clothes` SET `bone` = %d, `offestx` = %f, `offesty` = %f, `offestz` = %f, `rotx` = %f, `roty` = %f, `rotz` = %f, `scalex` = %f, `scaley` = %f, `scalez` = %f WHERE `id` = %d",
    
ClothesInfo[playerid][slot][cBoneID], ClothesInfo[playerid][slot][cOffsetX], ClothesInfo[playerid][slot][cOffsetY], ClothesInfo[playerid][slot][cOffsetZ], ClothesInfo[playerid][slot][cRotX], ClothesInfo[playerid][slot][cRotY], ClothesInfo[playerid][slot][cRotZ], ClothesInfo[playerid][slot][cScaleX], ClothesInfo[playerid][slot][cScaleY], ClothesInfo[playerid][slot][cScaleZ], ClothesInfo[playerid][slot][cID]);
    
mysql_function_query(1queryfalse"""");
    return 
1;
}
stock EditClothing(playeridindex)
{
    if(
GetPVarInt(playerid"EditingNow") == 1) return SendClientMessage(playeridCOLOR_LIGHTRED"Please finish the current operation.");
    
format(msgsizeof(msg), "Editing now your {00FF00}%s{FFFFFF} - Index {00FF00}%d{FFFFFF}."GetModelName(ClothesInfo[playerid][index][cModelID]), index);
    
SendClientMessage(playerid, -1msg);
    
SetPVarInt(playerid"EditingSlot"index);
    
SetPVarInt(playerid"EditingNow"1);
    if(!
IsPlayerAttachedObjectSlotUsed(playeridindex))
    {
        
SetPlayerAttachedObject(playeridindexClothesInfo[playerid][index][cModelID], ClothesInfo[playerid][index][cBoneID], ClothesInfo[playerid][index][cOffsetX], ClothesInfo[playerid][index][cOffsetY], ClothesInfo[playerid][index][cOffsetZ], ClothesInfo[playerid][index][cRotX], ClothesInfo[playerid][index][cRotY], ClothesInfo[playerid][index][cRotZ], ClothesInfo[playerid][index][cScaleX], ClothesInfo[playerid][index][cScaleY], ClothesInfo[playerid][index][cScaleZ]);
    }
    
EditAttachedObject(playeridindex);
    return 
1;
}
stock ReplaceClothing(playeridindex)
{
    
RemovePlayerAttachedObject(playeridindex);
    
SetPlayerAttachedObject(playeridindexClothesInfo[playerid][index][cModelID], ClothesInfo[playerid][index][cBoneID], ClothesInfo[playerid][index][cOffsetX], ClothesInfo[playerid][index][cOffsetY], ClothesInfo[playerid][index][cOffsetZ], ClothesInfo[playerid][index][cRotX], ClothesInfo[playerid][index][cRotY], ClothesInfo[playerid][index][cRotZ], ClothesInfo[playerid][index][cScaleX], ClothesInfo[playerid][index][cScaleY], ClothesInfo[playerid][index][cScaleZ]);
}
stock PlaceClothing(playeridindex)
{
    if(
IsPlayerAttachedObjectSlotUsed(playeridindex))
    {
        
format(msgsizeof(msg), "You have removed your {00FF00}%s{FFFFFF}."GetModelName(ClothesInfo[playerid][index][cModelID]));
        
SendClientMessage(playerid, -1msg);
        
RemovePlayerAttachedObject(playeridindex);
    }
    else
    {
        
format(msgsizeof(msg), "You have placed your {00FF00}%s{FFFFFF}."GetModelName(ClothesInfo[playerid][index][cModelID]));
        
SendClientMessage(playerid, -1msg);
        
SetPlayerAttachedObject(playeridindexClothesInfo[playerid][index][cModelID], ClothesInfo[playerid][index][cBoneID], ClothesInfo[playerid][index][cOffsetX], ClothesInfo[playerid][index][cOffsetY], ClothesInfo[playerid][index][cOffsetZ], ClothesInfo[playerid][index][cRotX], ClothesInfo[playerid][index][cRotY], ClothesInfo[playerid][index][cRotZ], ClothesInfo[playerid][index][cScaleX], ClothesInfo[playerid][index][cScaleY], ClothesInfo[playerid][index][cScaleZ]);
    }
    return 
1;
}
stock DisplayClothing(playerid)
{
    for(new 
0MAX_MODELSi++)
    {
        if(
ClothesInfo[playerid][i][cOn])
        {
            
format(msgsizeof(msg), "%s (Index %d)\n"GetModelName(ClothesInfo[playerid][i][cModelID]), i);
            
strcat(dstrmsg);
        }
        else
        {
            
format(msgsizeof(msg), "EMPTY (Index %d)\n"i);
            
strcat(dstrmsg);
        }
    }
    
ShowDialog(playeridD_CLOTHESDIALOG_STYLE_LIST"Clothes List"dstr"Select""Cancel"ON_CLOTHES_LIST);
    return 
1;
}
stock ShowDialog(playeriddialogidstylecaption[], info[], button1[], button2[], status)
{
    
SetPVarInt(playerid"DialogStatus"status);
    
ShowPlayerDialog(playeriddialogidstylecaptioninfobutton1button2);
    
dstr "";
    return 
1;
}
stock GetModelName(model)
{
    new 
name[64];
    for(new 
0sizeof(ModelsInfo); i++)
    {
        if(
model == ModelsInfo[i][modelID])
        {
            
format(namesizeof(name), "%s"ModelsInfo[i][modelName]);
        }
    }
    return 
name;
}
stock RemoveFromSlot(playeridslot)
{
    
format(querysizeof(query), "DELETE FROM `clothes` WHERE `id` = %d"ClothesInfo[playerid][slot][cID]);
    
mysql_function_query(1querytrue"OnRemoveFromSlot""id"playeridslot);
}
forward OnRemoveFromSlot(playeridslot);
public 
OnRemoveFromSlot(playeridslot)
{
    
ClothesInfo[playerid][slot][cOn] = false;
    
ClothesInfo[playerid][slot][cModelID] = 0;
    
ClothesInfo[playerid][slot][cBoneID] = 0;
    
ClothesInfo[playerid][slot][cOffsetX] = 0.0;
    
ClothesInfo[playerid][slot][cOffsetY] = 0.0;
    
ClothesInfo[playerid][slot][cOffsetZ] = 0.0;
    
ClothesInfo[playerid][slot][cRotX] = 0.0;
    
ClothesInfo[playerid][slot][cRotY] = 0.0;
    
ClothesInfo[playerid][slot][cRotZ] = 0.0;
    
ClothesInfo[playerid][slot][cScaleX] = 0.0;
    
ClothesInfo[playerid][slot][cScaleY] = 0.0;
    
ClothesInfo[playerid][slot][cScaleZ] = 0.0;
    
RemovePlayerAttachedObject(playeridslot);
    return 
1;
}
stock ResetClothes(playerid)
{
    for(new 
0MAX_MODELSi++)
    {
        if(
ClothesInfo[playerid][i][cOn] == true)
        {
            
RemoveFromSlot(playeridi);
        }
    }
}
stock GetName(playerid)
{
    new 
pName[MAX_PLAYER_NAME];
    
GetPlayerName(playeridpNameMAX_PLAYER_NAME);
    return 
pName;
}
stock SyntaxMSG(playeridmessage[])
{
    
format(msgsizeof(msg), "{AFAFAF}USAGE:{FFFFFF} %s"message);
    return 
SendClientMessage(playerid, -1msg);
}
stock GetBoneName(boneid)
{
    new 
bone[64];
    switch(
boneid)
    {
        case 
1bone "Spine";
        case 
2bone "Head";
        case 
3bone "Left upper arm";
        case 
4bone "Right upper arm";
        case 
5bone "Left hand";
        case 
6bone "Right hand";
        case 
7bone "Left thigh";
        case 
8bone "Right thigh";
        case 
9bone "Left foot";
        case 
10bone "Right foot";
        case 
11bone "Right calf";
        case 
12bone "Left calf";
        case 
13bone "Left forearm";
        case 
14bone "Right forearm";
        case 
15bone "Left clavicle (shoulder)";
        case 
16bone "Right clavicle (shoulder)";
        case 
17bone "Neck";
        case 
18bone "Jaw";
    }
    return 
bone;

Reply
#2

UUP UUP UUP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)