Witam,
Napisa?em pewien skrypt, lecz gdy go dodam po zabiciu postaci nie ginie ona lecz znika jej nick oraz pozostaje z 0hp. Czy kto? widzi b??d w tym skrypcie ?
Napisa?em pewien skrypt, lecz gdy go dodam po zabiciu postaci nie ginie ona lecz znika jej nick oraz pozostaje z 0hp. Czy kto? widzi b??d w tym skrypcie ?
Code:
function onKill(cid, target)
local team_1_ = db.getResult("SELECT `team_1`, `team_2` FROM `castle_war` WHERE `done` = 0 LIMIT 1")
local team_1_id = team_1_:getDataInt("team_1")
local team_2_id = team_1_:getDataInt("team_2")
local monster_spawn = {x=1056, y=1065, z=7}
local monster_name = "King"
local status = db.getResult("SELECT `status` FROM `castle`")
local castle_status = status:getDataInt("status")
if isPlayer(cid) == TRUE and isPlayer(target) == TRUE then
local player_1_gid = getPlayerGuildId(cid)
local player_2_gid = getPlayerGuildId(target)
if player_1_gid == team_1_id and player_2_gid == team_2_id and castle_status == 1 then
team2_count = team_2_id - 1
end
if player_1_gid == team_2_id and player_2_gid == team_1_id and castle_status == 1 then
team1_count = team_1_id - 1
end
if team1_count == 0 then
doCreateMonster(monster_name, monster_spawn)
end
if team2_count == 0 then
doCreateMonster(monster_name, monster_spawn)
end
end
return TRUE
end