Jump to content

GameAthar

Inactive Member
  • Posts

    10
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by GameAthar

  1. On 7/1/2020 at 6:45 PM, Syreldar said:
    
    local _, player_search_check = mysql.direct_query(string.format("SELECT name FROM player.player WHERE name = '%s';", player_search));
    if (player_search_check[1] ~= nil) then
    	chat(string.format("Hello %s.", player_search_check[1].name))
    	-- or..
    	chat(string.format("Hello %s.", player_search)) -- Since the name exist and it will be the same.
    else
    	-- Player doesn't exist in the database.
    end -- if/else

     

    I tried the but it does not work, and I don't know why!?

  2. 6 hours ago, Syreldar said:
    
    local _, player_search_check = mysql.direct_query(string.format("SELECT name FROM player.player WHERE name = '%s';", player_search));
    if (player_search_check[1] ~= nil) then
    	-- Player exists in the database.
    else
    	-- Player doesn't exist in the database.
    end -- if/else

     

     

    wow, Now please, how do you i can print in chat or say? 

    chat(" hi "..player_search_check[1]..".")

    I tried to use the old methods of table but it didn't work without table
     

  3. Hello...

    At first I apologize because my language is very bad but I will try to be clear.

     

    I built a Quest that checks the players data but I did not manage to show an error name in the event that the player does not have a name in the "Players" database Now how do I get an error message if a player doesn't have a in the base?

     

    I am using entry () which enables the player to write the player's name and verification has been fetched via the SQL query

     

     

    player_search_check = mysql.direct_query("select name from player.player WHERE name = '"..player_search.."';")
    table.foreachi(player_search_check,function(i,l) 
    	if l[1] == '' then
    		chat(" no player in the table ")
    	else
    		chat(" yes player is in the table ")
    	end
    	
    end)
     
×
×
  • 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.