What's new

Problem ze skryptem onkill

Status
Not open for further replies.

Saperq

User
Joined
Aug 25, 2008
Messages
24
Reaction score
4
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 ?
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
 

keal1

Advanced User
Joined
Dec 8, 2009
Messages
339
Reaction score
21
Odp: Problem ze skryptem onkill

Doda?es zapytanie do bazy danych {SQL}??

Je?eli nie to z tego co widz? musisz doda?

PHP:
CREATE TABLE IF NOT EXISTS `castle_war` (
  `team_1` int(5) NOT NULL,
  `team_2` int(5) NOT NULL,
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 

Saperq

User
Joined
Aug 25, 2008
Messages
24
Reaction score
4
Odp: Problem ze skryptem onkill

Tak, oczywi?cie doda?em. Na podstawie tej tabeli pracuj? te? inne skrypty i idzie im to nienagannie... Przejrza?em skrypt wile razy i nie mog? znale?? ?adnej nie prawid?owo?ci... ;/
 
Status
Not open for further replies.
Top