Jump to content

kimameixede

Inactive Member
  • Posts

    131
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    0%

Posts posted by kimameixede

  1. Spoiler

    quest automex begin
            state start begin
                when letter with pc 
    is_gm ( ) begin
                send_letter 
    "GM Auto Notice" )
            
    end
                when button 
    or info begin
                a 
    select "Enable Auto Message" "Disable Auto Message" "Set Auto Message" "Set time" ,  "Close" )
                    if 
    == 1 then
                        
    if game get_event_flag "auto" ) >= 1 then
                        say 
    "Already active" )
                        else
                        
    say "Auto Message On" )
                        
    game set_event_flag "auto" )
                        
    server_timer "mex" )
                    
    end
                    
    elseif == 2 then
                    say 
    "Auto Message Off" )
                    
    game set_event_flag "auto" )
                    
    clear_server_timer "mex" )
                    
    clear_server_timer "mex1" )
                    elseif 
    == 3 then
                    say 
    "Enter your message" )
                    
    input ( )
                    
    say "Other Message:" )
                    
    input ( )
                    
    say "Other Message:" )
                    
    input ( )
                    elseif 
    == 4 then
                    say 
    "Auto post time:" )
                    
    tonumber(input())
                        if 
    == nil then
                        say 
    "You must enter a number" )
                        elseif 
    1 then
                        say 
    "You must enter a positive number" )
                        else
                        
    select "Seconds" "Minutes" "Hours" )
                            if 
    == 1 then
                            t 
    m
                            
    elseif == 2 then
                            t 
    tonumber(60)
                            elseif 
    == 3 then
                            t 
    tonumber(60 60)
                        
    end
                   end
                end
            end
                when mex
    .server_timer begin
                
    if game.get_event_flag "auto" ) == 1 then
                notice_all 
    ""..)
                if 
    != "" then
                notice_all 
    ""..)
    end
                
    if != "" then
                notice_all 
    ""..)
    end
                server_timer 
    "mex1" )
                else
               
    end
            end
                when mex1
    .server_timer begin
                
    if game get_event_flag "auto" ) == 1 then
                notice_all 
    ""..)
                if 
    != "" then
                notice_all 
    ""..)
    end
                
    if != "" then
                notice_all 
    ""..)
    end
                server_timer 
    "mex" )
                else
                
    end
             end
        end
    end

    Credits to: Superisi

  2. 	int pc_get_empty_inventory_size(lua_State* L)
    	{
    		LPCHARACTER pChar = CQuestManager::instance().GetCurrentCharacterPtr();
    
    		if (lua_isnumber(L, 1) == false){
    			lua_pushboolean(L, false);
    			return 1;
    		}
    
    		int size = (int)lua_tonumber(L, 1);
    		
    		if (pChar != NULL)
    		{
    			int iEmptyCell = pChar->GetEmptyInventory(size);
    
    			if (-1 == iEmptyCell)
    			{
    				lua_pushboolean(L, false);
    				return 1;
    			}
    		
    			lua_pushboolean(L, true);
    		}
    		else
    		{
    			lua_pushboolean(L, false);
    		}
    
    		return 1;
    	}

     

    credits: DragonSlayer

    • Love 1
  3. Hello guys.

     

    What I wanted was that when you arrive at 00:00 the server sent a variable to the client that would be a open window (sorry i use google translate)

    In Server i have something like this:

            function settings()
                local time = os.date ("%H")
                local number = 1
                if time >= "21" then
                    cmdchat("command_name "..number)
                    notice_all("Can open python window")
                elseif time >= "23" then
                    notice_all("Dont Start")
                elseif time >= "24" then
                    notice_all("Dont Start 1")
                end
            end

    ------------------------------------------------------------------

    In Client i have something like this:

    In game:

     

    "command_name"            : self.command_name_python,

     

        def command_name_python(self, number):
            if not self.teste:
                import uitestewindow
                self.teste = uitestewindow.moon()
            self.teste.BuildWindow(number)

    ----------------------------------------------------------------------

    in uitestewindow i have:

        def BuildWindow(self, number):
            self.number = number
            if self.number == 1:
                self.Board = ui.BoardWithTitleBar()
                self.Board.SetSize(80, 66)
                self.Board.SetPosition(1143,70)
                self.Board.SetTitleName('Bónus')
                self.Board.AddFlag('float')
                self.Board.Show()
                self.Button1 = ui.Button()
                self.Button1 .SetParent(self.Board)
                self.Button1 .SetPosition(19, 31)
                self.Button1 .SetUpVisual("d:/ymir work/ui/bonus_noturno/lua1.tga")
                self.Button1 .SetOverVisual("d:/ymir work/ui/bonus_noturno/lua2.tga")
                self.Button1 .SetDownVisual("d:/ymir work/ui/bonus_noturno/lua3.tga")
                self.Button1 .SetText("")
                self.Button1 .SetEvent(self.moon_func)
                self.Button1 .Show()

     

    what i am doing wrong?

     

  4. Hello!

    i need something in quest/lua or in c++ to check if the space in safebox have item.

    if have put the new item in the next free space.

    i try something like this:

    local pos = mysql_query("SELECT * FROM player.item WHERE window='SAFEBOX' and owner_id='"..pc.get_account_id().."' ORDER BY pos ASC")
     local i = 0
    if pos.pos!= nil then
    repeat
    i = i + 1
    until (tonumber(pos.pos))!=(i-1)
    pos = i-1
    else
     pos = 0
    end

    mysql_query("INSERT INTO player.item (owner_id,window,pos,count,vnum) VALUES  ('"..(pc.get_account_id()).."', 'SAFEBOX', '"..(pos).."', '1', '"..(ITEM).."');")

    but unfortunately dont work.

    someone can give help?

    sorry my english is not the best

  5. Hello!

    i need something in quest/lua to check if the space in safebox have item.

    if have put the new item in the next free space.

     

    i try something like this:

    local pos = mysql_query("SELECT * FROM player.item WHERE window='SAFEBOX' and owner_id='"..pc.get_account_id().."' ORDER BY pos ASC")
     local i = 0
    if pos.pos!= nil then
    repeat
    i = i + 1
    until (tonumber(pos.pos))!=(i-1)
    pos = i-1
    else
     pos = 0
    end

    but unfortuly dont work.

    someone can give help?

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.