11.08.2013, 19:35
pawn Код:
else if(dialogid == DIALOG_GUNPARTS)
{
if(response == 0)
{
return 1;
}
switch(listitem)
{
case 0:
{
new string[128];
PlayerMoney[playerid] = PlayerMoney[playerid] -300;
GivePlayerMoney(playerid, PlayerMoney[playerid]);
PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
SGrip[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "SGrip", SGrip[playerid], "accounts");
format(string, sizeof(string), "You have purchased a Small Grip, you now have %d", SGrip[playerid]);
SendClientMessage(playerid, COLOUR_WHITE, string);
}
case 1:
{
new string[128];
PlayerMoney[playerid] = PlayerMoney[playerid] -500;
GivePlayerMoney(playerid, PlayerMoney[playerid]);
PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
MGrip[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "MGrip", MGrip[playerid], "accounts");
format(string, sizeof(string), "You have purchased a Medium Grip, you now have %d", MGrip[playerid]);
SendClientMessage(playerid, COLOUR_WHITE, string);
}
case 2:
{
new string[128];
PlayerMoney[playerid] = PlayerMoney[playerid] -750;
GivePlayerMoney(playerid, PlayerMoney[playerid]);
PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
LGrip[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "LGrip", LGrip[playerid], "accounts");
format(string, sizeof(string), "You have purchased a Large Grip, you now have %d", LGrip[playerid]);
SendClientMessage(playerid, COLOUR_WHITE, string);
}
case 3://Random Package.
{
PlayerMoney[playerid] = PlayerMoney[playerid] -2000;
GivePlayerMoney(playerid, PlayerMoney[playerid]);
PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
new rand[3];
new randStr[3][15];
new string[64];
for(new i = 0; i < sizeof rand; i++)
{
rand[i] = random(3);
switch(rand[i])
{
case 0:
{
format(randStr[i], 15, "Small Grip");
SGrip[playerid] ++;
}
case 1:
{
format(randStr[i], 15, "Medium Grip");
MGrip[playerid] ++;
}
case 2:
{
format(randStr[i], 15, "Large Grip");
LGrip[playerid] ++;
}
}
}
format(string, sizeof(string),"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, string);
}
}
}