TFS 0.X bless script problem

vexler222

Member
Joined
Apr 22, 2012
Messages
268
Reaction score
6
Hi, i have problem with bless command, cuz if i die with bless, my level going down to 1 ;/

Code:
--- Created for otsmateria.com (c)----

-- !bless by Piotrek1447
-- edited by Kleksu
local bless = {1, 2, 3, 4, 5}
local cost = 100000 -- Cost in gp.
function onSay(cid, words, param)
if(not checkExhausted(cid, 646, 6)) then
    return true
end
    for i = 1, table.maxn(bless) do
        if(getPlayerBlessing(cid, bless[i])) then
            doPlayerSendCancel(cid, "You have already all blessings.")
            return TRUE
        end
    end
    if(doPlayerRemoveMoney(cid, cost) == TRUE) then
        for i = 1, table.maxn(bless) do
            doPlayerAddBlessing(cid, bless[i])
        end
        doPlayerSendTextMessage(cid,24, "You bought all blessing.")
        doSendMagicEffect(getPlayerPosition(cid), 39)
    else
        doPlayerSendCancel(cid, "You don't have enough money.")
    end
    return TRUE
end
 

Sarah Wesker

ค∂vαηcε รүηтαx ❤
Joined
Mar 16, 2017
Messages
356
Reaction score
165
Location
London
.1) change the configuration of the variable
Code:
deathLosePercent
on config.lua
 
OP
V

vexler222

Member
Joined
Apr 22, 2012
Messages
268
Reaction score
6
test with (10) or (-1)
not work, and now i have it in console

Code:
mysql_real_query(): UPDATE `players` SET `lastlogin` = 1538510523, `lastip` = 400010605, `level` = 15, `group_id` = 1, `health` = 255, `healthmax` = 255, `experience` = 39000, `lookbody` = 68, `lookfeet` = 76, `lookhead` = 78, `looklegs` = 58, `looktype` = 128, `lookaddons` = 0, `maglevel` = 0, `mana` = 210, `manamax` = 210, `manaspent` = 1600, `soul` = 99, `town_id` = 1, `posx` = 1053, `posy` = 1092, `posz` = 7, `cap` = 610, `sex` = 1, `balance` = 0, `stamina` = 151200000, `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '\0 \0\0������\0\Z\0\0\0\00\0\0\[email protected]\0\0\0\0\0�\0\0\0\0\0�\0\0\0����<s\0\0\Z\0\0\0\00\0\0\0�\0\0�\0����0u\0\0\Z\0\0\0\00\0\0\0�\[email protected]\0\0������\0\Z\0\0\0\00\0\0\0\0\0\0��\0�', `loss_experience` = 4294967286, `loss_mana` = 0, `loss_skills` = 0, `loss_containers` = 100, `loss_items` = 100, `lastlogout` = 1538494900, `blessings` = 0, `marriage` = 0, `guildnick` = '', `rank_id` = 0, `vocation` = 3 WHERE `id` = 8 LIMIT 1; - MYSQL ERROR: Out of range value for column 'loss_experience' at row 1 (1264)
[22:2:35.625] mysql_real_query(): UPDATE `players` SET `lastlogin` = 1538510523, `lastip` = 400010605, `level` = 15, `group_id` = 1, `health` = 255, `healthmax` = 255, `experience` = 39000, `lookbody` = 68, `lookfeet` = 76, `lookhead` = 78, `looklegs` = 58, `looktype` = 128, `lookaddons` = 0, `maglevel` = 1, `mana` = 150, `manamax` = 210, `manaspent` = 0, `soul` = 99, `town_id` = 1, `posx` = 1246, `posy` = 1127, `posz` = 6, `cap` = 610, `sex` = 1, `balance` = 0, `stamina` = 151185500, `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '\0 \0\0����8�\0\Z\0\0\0\00\0\0\[email protected]\0\0\0\0\0�\0\0\0\0\0�\0\0\0�����<\0\0\Z\0\0\0\00\0\0\0�\0\0�\0�����<\0\0\Z\0\0\0\00\0\0\0�\[email protected]\0\0�����p\0\Z\0\0\0\00\0\0\0\0\0\0��\0�\0\0\0�����\0\0\Z\0\0\0\0\0\0\0�\0\0 \0�����\0\0\Z\0\0\0\00\0\0\0�\0\0\0�����\0\0\Z\0\0\0\0\0\0\0�', `loss_experience` = 4294967286, `loss_mana` = 0, `loss_skills` = 0, `loss_containers` = 100, `loss_items` = 100, `lastlogout` = 1538494900, `blessings` = 0, `marriage` = 0, `guildnick` = '', `rank_id` = 0, `vocation` = 3 WHERE `id` = 8 LIMIT 1; - MYSQL ERROR: Out of range value for column 'loss_experience' at row 1 (1264)
[22:2:35.626] mysql_real_query(): UPDATE `players` SET `lastlogin` = 1538510523, `lastip` = 400010605, `level` = 15, `group_id` = 1, `health` = 255, `healthmax` = 255, `experience` = 39000, `lookbody` = 68, `lookfeet` = 76, `lookhead` = 78, `looklegs` = 58, `looktype` = 128, `lookaddons` = 0, `maglevel` = 2, `mana` = 150, `manamax` = 210, `manaspent` = 0, `soul` = 99, `town_id` = 1, `posx` = 1246, `posy` = 1127, `posz` = 6, `cap` = 610, `sex` = 1, `balance` = 0, `stamina` = 151185500, `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '\0 \0\0����8�\0\Z\0\0\0\00\0\0\[email protected]\0\0\0\0\0�\0\0\0\0\0�\0\0\0�����<\0\0\Z\0\0\0\00\0\0\0�\0\0�\0�����<\0\0\Z\0\0\0\00\0\0\0�\[email protected]\0\0�����p\0\Z\0\0\0\00\0\0\0\0\0\0��\0�\0\0\0�����\0\0\Z\0\0\0\0\0\0\0�\0\0 \0�����\0\0\Z\0\0\0\00\0\0\0�\0\0\0�����\0\0\Z\0\0\0\0\0\0\0�', `loss_experience` = 4294967286, `loss_mana` = 0, `loss_skills` = 0, `loss_containers` = 100, `loss_items` = 100, `lastlogout` = 1538494900, `blessings` = 0, `marriage` = 0, `guildnick` = '', `rank_id` = 0, `vocation` = 3 WHERE `id` = 8 LIMIT 1; - MYSQL ERROR: Out of range value for column 'loss_experience' at row 1 (1264)

i tested with -1, 10, 100 and everytime, console print this error
 

SkeybaOTS

New Member
Joined
Oct 1, 2018
Messages
10
Reaction score
0
function onSay(cid, words, param)

if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then

doPlayerSendCancel(cid,'You aleready have bless!')

else

if doPlayerRemoveMoney(cid, 50000) == TRUE then

doPlayerAddBlessing(cid, 1)

doPlayerAddBlessing(cid, 2)

doPlayerAddBlessing(cid, 3)

doPlayerAddBlessing(cid, 4)

doPlayerAddBlessing(cid, 5)

doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)

doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,''You has been blessed by gods.')

else

doPlayerSendCancel(cid, "You need 50k to get blessed!")

end

end

return 1

end
 
OP
V

vexler222

Member
Joined
Apr 22, 2012
Messages
268
Reaction score
6
function onSay(cid, words, param)

if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then

doPlayerSendCancel(cid,'You aleready have bless!')

else

if doPlayerRemoveMoney(cid, 50000) == TRUE then

doPlayerAddBlessing(cid, 1)

doPlayerAddBlessing(cid, 2)

doPlayerAddBlessing(cid, 3)

doPlayerAddBlessing(cid, 4)

doPlayerAddBlessing(cid, 5)

doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)

doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,''You has been blessed by gods.')

else

doPlayerSendCancel(cid, "You need 50k to get blessed!")

end

end

return 1

end
not work ;/ still i get first level
 
Top