18.12.2013, 18:48
Quote:
pawn Код:
|
pawn Код:
else if(dialogid == DIALOG_RANDOMS)
{
if(response == 0)
return ShowPlayerDialog(playerid, DIALOG_PARTLIST, DIALOG_STYLE_LIST, "Part Selection", "{FF0000}Grips\n{FF0000}Frames\n{FF0000}Barrels\n{FF0000}Random Packages", "Select", "Cancel");
switch(listitem)
{
case 0://Random Package.
{
new str[128];
if(PlayerMoney[playerid] < 1500)
return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much money.");
GivePlayerMoney(playerid, -1500);
new rand[3];
new randStr[3][25];
for(new i = 0; i < sizeof(rand); i++)
{
rand[i] = random(3);
switch(rand[i])
{
case 0:
{
randStr[i] = "Small Grip";
SGrip[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "SGrip", SGrip[playerid], "accounts");
}
case 1:
{
randStr[i] = "Medium Grip";
MGrip[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "MGrip", MGrip[playerid], "accounts");
}
case 2:
{
randStr[i] = "Large Grip";
LGrip[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "LGrip", LGrip[playerid], "accounts");
}
}
break;
}
format(str, sizeof(str),"You got a {33AA33}%s{FFFFFF}, a {33AA33}%s {FFFFFF}and a {33AA33}%s {FFFFFF}from the package.", randStr[0], randStr[1], randStr[2]);
SendClientMessage(playerid, COLOUR_WHITE, str);
}
case 1://Random Package.
{
if(PlayerMoney[playerid] < 3000)
return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much money.");
GivePlayerMoney(playerid, -3000);
new rand1[3];
new randStr1[3][25];
for(new i = 0; i < sizeof(rand1); i++)
{
rand1[i] = random(3);
switch(rand1[i])
{
case 0:
{
randStr1[i] = "Small Frame";
SFrame[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "SFrame", SFrame[playerid], "accounts");
}
case 1:
{
randStr1[i] = "Medium Frame";
MFrame[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "MFrame", MFrame[playerid], "accounts");
}
case 2:
{
randStr1[i] = "Large Frame";
LFrame[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "LFrame", LFrame[playerid], "accounts");
}
}
break;
}
format(str, sizeof(str),"You got a {33AA33}%s{FFFFFF}, a {33AA33}%s {FFFFFF}and a {33AA33}%s {FFFFFF}from the package.", randStr1[0], randStr1[1], randStr1[2]);
SendClientMessage(playerid, COLOUR_WHITE, str);
}
case 2://Random Package.
{
if(PlayerMoney[playerid] < 2000)
return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much money.");
GivePlayerMoney(playerid, -2000);
PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
new rand2[3];
new randStr2[3][25];
for(new i = 0; i < sizeof(rand2); i++)
{
rand2[i] = random(3);
switch(rand2[i])
{
case 0:
{
randStr2[i] = "Small Barrel";
SBarrel[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "SBarrel", SBarrel[playerid], "accounts");
}
case 1:
{
randStr2[i] = "Medium Barrel");
MBarrel[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "MBarrel", MBarrel[playerid], "accounts");
}
case 2:
{
randStr2[i] = "Large Barrel");
LBarrel[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "LBarrel", LBarrel[playerid], "accounts");
}
}
break;
}
format(str, sizeof(str),"You got a {33AA33}%s{FFFFFF}, a {33AA33}%s {FFFFFF}and a {33AA33}%s {FFFFFF}from the package.", randStr2[0], randStr2[1], randStr2[2]);
SendClientMessage(playerid, COLOUR_WHITE, str);
}
}
}