10.06.2015, 13:30
Hello everyone, my problem is a command:
When typing / clothes does not appear the dialog to choose my Skin
and callback
And Dialog:
When typing / clothes does not appear the dialog to choose my Skin
PHP код:
CMD:clothes(playerid,params[])
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te loghezi mai intai.");
if(IsAtClothShop(playerid))
{
if(PlayerInfo[playerid][pMember] >= 1 && 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(playerid, gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]); // Warp the player
SetPlayerFacingAngle(playerid, gInviteSpawns[rand][3]);
SetPlayerCameraPos(playerid,gInviteSpawns[rand][0] + 3, gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
SetPlayerCameraLookAt(playerid,gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
TogglePlayerControllable(playerid, 0);
SelectChar[playerid] = 255;
SelectCharID[playerid] = PlayerInfo[playerid][pMember];
SelectCharPlace[playerid] = 1;
PlayerInfo[playerid][pChar] = ChosenSkin[playerid];
ShowPlayerDialog(playerid, DIALOG_CLOTHES, DIALOG_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(string, sizeof(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;
}
PHP код:
public IsAtClothShop(playerid)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid, 50.0,207.5627,-103.7291,1005.2578) || IsPlayerInRangeOfPoint(playerid, 50.0,203.9068,-41.0728,1001.8047))
{//Binco & Suburban
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 50.0,214.4470,-7.6471,1001.2109) || IsPlayerInRangeOfPoint(playerid, 50.0,161.3765,-83.8416,1001.8047) || IsPlayerInRangeOfPoint(playerid, 50.0,204.2205,-168.3091,1000.5234))
{//Zip & Victim
return 1;
}
}
return 0;
}
PHP код:
if(dialogid == DIALOG_CLOTHES)
{
if(response)
{
switch (SelectCharID[playerid])
{
case 1: // PD
{
if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, 288); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = 288; }
else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, 284); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = 284; }
else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, 281); SelectCharPlace[playerid] = 4; ChosenSkin[playerid] = 281; }
else if(SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid, 148); SelectCharPlace[playerid] = 5; ChosenSkin[playerid] = 148; }
else if(SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid, 280); SelectCharPlace[playerid] = 6; ChosenSkin[playerid] = 280; }
else if(SelectCharPlace[playerid] == 6) { SetPlayerSkin(playerid, 265); SelectCharPlace[playerid] = 7; ChosenSkin[playerid] = 265; }
else if(SelectCharPlace[playerid] == 7) { SetPlayerSkin(playerid, 267); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = 267; }
}
case 2: // FBI
{
if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, 286); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = 286; }
else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, 166); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = 166; }
else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, 163); SelectCharPlace[playerid] = 4; ChosenSkin[playerid] = 163; }
else if(SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid, 164); SelectCharPlace[playerid] = 5; ChosenSkin[playerid] = 164; }
else if(SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid, 148); SelectCharPlace[playerid] = 5; ChosenSkin[playerid] = 148; }
else if(SelectCharPlace[playerid] == 6) { SetPlayerSkin(playerid, 295); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = 295; }
}
case 3: // NG
{
if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, 285); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = 285; }
else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, 148); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = 148; }
else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, 287); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = 287; }
}
case 4: // TRIAD
{
if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, 120); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = 120; }
else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, 117); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = 117; }
else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, 208); SelectCharPlace[playerid] = 4; ChosenSkin[playerid] = 208; }
else if(SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid, 12); SelectCharPlace[playerid] = 5; ChosenSkin[playerid] = 12; }
else if(SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid, 186); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = 186; }
}
case 5: // PORRELLO
{
if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, 3); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = 3; }
else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, 123); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = 123; }
else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, 121); SelectCharPlace[playerid] = 4; ChosenSkin[playerid] = 121; }
else if(SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid, 122); SelectCharPlace[playerid] = 5; ChosenSkin[playerid] = 122; }
else if(SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid, 291); SelectCharPlace[playerid] = 6; ChosenSkin[playerid] = 291; }
else if(SelectCharPlace[playerid] == 6) { SetPlayerSkin(playerid, 226); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = 226; }
}
case 6: // SICILIAN
{
if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, 126); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = 126; }
else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, 125); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = 125; }
else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, 124); SelectCharPlace[playerid] = 4; ChosenSkin[playerid] = 124; }
else if(SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid, 290); SelectCharPlace[playerid] = 5; ChosenSkin[playerid] = 290; }
else if(SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid, 98); SelectCharPlace[playerid] = 6; ChosenSkin[playerid] = 98; }
else if(SelectCharPlace[playerid] == 6) { SetPlayerSkin(playerid, 169); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = 169; }
}
case 7: // PRIMAR
{
if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, 228); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = 228; }
}
case 8: // TTC
{
if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, 59); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = 59; }
else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, 8); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = 8; }
else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, 42); SelectCharPlace[playerid] = 4; ChosenSkin[playerid] = 42; }
else if(SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid, 50); SelectCharPlace[playerid] = 5; ChosenSkin[playerid] = 50; }
else if(SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid, 233); SelectCharPlace[playerid] = 6; ChosenSkin[playerid] = 233; }
else if(SelectCharPlace[playerid] == 6) { SetPlayerSkin(playerid, 268); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = 268; }
}
case 9: // NR
{
if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, 147); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = 147; }
else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, 187); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = 187; }
else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, 188); SelectCharPlace[playerid] = 4; ChosenSkin[playerid] = 188; }
else if(SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid, 90); SelectCharPlace[playerid] = 5; ChosenSkin[playerid] = 90; }
else if(SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid, 17); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = 17; }
}
case 10: //RUSIAN
{
if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, 113); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = 113; }
else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, 112); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = 112; }
else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, 272); SelectCharPlace[playerid] = 4; ChosenSkin[playerid] = 272; }
else if(SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid, 206); SelectCharPlace[playerid] = 5; ChosenSkin[playerid] = 206; }
else if(SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid, 258); SelectCharPlace[playerid] = 6; ChosenSkin[playerid] = 258; }
else if(SelectCharPlace[playerid] == 6) { SetPlayerSkin(playerid, 214); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = 214; }
}
case 11: // HITMAN
{
if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, 294); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = 294; }
else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, 127); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = 127; }
else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, 165); SelectCharPlace[playerid] = 4; ChosenSkin[playerid] = 165; }
else if(SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid, 93); SelectCharPlace[playerid] = 5; ChosenSkin[playerid] = 93; }
else if(SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid, 118); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = 118; }
}
case 12: // SI
{
if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, 171); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = 171; }
else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, 153); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = 153; }
else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, 172); SelectCharPlace[playerid] = 4; ChosenSkin[playerid] = 172; }
else if(SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid, 60); SelectCharPlace[playerid] = 5; ChosenSkin[playerid] = 60; }
else if(SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid, 240); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = 240; }
}
case 13: // TAXI
{
if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, 76); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = 76; }
else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, 253); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = 253; }
else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, 255); SelectCharPlace[playerid] = 4; ChosenSkin[playerid] = 255; }
else if(SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid, 61); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = 61; }
}
case 14: // MEDIC
{
if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, 119); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = 119; }
else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, 276); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = 276; }
else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, 274); SelectCharPlace[playerid] = 4; ChosenSkin[playerid] = 274; }
else if(SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid, 150); SelectCharPlace[playerid] = 5; ChosenSkin[playerid] = 150; }
else if(SelectCharPlace[playerid] == 5) { SetPlayerSkin(playerid, 275); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = 275; }
}
}
ShowPlayerDialog(playerid, DIALOG_CLOTHES, DIALOG_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(str, sizeof(str), "UPDATE users SET `CChar`='%d' WHERE `name`='%s'", GetPlayerSkin(playerid), sendername);
mysql_query(SQL,str);
SetSpawnInfo(playerid, PlayerInfo[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;
}