Investor
Members-
Posts
111 -
Joined
-
Last visited
Everything posted by Investor
-
function sendMail(to, from, title, body) local function callbackfnc(result, msg) outputDebugString("callbackfnc: " .. result .. " (" .. msg .. ")") end callRemote("https://domain.tld/path/to/file.php", callbackfnc, to, from, title, body) end <?php include("mta_sdk.php"); if ($_SERVER['SERVER_ADDR'] != $_SERVER['REMOTE_ADDR']) { mta::doReturn(-1, "Remote access not allowed"); exit; } $input = mta::getInput(); if ( isset($input[0]) && isset($input[1]) && isset($input[2]) && isset($input[3]) ) { $to = $input[0]; $from = $input[1]; $subject = $input[2]; $message = $input[3]; $headers = "From: " . $input[1]; mail($to, $subject, $message, $headers); mta::doReturn(0, "Success"); } else { mta::doReturn(-1, "Invalid input"); } ?> And you need the PHP SDK (mta_sdk.php file) downloadable here: http://code.opencoding.net/mta/mtaphpsdk_0.4.zip This does not filter against malicious inputs, so make sure you never callRemote to the PHP file with unsanitised user input, or even better, don't use user input at all if possible (except the to email address I suppose)
-
What do you mean? This is pretty basic math. If s is the width of the screen in pixels, say, 1920px, then 320×1920 would be placed 614,400 pixels to the right of the screen's left edge (origin is top-left corner), where the screen only has 1920 pixels. Goes beyond the viewable area by 320 lengths of the screen. The wiki page for dxDrawImage clearly states that the first parameter is the X position, that is, how many pixels from the left edge should it be displayed.
-
dxDrawImage(s*320,y*0.9,s*0.017,y*34.285, "img/map.png", 0, 0, 0, tocolor(0,102,255,255*alpha), false) That's because s*320 is way outside the viewable area. Indeed, it's placed, 320 times the screen width, to the left. The value you multiply by should be a float between 0 and 1.
-
There's the bone_attach resource and you can attach any object - so you can replace some model with glasses and attach them to the head bone.
- 1 reply
-
- 1
-
HLSL literally stands for High Level Shader Language. HLSL is in no way exclusive to animated textures - static textures are also applied via a HLSL shader.
-
-- buy_c.lua:31-36 @@ function buyDrugs() -- here baretaEdit refers to a gui-element baretaEdit = tonumber(guiGetText(baretaEdit)) -- now baretaEdit refers to a number popperEdit = tonumber(guiGetText(popperEdit)) pericaEdit = tonumber(guiGetText(pericaEdit)) lsdEdit = tonumber(guiGetText(lsdEdit)) bazukoEdit = tonumber(guiGetText(bazukoEdit)) heroinaEdit = tonumber(guiGetText(heroinaEdit)) These lines override the original variables, thus each variable, e.g. baretaEdit, stops being a gui element and becomes the tonumber'd text of the input, and on all subsequent calls to guiGetText, you're passing a number rather than a gui-element. You should prepend these variable assignments with the local keyword, so that these changes are only visible within the scope of the buyDrugs() function. -- buy_c.lua:31-36 @@ function buyDrugs() -- here baretaEdit refers to a gui-element local baretaEdit = tonumber(guiGetText(baretaEdit)) -- here the original baretaEdit is inaccessible directly, and the new baretaEdit refers -- the number inputted in the gui-element (this new baretaEdit falls out of scope when -- the function exists and is not accessible elsewhere, and doesn't override the -- original's value which remains a gui-element and can be accessed using _G["baretaEdit"] -- (_G is a table of global variables) local popperEdit = tonumber(guiGetText(popperEdit)) local pericaEdit = tonumber(guiGetText(pericaEdit)) local lsdEdit = tonumber(guiGetText(lsdEdit)) local bazukoEdit = tonumber(guiGetText(bazukoEdit)) local heroinaEdit = tonumber(guiGetText(heroinaEdit)) This technically doesn't override the value, but the reference to the variable itself. That is, the original variable still exists, it's only inaccessible because a newer one has been created and is in this scope. As a followup, I'd like to point out that a better way to do this -- buy_c.lua:43-49 @@ function buyDrugs() setElementData(getLocalPlayer(),"baretaBuyQty", baretaEdit) setElementData(getLocalPlayer(),"popperBuyQty", popperEdit) setElementData(getLocalPlayer(),"pericaBuyQty", pericaEdit) setElementData(getLocalPlayer(),"lsdBuyQty", lsdEdit) setElementData(getLocalPlayer(),"bazukoBuyQty", bazukoEdit) setElementData(getLocalPlayer(),"heroinaBuyQty", heroinaEdit) triggerServerEvent("sBuyDrugs",getLocalPlayer()) -- server.lua:30-42 @@ function serverBuyDrugs() function serverBuyDrugs() local sellerPointer = getElementData(client, "seller") if tonumber(getElementData(sellerPointer, "bQty")) >= tonumber(getElementData(client,"baretaBuyQty")) then setElementData(sellerPointer,"bQty", tonumber(getElementData(sellerPointer,"bQty"))-tonumber(getElementData(client,"baretaBuyQty"))) setElementData(client,"Weed",tonumber(getElementData(client,"Weed"))+tonumber(getElementData(client,"baretaBuyQty"))) givePlayerMoney(sellerPointer, tonumber(getElementData(sellerPointer,"bPrice"))*tonumber(getElementData(client,"baretaBuyQty"))) setPlayerMoney(client, getPlayerMoney(client) - tonumber(getElementData(sellerPointer,"bPrice"))*tonumber(getElementData(client,"baretaBuyQty"))) else return outputChatBox("El usuario no posee tal cantidad de bareta",client) end end addEvent( "sBuyDrugs", true ) addEventHandler("sBuyDrugs", root , serverBuyDrugs) is to use event parameters -- buy_c.lua:43-49 @@ function buyDrugs() triggerServerEvent("sBuyDrugs",getLocalPlayer(), baretaEdit, popperEdit, popperEdit, pericaEdit, lsdEdit, bazukoEdit, heroinaEdit) -- server.lua:30-42 @@ function serverBuyDrugs() function serverBuyDrugs(baretaQty, popperQty, pericaQty, lsdQty, bazukoQty, heroinaQty) if client then else return false end -- this line aborts the execution of the function if 'client' variable isn't set, that is, the event was faked, and not sent from an actual client local sellerPointer = getElementData(client, "seller") if tonumber(getElementData(sellerPointer, "bQty")) >= baretaQty then setElementData(sellerPointer,"bQty", tonumber(getElementData(sellerPointer,"bQty"))-baretaQty) setElementData(client,"Weed",tonumber(getElementData(client,"Weed"))+baretaQty) givePlayerMoney(sellerPointer, tonumber(getElementData(sellerPointer,"bPrice"))*baretaQty) setPlayerMoney(client, getPlayerMoney(client) - tonumber(getElementData(sellerPointer,"bPrice"))*baretaQty) else return outputChatBox("El usuario no posee tal cantidad de bareta",client) end end addEvent( "sBuyDrugs", true ) addEventHandler("sBuyDrugs", root , serverBuyDrugs) As an additional notice, you should never trust a client - add additional protections like ensuring that the seller is indeed selling drugs at the time a request to "take away his stuff and give it to me for the agreed price" is made.
-
Try typing ver in the F8 client console and see if you're on r12195 which is where custom IFP support was added. If not, you're probably doing something wrong when updating MTA, perhaps you have multiple installations and you update the wrong one?
-
"And no script made on MTA or SAMP is copyrighted/trademarked as the one who would hold that is Rockstar Games since this is their platform. So technically under international law, nobody owns anything here. Rockstar does. Just a small course in how the law works." As far as I am aware, just because you paint a picture in someone's garage doesn't make it the garage owner's picture. The author of a piece of code has the copyrights in all cases except when that author is doing the piece of code for his employer who is paying him for his work.
-
All you need to do is join the same server... so just coordinate that with your friend and you should be in one server. Unless you're speaking about a certain gamemode, then you should either specify what that is, or even better, seek help on the specific server's forum if they have one.
-
The only thing wrong I see is that it cannot connect to MTA master server list, so it will only show up as a local network server in the browser... Considering you're using Hamachi, this isn't an issue as far as I'm aware.
-
[Race] -DR| Divine Racers 24/7 DM/Hunter[ENGLISH]
Investor replied to Greenx's topic in Servers to play on
wouldn't it be reasonable and quite logical to say to what you want your title changed to since you can't edit it yourself? -
I would certainly hop on from time to time, but unless there's something really holding me on, I most probably won't be bothered to even turn on MTA
-
get a real job mate... A moderator is usually considered a volunteer, not an employee, and therefore is not entitled to any wage or salary. No one's going to pay you for playing and moderating a server...
-
A sponsor, by definition, is one who gives something free of charge. Paying them is a contradiction in terms
-
New players can always visit the most populous servers and see for themselves why so many people play there and why not everyone plays there. If they find that server not for them, there's always server promotions on Servers to play on forum where smart* new comers can read about servers and make their choice to visit and get a taste of each server. * by smart, I mean those who visit the forum
-
Many people play on smaller servers because of either a friendlier community, better relations with admin team, or perhaps just because they're so bad mannered that they're already banned on big servers. If you discourage joining small servers, no new servers will rise and only the currently big ones will just get bigger. If we want continuous improvement to gameplay, we need those innovators to start their servers fixing what other servers fail to address. What MTA does well is it creates the opportunity for anyone to host their own server. If you want big servers to get even bigger, how about you tell 'em to fill the gaps others found and used as a base for a new server.
-
[RP] Maximum Roleplay Red County - www.redcountyrp.ga [English]
Investor replied to Dizzle's topic in Servers to play on
If you're saying he copied from here then by looking at the dates, it seems more like you copied him. Also, funny thing, you know what else I see copied? https://forums.owlgaming.net/ > http://summitroleplay.net/ -
You should definitely contact your cellular internet provider before attempting to do this yourself as it could be in violation of some terms of use and could get your phone internet access suspended.
-
I seriously doubt they'd want to unban you for just saying sorry and putting this topic in Open Source Contributors section... seriously grow up and take responsibility for your actions
-
technically, once you're proven to be in the right, the claimant who lost has to cover your legal expenses... Although that's only covering it, you'd need to pay upfront and with little, if not none at all, foresight into how the case plays out. You'd be taking a big risk if there are chances you lose.
-
[REQUEST] Code which shows server status on website
Investor replied to koragg's topic in Looking for staff
If you want to produce your own one, I suggest creating a MySQL database, with rows actively being created and destroyed to reflect the scoreboard, and then using PHP to access that database and count the number of players, optionally displaying their names in a table on the site. Could you perhaps also share the link to that "old 2011" code you found? It might make the work easier if someone can just edit that instead of writing from scratch. -
ERROR: adminp\server\admin_server.lua:1416: Admin security - Client/player mismatch from **.**.***.** (onElementDataChange isAmeShowing) ERROR: adminp\server\admin_server.lua:1416: Admin security - Client/player mismatch from **.**.***.** (onElementDataChange isAdoshowing) These errors are a part of admin panel's anticheat system. The code prevents one client from messing with another player's element data, and the IP shown in the error is the IP of the client attempting to modify someone else's data. All you need to do is change how your code edits isAmeShowing or isAdoshowing data, to do it by client who you're changing or instructing the server to do that.
-
Seems to me this code only changes when the player's name is shown as if he were talking (the table only stores state whether someone's speaking or not, as far as I'm aware).
-
Misspelled San Andreas on the first brand/logo image. Just pointing it out