Jump to content

Dar premios


ReuS

Mensajes recomendados

Seria asi, pero es mejor hacerlo via C++ para que sea mejor (No lo he probado)

Quest:

Spoiler

quest premio begin
state start begin
when 20094.chat."premios" with pc.is_gm() begin
check2 = mysql_query("SELECT index, id_item, cantidad FROM player.premios")
	local datos = select("Acticar(Primero)","Index Mapa(Segundo)","Id items(Tercero)","Cerrar")
	if datos == 1 then
		local activo = select("Si","Terminar","Cerrar")
		if activo == 1 then
		if game.get_event_flag("check")== 1 then
			say("Ya esta activo")
			return end
		game.set_event_flag("check",1)
	elseif activo == 2 then
		game.set_event_flag("check",0)
		mysql_query("DELETE FROM player.premios")
		return end
	elseif datos == 2 then
	say("Escribe el index del mapa")
	local index = tonumber(input())
	if index "" then
		say("error")
		return end
		mysql_query("INSERT INTO player.premios(index) VALUES ('"..index.."'")
		elseif datos == 3 then
		say("Escribe el id del item")
	local ids = tonumber(input())
	if ids "" then
		say("error")
		return end
		mysql_query("INSERT INTO player.premios(id_item) VALUES ('"..ids.."'")
		return
	end
end
	when login with pc.get_map_index()==check2.index[1] and game.get_event_flag("check")== 1 begin
	loop_timer("check3",2)
end
when check3.timer begin
if game.get_event_flag("check")==0 then
	cleartimer("check3")
	pc.setqf("premio",0)
return end
	if pc.getqf("premio")== 1 then
		return end
	pc.give_item2(check2.id_item[1],check2.cantidad[1])
	pc.setqf("premio",1)
end
end
end

 

Sql:

Spoiler

/*
 Navicat MySQL Data Transfer

 Source Server         : SF Akron2
 Source Server Type    : MySQL
 Source Server Version : 50630
 Source Host           : 127.0.0.0:3306
 Source Schema         : player

 Target Server Type    : MySQL
 Target Server Version : 50630
 File Encoding         : 65001

 Date: 27/08/2018 15:07:40
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for premios
-- ----------------------------
DROP TABLE IF EXISTS `premios`;
CREATE TABLE `premios`  (
  `index` int(8) NOT NULL,
  `id_item` int(8) NULL DEFAULT NULL,
  `cantidad` int(8) NULL DEFAULT NULL,
  PRIMARY KEY (`index`) USING BTREE
) ENGINE = MyISAM CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Fixed;

SET FOREIGN_KEY_CHECKS = 1;

 

 

Enlace para comentar
Compartir en otros sitios

  • Dilong locked this tema
Guest
Este tema está cerrado a otras respuestas.
  • Recientemente navegando por este tema   0 miembros

    • No hay usuarios registrados visitando esta página.
×
×
  • Crear nuevo...