-
Posts
2,947 -
Joined
-
Last visited
Everything posted by JR10
-
You already use onClientRender to change the camera matrix, you don't need to detect anything else. Remove the onClientCursorMove part.
-
Use the UNIQUE constraint. It would save you having to check first if it exists.
-
You're redefining count as a local variable inside the while loop, so eventually the count variable never gets edited. You end up with an infinite while loop. Aside from that, you're using the same named variable in all your loops, so they all override their predecessors. I've changed the first count to index, if this doesn't work as you expect, explain further what you're trying to achieve. if source == BuyButton then if guiGridListGetRowCount(Cartlist) > 0 then local index = 0 while index <= guiGridListGetRowCount(Cartlist) do index = index + 1 for count,price in pairs(pricetable) do local totalprice = totalprice + price if count == guiGridListGetRowCount(Cartlist) then if getPlayerMoney(localPlayer) >= totalprice then while count <= guiGridListGetRowCount(Cartlist) do for count,id in pairs(weapontable) do for count,ammo in pairs(ammotable) do triggerServerEvent(localPlayer,"giveweapon",resourceRoot,localPlayer,id,ammo) end end end takePlayerMoney(localPlayer,totalprice) else outputChatBox("You don't have enough money!",localPlayer,255,0,0) end end end end takePlayerMoney(buyer,totalprice) else outputChatBox("You don't have anything in your cart!",255,0,0) end end
-
First of all, do not use executeSQLQuery, it lacks support for callbacks and hangs the whole server till the data is selected. Use the newer db* functions. Primary and foreign keys should work just fine.
-
setVehicleDamageProof
-
-- server local ip = getPlayerIP(player) triggerClientEvent(player, "sendIP", root, ip) --client addEvent("sendIP", true) addEventHandler("sendIP", root, function(ip) end)
-
If the object is a GTA world object, then it's not going to be detected.
-
Use getDistanceBetweenPoints2D/3D and then do some calculations.
-
They also provided a tool to export to GitHub.
-
db* functions are not slower in any way, so "speed" shouldn't be a problem. It's generally better that you create a private local database to the resources folder. Good luck.
-
If there is only one row returned then the table returned should look something like this: returned_tabke = { [1] = { ["rank"] = "RANK" } } Why are you still using executeSQLQuery? Use dbQuery instead.
-
Search here: https://community.multitheftauto.com/
-
You're using 'player' instead of 'thePlayer'. function Team( thePlayer ) local acc = getPlayerAccount(thePlayer) if (isGuestAccount(acc)) then outputChatBox("You're not logged in", thePlayer) return end local accName = getAccountName(acc) if isObjectInACLGroup ( "user." ..accName, aclGetGroup ( "Admin") ) then local team = getTeamFromName("Admins") if (not team) then outputChatBox("The team doesn't exist", thePlayer) return end setPlayerTeam ( thePlayer, team) else outputChatBox("You're not an admin", thePlayer) end end addCommandHandler ( "oduty", Team )
-
Do you login after reconnecting?
-
If the team's name is "Admins" then: function Team( thePlayer ) local accName = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup ( "user." ..accName, aclGetGroup ( "Admin") ) then setPlayerTeam ( thePlayer, getTeamFromName("Admins")) end end addCommandHandler ( "oduty", Team )
-
I already told you, is Admins defined?
-
The obvious error is that Admins is not defined. Aside from that, you're missing the admin check code. function Team( thePlayer ) local accName = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup ( "user." ..accName, aclGetGroup ( "Admin") ) then setPlayerTeam ( thePlayer, Admins ) end end addCommandHandler ( "oduty", Team )
-
One of the few (probably the best looking) house systems on the community: https://community.multitheftauto.com/index.php?p= ... ils&id=727 It's all user interface, no commands. You don't really need a tutorial to use it. Additional information can be found here: viewtopic.php?f=108&t=27571&p=309989#p309989
-
Based on your code, you're retrieving the team as soon as the script starts, the team will probably not have been created by then. If the team is created in the same resource then, move the getTeamFromName line to onResourceStart. If not, you might want to delay the bot creation till the team is created.
-
Is there a code that logs the player in as soon as he joined (auto login)? If not, then it's impossible that he will be logged in immediately on join. Perhaps you need to change onPlayerJoin to onPlayerLogin.
-
http://lua-users.org/wiki/LuaTutorial http://www.lua.org/pil/contents.html
-
Does mailsended get called? Are you sure you uploaded the mta_sdk.php file and it's in the same directory? Try to debug the php file by running it from the browser.
-
No. If nothing is missing the post your full code. You said that email_text and http_url are defined, where are the rest of the variables?
-
If you want to learn more about SQL and databases then I suggest you Google first what SQL is and view some simple examples. You could also take a look at my tutorial: viewtopic.php?f=148&t=38203
-
All you need for sendMailTo to work is to host both the mta_sdk.php file and the send.php file that is provided in the wiki page. After you upload both files to your host, just update the link in callRemote to your website address. Your server-side code is missing (if it's just that line), you need to define the EMailAccepted callback and any missing variable.