Hi.
Im making world war server so i need to create players in fast way. Thats why im requesting an talkaction. I made a simple code but its not working :blink:
Im making world war server so i need to create players in fast way. Thats why im requesting an talkaction. I made a simple code but its not working :blink:
Code:
function onSay(cid, words, param)
local name, acc, level, voc, hp, mp, cap
local x = string.explode(param, ",")
name = x[1]
acc = tonumber(x[2])
level = tonumber(x[3])
voc = tonumber(x[4])
if voc == 1 or voc == 2 then
hp = (level-8)*5+185
mp = (level-8)*30+35
cap = (level-8)*10+470
elseif voc == 3 then
hp = (level-8)*10+185
mp = (level-8)*15+35
cap = (level-8)*20+470
elseif voc == 4 then
hp = (level-8)*15+185
mp = (level-8)*5+35
cap = (level-8)*25+470
end
db.executeQuery("INSERT INTO `players` (`name`,`account_id`,`level`,`vocation`,`health`,`healthmax`,`mana`,`manamax`, `town_id`, `cap`) VALUES (".. name ..", ".. acc ..",".. level ..",".. voc ..",".. hp ..",".. hp ..",".. mp ..",".. mp ..",1,".. cap ..")")
return true
end