21.05.2020, 14:51
Yes, it occurs for all weapons. Also, the ids are corrects. It used to work for me yesterday. And no, i don't lose cash.
pawn Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == WeaponShop[0])
{
if(PickupCD[playerid] == 0)
{
new subString[64];
static string[sizeof(WEAPON_SHOP) * sizeof(subString)];
if (string[0] == EOS)
{
for (new i; i < sizeof(WEAPON_SHOP); i++)
{
format(subString, sizeof(subString), "%i\t%s~n~~g~~h~$%i\n", WEAPON_SHOP[i][WEAPON_MODELID], WEAPON_SHOP[i][WEAPON_NAME], WEAPON_SHOP[i][WEAPON_PRICE]);
strcat(string, subString);
}
}
PickupCD[playerid] = 3;
return ShowPlayerDialog(playerid, DIALOG_SHOP, DIALOG_STYLE_PREVIEW_MODEL, "Weapon Shop", string, "Purchase", "Cancel");
}
}
else if(pickupid == WeaponShop[1])
{
if(PickupCD[playerid] == 0)
{
new subString[64];
static string[sizeof(WEAPON_SHOP) * sizeof(subString)];
if (string[0] == EOS)
{
for (new i; i < sizeof(WEAPON_SHOP); i++)
{
format(subString, sizeof(subString), "%i\t%s~n~~g~~h~$%i\n", WEAPON_SHOP[i][WEAPON_MODELID], WEAPON_SHOP[i][WEAPON_NAME], WEAPON_SHOP[i][WEAPON_PRICE]);
strcat(string, subString);
}
}
PickupCD[playerid] = 3;
return ShowPlayerDialog(playerid, DIALOG_SHOP, DIALOG_STYLE_PREVIEW_MODEL, "Weapon Shop", string, "Purchase", "Cancel");
}
}
return 1;
}