Jump to content

Database problem


Recommended Posts

Here is the crap :

  
function anrufen (thePlayer,commandName,Nummer,...) 
    if Nummer then 
        local result = mysql_query(sqlcon,"SELECT Username FROM user_data WHERE Nummer='"..Nummer.."';") 
        if mysql_num_rows( result ) == 1 then 
            row = mysql_fetch_row(result) 
        else 
            outputChatBox( "Fehler!", source ) 
        end 
                mysql_free_result(result) 
  
        local anrufer = tonumber(row[1]) 
  
  
                        outputChatBox("Erfolgreich angerufen!", thePlayer, 255, 255, 0, true) 
                        outputChatBox("#00688B[Anruf] Du wurdest von " .. getPlayerName(thePlayer) .. "#00688B angerufen " , anrufer, 255, 255, 0, true) 
  
        else 
            outputChatBox("Benutzung: /anrufen [NUMMER]", thePlayer, 255, 0, 0, true) 
        return false 
        end 
end 
addCommandHandler("anrufen", anrufen) 

What this crap shall do :

if you type /anrufen [number] this script should get out of the database the name of the player with this number.

Then I should can chat with him. (is not done yet)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...