Jump to content

Tronox

Members
  • Posts

    3
  • Joined

  • Last visited

Tronox's Achievements

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody.

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody. (2/54)

0

Reputation

  1. Hi, when I start my script and write a command (testmeme) it says: [17:57:34] ERROR: Database query failed: no such column: spawn [17:57:34] WARNING: basic.lua: Bad argument @ 'outputChatBox' - Line: 22 Here's my script: function joinHandler() local x = 1959.55 local y = -1714.46 local z = 10 spawnPlayer(source, x, y, z) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox("Welcome to My Server", source) executeSQLCreateTable ( "player", "accountName TEXT, spawn INTEGER" ) end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) function saveMe(player) local x, y, z = getElementPosition (player) pName = getPlayerName(player) executeSQLUpdate ( "player", "spawn = x, y, z", "accountName = pName" ) end addEventHandler ("OnPlayerQuit", getRootElement(), saveMe) function testMe(player) result = executeSQLSelect( "player", "spawn", "accountName= pName") outputChatBox(result, player) end addCommandHandler("testmeme", testMe) Thanks
  2. Tronox

    Chat commands

    Ok, here's the script: function localChat(sender, cmd, ... ) senderName = getPlayerName(sender) tbl_Message = {...} theMessage = table.concat( tbl_Message, " " ) local posX, posY, posZ = getElementPosition( sender ) local chatRadius = 10 local chatSphere = createColSphere( posX, posY, posZ, chatRadius ) local nearbyPlayers = getElementsWithinColShape( chatSphere, "player" ) destroyElement( chatSphere ) for index, nearbyPlayer in ipairs( nearbyPlayers ) do outputChatBox( senderName.. " says: " ..theMessage, nearbyPlayer, 200, 200, 200 ) end end addCommandHandler("b", localChat) And it says: SCRIPT ERROR: ...TA San Andreas/server/mods/deathmatch/resources/Roleplay/server/Chat.lua:33: ')' expected near 'theMessage' [10:44:32] WARNING: Loading script failed: ...TA San Andreas/server/mods/deathmatch/resources/Roleplay/server/Chat.lua:33: ')' expected near 'theMessage' What's wrong with it? EDITED : I edited the code, but it's still not working EDITED: Thanks for your replies, it works
  3. Tronox

    Chat commands

    Hi, I just started learning LUA. I have some simple chat commands (/pm and so), but what I need to do, so only players, that are in radius of x meters could see what i wrote? Thanks
×
×
  • Create New...