Jump to content

Nightmare12

Members
  • Posts

    12
  • Joined

  • Last visited

Everything posted by Nightmare12

  1. Karthik, thanks very much, now i know what do in issues like this. Thanks again I fix friends by remove mysql:escape_string in booleans (ID itp) - thats make error, in SAMP there is no situations like this
  2. I know what are scripting, but Im newbie in Lua Before I make script for SAMP around one year,
  3. Yes you're right, thats why I ask in first post for a function or the way how do it (or something like this - habits from Pawn and SAMP) not for code prepared by You. I want learn, not have script.
  4. I want to learn LUA on RP script, thats why I ask on this forum. Friends: addEvent( "social:message", true ) addEventHandler( "social:message", root, function( message ) local accountID = getElementData( client, "account:id" ) if accountID and friends[ accountID ] then [u][b] if mysql:query_free("UPDATE accounts SET friendsmessage = '" .. mysql:escape_string(message) .. "' WHERE id = " .. mysql:escape_string(accountID) ) then[/u][/b] friends[ accountID ].message = message notifyFriendsOf( client, accountID, "social:message", message ) triggerClientEvent( client, "social:message", client, accountID, message ) end end end ) lses: function playerDeath(totalAmmo, killer, killerWeapon) ...(anothercode)... local affected = { } table.insert(affected, source) local killstr = ' died' if (killer) then [u][b]killstr = ' got killed by '..getPlayerName(killer).. ' ('..getWeaponNameFromID ( killerWeapon )..')'[/b][/u] table.insert(affected, killer) end
  5. I have problem with boolean, I think I must convert this to string, right? Whats function do this? [2012-06-26 19:28:53] ERROR: social-system/s_friends.lua:203: attempt to concatenate a boolean value [2012-06-26 19:44:04] ERROR: lses-system/s_lves_system.lua:26: attempt to concatenate a boolean value
  6. addEventHandler("accounts:characters:spawn", getRootElement(), spawnCharacter) function spawnCharacter(characterID) ...(another code)... exports.global:checkMoneyHacks(client) ...(another code)... And code with error is in posts above
  7. I use function above with this code: exports.global:checkMoneyHacks(client) When char spawn
  8. Thanks, it work But what was make this issue? I want to now for the future
  9. I have problem with this: function getMoney(thePlayer, nocheck) if not nocheck then checkMoneyHacks(thePlayer) end [u][b][132]return getElementData(thePlayer, "money") or 0[/b][/u] end function checkMoneyHacks(thePlayer) [u][b][136]if not getMoney(thePlayer, true) or getElementType(thePlayer) ~= "player" then return end[/b][/u] local safemoney = getMoney(thePlayer, true) local hackmoney = getPlayerMoney(thePlayer) if (safemoney < hackmoney) then setPlayerMoney(thePlayer, safemoney) sendMessageToAdmins("Possible money hack detected: "..getPlayerName(thePlayer)) return true else return false end end My warring is: [11:00:27] WARNING: global/s_money_globals.lua:132: Bad argument @ 'getElementDa ta' [Expected element at argument 1, got boolean] [11:00:27] WARNING: global/s_money_globals.lua:136: Bad argument @ 'getElementTy pe' [11:00:27] WARNING: global/s_money_globals.lua:132: Bad argument @ 'getElementDa ta' [Expected element at argument 1, got boolean] Whats wrong?
  10. -- load JSON from file function loadJSONData( filename ) local file = fileExists( filename ) and fileOpen( filename, true ) or fileCreate( filename ) local str = fileRead( file, fileGetSize( file ) or 0 ) local t = fromJSON( str ) or {resolution = {}} fileClose( file ) return t end It's all code of function
  11. Hi, i have problem with fileGetSize and fileRead. I have this code: local str = fileRead( file, fileGetSize ( file ) or 0 ) And i have error Bad 'number' pointer @ 'fileRead'(2) Whats wrong with this?
×
×
  • Create New...