#Sql
#Quest ;
Mysql Screen ;
King Regards
Mfg HaveBeen™
PHP Code:
/*
Navicat MySQL Data Transfer
Source Server : HaveBeen™
Source Server Version : 50095
Source Host : ---
Source Database : player
Target Server Type : MYSQL
Target Server Version : 50095
File Encoding : 65001
Date: 2013-03-10 11:02:58
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `naturalion`
-- ----------------------------
DROP TABLE IF EXISTS `naturalion`;
CREATE TABLE `naturalion` (
`id` int(50) NOT NULL,
`name` varchar(24) NOT NULL,
`naturalionpoint` int(40) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of naturalion
-- ----------------------------
PHP Code:
--[[
-- Naturalion Point System
-- Quest Writer By : HaveBeen™
]]--
quest naturalion begin
state start begin
function kill()
-- Get Vid
local vid = npc.get_vid()
local a = pc.select(vid)
local name,point = pc.get_name(),game.get_event_flag(pc.get_name().."_point")
pc.select(a)
if(point > 5) then
game.set_event_flag(pc.get_name().."_point",game.get_event_flag(pc.get_name().."_point")+math.floor(point/2))
mysql_query("Update player.naturalion set naturalionpoint = '"..game.get_event_flag(pc.get_name().."_point").."' WHERE name = '"..pc.get_name().."' ")
local b = pc.select(vid)
game.set_event_flag(pc.get_name().."_point",game.get_event_flag(pc.get_name().."_point")-math.floor(game.get_event_flag(pc.get_name().."_point")/2))
mysql_query("Update player.naturalion set naturalionpoint = '"..game.get_event_flag(pc.get_name().."_point").."' WHERE name = '"..pc.get_name().."' ")
pc.select(b)
chat(name.." Got Half The Score ")
chat(" Now Points : : "..game.get_event_flag(pc.get_name().."_point"))
elseif(point >= 1 and point <= 3 or point < 0) then
game.set_event_flag(pc.get_name().."_point",game.get_event_flag(pc.get_name().."_point")+1)
mysql_query("Update player.naturalion set naturalionpoint = '"..game.get_event_flag(pc.get_name().."_point").."' WHERE name = '"..pc.get_name().."' ")
local c = pc.select(vid)
game.set_event_flag(pc.get_name().."_point",game.get_event_flag(pc.get_name().."_point")-1)
mysql_query("Update player.naturalion set naturalionpoint = '"..game.get_event_flag(pc.get_name().."_point").."' WHERE name = '"..pc.get_name().."' ")
pc.select(c)
chat(name.." Get Points ")
chat(" Now Points : : "..game.get_event_flag(pc.get_name().."_point"))
end
end
function Rank()
say_title("Naturalion Point System Rank: ")
say("")
---
local query = mysql_query("SELECT * FROM player.naturalion ORDER BY naturalionpoint desc limit 10")
maxs = table.getn(query)
i = 0
repeat
i = i + 1
say(i..". "..query.name[i].." "..query.naturalionpoint[i])
until i == maxs
end
when login with game.get_event_flag(pc.get_name().."_point") == 0 and pc.getqf("naturalion") != 1 begin
pc.setqf("naturalion",1)
game.set_event_flag(pc.get_name().."_point",game.get_event_flag(pc.get_name().."_point")+2)
mysql_query("INSERT INTO player.naturalion VALUES ('"..pc.get_player_id().."','"..pc.get_name().."','"..game.get_event_flag(pc.get_name().."_point").."' ) ")
end
when kill with npc.is_pc() begin
naturalion.kill()
end
end
end
King Regards
Mfg HaveBeen™