Code:
if (spr == 10 and getPlayerStorageValue(cid, 123321) == -1) then
db.executeQuery('UPDATE `accounts` SET `premium_points` = `premium_points` + 200 WHERE `id` = ' .. account_id .. ';')
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Dostales 200 premium points!")
setPlayerStorageValue(cid, 123321, 1)
end
if (spr == 20 and getPlayerStorageValue(cid, 123421) == -1) then
db.executeQuery('UPDATE `accounts` SET `premium_points` = `premium_points` + 200 WHERE `id` = ' .. account_id .. ';')
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Dostales 200 premium points!")
setPlayerStorageValue(cid, 123421, 1)
end
if (spr == 30 and getPlayerStorageValue(cid, 123621) == -1) then
db.executeQuery('UPDATE `accounts` SET `premium_points` = `premium_points` + 200 WHERE `id` = ' .. account_id .. ';')
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Dostales 200 premium points!")
setPlayerStorageValue(cid, 123621, 1)
end
if (spr == 40 and getPlayerStorageValue(cid, 123821) == -1) then
db.executeQuery('UPDATE `accounts` SET `premium_points` = `premium_points` + 200 WHERE `id` = ' .. account_id .. ';')
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Dostales 200 premium points!")
setPlayerStorageValue(cid, 123821, 1)
end
Próbowałem z forem
Code:
for i=1,10 do
if(spr == 10*i and getPlayerStorageValue(cid, 123321+i) == -1) then
db.executeQuery('UPDATE `accounts` SET `premium_points` = `premium_points` + 200 WHERE `id` = ' .. account_id .. ';')
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Dostales 200 premium points!")
setPlayerStorageValue(cid, 123321+i, 1)
end
end