BriGhtx3 Posted May 24, 2011 Posted May 24, 2011 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) Currently working on gamemodes : Reallife Script 70% Breakout Script 10%
Jaysds1 Posted May 24, 2011 Posted May 24, 2011 what is the error message? My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
BriGhtx3 Posted May 24, 2011 Author Posted May 24, 2011 There is not really an error, just it puts out : "Fehler!", "Erfolgreich angerufen!" AND "[Anruf] Du wurdest von " .. getPlayerName(thePlayer) .. " angerufen" Currently working on gamemodes : Reallife Script 70% Breakout Script 10%
Jaysds1 Posted May 24, 2011 Posted May 24, 2011 so what is this again? My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
NeXTreme Posted May 25, 2011 Posted May 25, 2011 If you would like the function to stop executing when the "Fehler!" is outputted, add a return before the end else outputChatBox( "Fehler!", source ) return end Website: http://www.twisted-gamers.net Don't you just love the error messages in LUA?
BriGhtx3 Posted May 25, 2011 Author Posted May 25, 2011 The error is, the message is shown to every player, and not the one with this nmber Currently working on gamemodes : Reallife Script 70% Breakout Script 10%
karlis Posted May 25, 2011 Posted May 25, 2011 use thePlayer, not source. also anrufer var is not permited in outputChatBox [WIP]GTA IV style hud+custom blips + blip text + circular radar areas
BriGhtx3 Posted May 25, 2011 Author Posted May 25, 2011 Yes this is one error. But not the one i am searching for. You see that it puts out Fehler, that means something with the mysql_num_rows is the error. Currently working on gamemodes : Reallife Script 70% Breakout Script 10%
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now