Help with clothes system.
#1

Hello everyone, my problem is a command:

When typing / clothes does not appear the dialog to choose my Skin
PHP код:
CMD:clothes(playerid,params[])
{
    if(
gPlayerLogged[playerid] == 0) return SendClientMessage(playeridCOLOR_LIGHTRED"Trebuie sa te loghezi mai intai.");
    if(
IsAtClothShop(playerid))
    {
        if(
PlayerInfo[playerid][pMember] >= && PlayerInfo[playerid][pLeader] == 0)
        {
            if(
IsPlayerConnected(playerid))
            {
                if(
GetPlayerCash(playerid) < 1500) return SCM(playerid,COLOR_WHITE,"{ED2D20}You do not have enough money($1,500).");
                
SBizzInfo[9][sbTill] += 1500;
                
SBizzInfo[9][sbProducts]--;
                
GivePlayerCash(playerid,-1500);
                new 
rand2 random(5);
                
SetPlayerVirtualWorld(playerid,rand2);
                
SetPlayerInterior(playerid,0);
                new 
rand random(sizeof(gInviteSpawns));
                
SetPlayerPos(playeridgInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]); // Warp the player
                
SetPlayerFacingAngle(playeridgInviteSpawns[rand][3]);
                
SetPlayerCameraPos(playerid,gInviteSpawns[rand][0] + 3gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
                
SetPlayerCameraLookAt(playerid,gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
                
TogglePlayerControllable(playerid0);
                
SelectChar[playerid] = 255;
                
SelectCharID[playerid] = PlayerInfo[playerid][pMember];
                
SelectCharPlace[playerid] = 1;
                
PlayerInfo[playerid][pChar] = ChosenSkin[playerid];
                
ShowPlayerDialog(playeridDIALOG_CLOTHESDIALOG_STYLE_MSGBOX,"Clothes:""Press 'Next' to select the clothes.\nPress 'Done' once you have chosen the clothes.","Next""Done");
                
                new 
sendername[25],string[100];
                
GetPlayerName(playerid,sendername,sizeof(sendername));
                
format(stringsizeof(string), "UPDATE users SET Money='%d' WHERE name='%s'"GetPlayerCash(playerid), sendername);
                
mysql_query(SQL,string);
                
format(string,sizeof(string),"UPDATE `sbizz` SET `Till`='%d',`Products`='%d' WHERE `ID`='9'",SBizzInfo[9][sbTill],SBizzInfo[9][sbProducts]);
                
mysql_query(SQL,string);
            }
        }
    }
    else
    {
        
SCM(playerid,COLOR_WHITE,"{ED2D20}You're not the clothing store.");
    }
    return 
1;

and callback


PHP код:
public IsAtClothShop(playerid)
{
    if(
IsPlayerConnected(playerid))
    {
        if(
IsPlayerInRangeOfPoint(playerid50.0,207.5627,-103.7291,1005.2578) || IsPlayerInRangeOfPoint(playerid50.0,203.9068,-41.0728,1001.8047))
        {
//Binco & Suburban
            
return 1;
        }
        else if(
IsPlayerInRangeOfPoint(playerid50.0,214.4470,-7.6471,1001.2109) || IsPlayerInRangeOfPoint(playerid50.0,161.3765,-83.8416,1001.8047) || IsPlayerInRangeOfPoint(playerid50.0,204.2205,-168.3091,1000.5234))
        {
//Zip & Victim
            
return 1;
        }
    }
    return 
0;

And Dialog:
PHP код:
if(dialogid == DIALOG_CLOTHES)
    {
        if(
response)
        {
            switch (
SelectCharID[playerid])
            {
                case 
1// PD
                
{
                    if(
SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid288); SelectCharPlace[playerid] = 2ChosenSkin[playerid] = 288; }
                    else if(
SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid284); SelectCharPlace[playerid] = 3ChosenSkin[playerid] = 284; }
                    else if(
SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid281); SelectCharPlace[playerid] = 4ChosenSkin[playerid] = 281; }
                    else if(
SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid148); SelectCharPlace[playerid] = 5ChosenSkin[playerid] = 148; }
                       else if(
SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid280); SelectCharPlace[playerid] = 6ChosenSkin[playerid] = 280; }
                       else if(
SelectCharPlace[playerid] == 6) { SetPlayerSkin(playerid265); SelectCharPlace[playerid] = 7ChosenSkin[playerid] = 265; }
                       else if(
SelectCharPlace[playerid] == 7) { SetPlayerSkin(playerid267); SelectCharPlace[playerid] = 1ChosenSkin[playerid] = 267; }
                }
                case 
2// FBI
                
{
                    if(
SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid286); SelectCharPlace[playerid] = 2ChosenSkin[playerid] = 286; }
                    else if(
SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid166); SelectCharPlace[playerid] = 3ChosenSkin[playerid] = 166; }
                    else if(
SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid163); SelectCharPlace[playerid] = 4ChosenSkin[playerid] = 163; }
                    else if(
SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid164); SelectCharPlace[playerid] = 5ChosenSkin[playerid] = 164; }
                    else if(
SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid148); SelectCharPlace[playerid] = 5ChosenSkin[playerid] = 148; }
                    else if(
SelectCharPlace[playerid] == 6) { SetPlayerSkin(playerid295); SelectCharPlace[playerid] = 1ChosenSkin[playerid] = 295; }
                }
                case 
3// NG
                
{
                    if(
SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid285); SelectCharPlace[playerid] = 2ChosenSkin[playerid] = 285; }
                    else if(
SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid148); SelectCharPlace[playerid] = 3ChosenSkin[playerid] = 148; }
                    else if(
SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid287); SelectCharPlace[playerid] = 1ChosenSkin[playerid] = 287; }
                }
                case 
4// TRIAD
                
{
                    if(
SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid120); SelectCharPlace[playerid] = 2ChosenSkin[playerid] = 120; }
                    else if(
SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid117); SelectCharPlace[playerid] = 3ChosenSkin[playerid] = 117; }
                    else if(
SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid208); SelectCharPlace[playerid] = 4ChosenSkin[playerid] = 208; }
                    else if(
SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid12); SelectCharPlace[playerid] = 5ChosenSkin[playerid] = 12; }
                    else if(
SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid186); SelectCharPlace[playerid] = 1ChosenSkin[playerid] = 186; }
                }
                case 
5// PORRELLO
                
{
                    if(
SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid3); SelectCharPlace[playerid] = 2ChosenSkin[playerid] = 3; }
                    else if(
SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid123); SelectCharPlace[playerid] = 3ChosenSkin[playerid] = 123; }
                    else if(
SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid121); SelectCharPlace[playerid] = 4ChosenSkin[playerid] = 121; }
                    else if(
SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid122); SelectCharPlace[playerid] = 5ChosenSkin[playerid] = 122; }
                    else if(
SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid291); SelectCharPlace[playerid] = 6ChosenSkin[playerid] = 291; }
                    else if(
SelectCharPlace[playerid] == 6) { SetPlayerSkin(playerid226); SelectCharPlace[playerid] = 1ChosenSkin[playerid] = 226; }
                }
                case 
6// SICILIAN
                
{
                    if(
SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid126); SelectCharPlace[playerid] = 2ChosenSkin[playerid] = 126; }
                    else if(
SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid125); SelectCharPlace[playerid] = 3ChosenSkin[playerid] = 125; }
                    else if(
SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid124); SelectCharPlace[playerid] = 4ChosenSkin[playerid] = 124; }
                    else if(
SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid290); SelectCharPlace[playerid] = 5ChosenSkin[playerid] = 290; }
                    else if(
SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid98); SelectCharPlace[playerid] = 6ChosenSkin[playerid] = 98; }
                    else if(
SelectCharPlace[playerid] == 6) { SetPlayerSkin(playerid169); SelectCharPlace[playerid] = 1ChosenSkin[playerid] = 169; }
                }
                case 
7// PRIMAR
                
{
                    if(
SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid228); SelectCharPlace[playerid] = 1ChosenSkin[playerid] = 228; }
                }
                case 
8// TTC
                
{
                    if(
SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid59); SelectCharPlace[playerid] = 2ChosenSkin[playerid] = 59; }
                    else if(
SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid8); SelectCharPlace[playerid] = 3ChosenSkin[playerid] = 8; }
                    else if(
SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid42); SelectCharPlace[playerid] = 4ChosenSkin[playerid] = 42; }
                    else if(
SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid50); SelectCharPlace[playerid] = 5ChosenSkin[playerid] = 50; }
                    else if(
SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid233); SelectCharPlace[playerid] = 6ChosenSkin[playerid] = 233; }
                    else if(
SelectCharPlace[playerid] == 6) { SetPlayerSkin(playerid268); SelectCharPlace[playerid] = 1ChosenSkin[playerid] = 268; }
                }
                case 
9// NR
                
{
                    if(
SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid147); SelectCharPlace[playerid] = 2ChosenSkin[playerid] = 147; }
                    else if(
SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid187); SelectCharPlace[playerid] = 3ChosenSkin[playerid] = 187; }
                    else if(
SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid188); SelectCharPlace[playerid] = 4ChosenSkin[playerid] = 188; }
                    else if(
SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid90); SelectCharPlace[playerid] = 5ChosenSkin[playerid] = 90; }
                    else if(
SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid17); SelectCharPlace[playerid] = 1ChosenSkin[playerid] = 17; }
                }
                case 
10//RUSIAN
                
{
                    if(
SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid113); SelectCharPlace[playerid] = 2ChosenSkin[playerid] = 113; }
                    else if(
SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid112); SelectCharPlace[playerid] = 3ChosenSkin[playerid] = 112; }
                    else if(
SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid272); SelectCharPlace[playerid] = 4ChosenSkin[playerid] = 272; }
                    else if(
SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid206); SelectCharPlace[playerid] = 5ChosenSkin[playerid] = 206; }
                    else if(
SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid258); SelectCharPlace[playerid] = 6ChosenSkin[playerid] = 258; }
                    else if(
SelectCharPlace[playerid] == 6) { SetPlayerSkin(playerid214); SelectCharPlace[playerid] = 1ChosenSkin[playerid] = 214; }
                }
                case 
11// HITMAN
                
{
                    if(
SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid294); SelectCharPlace[playerid] = 2ChosenSkin[playerid] = 294; }
                    else if(
SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid127); SelectCharPlace[playerid] = 3ChosenSkin[playerid] = 127; }
                    else if(
SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid165); SelectCharPlace[playerid] = 4ChosenSkin[playerid] = 165; }
                    else if(
SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid93); SelectCharPlace[playerid] = 5ChosenSkin[playerid] = 93; }
                    else if(
SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid118); SelectCharPlace[playerid] = 1ChosenSkin[playerid] = 118; }
                }
                case 
12// SI
                
{
                    if(
SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid171); SelectCharPlace[playerid] = 2ChosenSkin[playerid] = 171; }
                    else if(
SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid153); SelectCharPlace[playerid] = 3ChosenSkin[playerid] = 153; }
                    else if(
SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid172); SelectCharPlace[playerid] = 4ChosenSkin[playerid] = 172; }
                    else if(
SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid60); SelectCharPlace[playerid] = 5ChosenSkin[playerid] = 60; }
                    else if(
SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid240); SelectCharPlace[playerid] = 1ChosenSkin[playerid] = 240; }
                }
                case 
13// TAXI
                
{
                    if(
SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid76); SelectCharPlace[playerid] = 2ChosenSkin[playerid] = 76; }
                    else if(
SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid253); SelectCharPlace[playerid] = 3ChosenSkin[playerid] = 253; }
                    else if(
SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid255); SelectCharPlace[playerid] = 4ChosenSkin[playerid] = 255; }
                    else if(
SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid61); SelectCharPlace[playerid] = 1ChosenSkin[playerid] = 61; }
                }
                case 
14// MEDIC
                
{
                    if(
SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid119); SelectCharPlace[playerid] = 2ChosenSkin[playerid] = 119; }
                    else if(
SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid276); SelectCharPlace[playerid] = 3ChosenSkin[playerid] = 276; }
                    else if(
SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid274); SelectCharPlace[playerid] = 4ChosenSkin[playerid] = 274; }
                    else if(
SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid150); SelectCharPlace[playerid] = 5ChosenSkin[playerid] = 150; }
                       else if(
SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid275); SelectCharPlace[playerid] = 1ChosenSkin[playerid] = 275; }
                }
            }
            
ShowPlayerDialog(playeridDIALOG_CLOTHESDIALOG_STYLE_MSGBOX,"Clothes:""Press 'Next' to select the clothes.\nPress 'Done' once you have chosen the clothes.","Next""Done");
        }
        else
        {
            
SetPlayerVirtualWorld(playerid,0);
            
PlayerInfo[playerid][pChar] = GetPlayerSkin(playerid);
            
GetPlayerName(playerid,sendername,sizeof(sendername));
            new 
str[184];
            
format(strsizeof(str), "UPDATE users SET `CChar`='%d' WHERE `name`='%s'"GetPlayerSkin(playerid), sendername);
            
mysql_query(SQL,str);
            
SetSpawnInfo(playeridPlayerInfo[playerid][pTeam], PlayerInfo[playerid][pChar],0.0,0.0,0.0,0,0,0,0,0,0,0);
            
gTeam[playerid] = PlayerInfo[playerid][pTeam];
            
SetPlayerToTeamColor(playerid);
            
SpawnPlayer(playerid);
            
SelectCharPlace[playerid] = 0;
            
SelectCharID[playerid] = 0;
            
SelectChar[playerid] = 0;
        }
        return 
1;
    } 
Reply
#2

Up please
Reply
#3

please help
Reply
#4

hmmm
wait let me check
Reply
#5

https://sampforum.blast.hk/showthread.php?pid=3479555#pid3479555 -> http://forum.sa-mp.com/showpost.php?...55&postcount=6

If you do not get any error message in the chat, then your pMember is not >= 1 and pLeader 0.

Quote:
Originally Posted by dawoodshah
Посмотреть сообщение
hmmm
wait let me check
You are supposed to detect the problem first and if you actually have a solution/answer for it - reply. Your post so far is unneeded (no offence).
Reply
#6

No, I do not get error in game
Reply
#7

@Konstantinos can you help me ?
Reply
#8

I resolved , but now when I look Dialogue Next figure gives me no i choose another skin
Reply
#9

Quote:
Originally Posted by Sn4ke2
Посмотреть сообщение
I resolved , but now when I look Dialogue Next figure gives me no i choose another skin
You mean that you can see the dialog's first page but when you go onto 'Next' so nothing appears and the dialog remains same ?
Reply
#10

Yes, When i press next dialog not give me the next skin, but it's still there. not
disappear
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)