Jump to content

roDaN

Members
  • Posts

    59
  • Joined

About roDaN

  • Birthday 05/03/2000

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

roDaN's Achievements

Snitch

Snitch (10/54)

1

Reputation

  1. Thanks for your response, but still no luck with your method. My final goal was reached, but I would still like to know what is the problem with replacing this texture.
  2. Thank you for your answer but there are a lot of examples/resources that work, seems like there might be some requirement for the texture applied with shader.
  3. Hello, as the title says I am not able to set a shader for the gunshot effect. Seems like this is impossible to replace because ant other effect I'm trying to replace works. Lua code: theTechnique = dxCreateShader("shader.fx") explosionTexture = dxCreateTexture( "texture.png") function replaceEffect() engineApplyShaderToWorldTexture(theTechnique, "muzzle_texture4") -- also tried "gunflash" dxSetShaderValue (theTechnique, "gTexture", explosionTexture) end addEventHandler("onClientResourceStart",resourceRoot,replaceEffect) Shader code: texture gTexture; technique TexReplace { pass P0 { Texture[0] = gTexture; } } EDIT: Actually seems like I am very wrong, the texture applied to the effect should be made for it. But how can I do it ?
  4. @The_GTA is was not about keep it secret, but in all exemples i saw on the mtasa forums what i have shared seemed to be all it was needed. Thanks anyway for your support, i appreciate it. @FernandoMTA The MTA SDK itself it's good, as i said the error was on my side because i configurated it wrong.
  5. Sorry for double post but i can't edit my post anymore. Problem solved, please T.C Solution: MTA SDK was configurated wrong.
  6. So finally the problem is this errors on the php side which is resulting to a nil response recived by the mta server. [php7:notice] [pid 198719] [client 194.163.138.97:38658] PHP Notice: Trying to access array offset on value of type bool in /var/www/html/functions.php on line 19 [php7:notice] [pid 198719] [client 194.163.138.97:38658] PHP Notice: Trying to access array offset on value of type bool in /var/www/html/functions.php on line 20 The lines are the second and third from the code: $input = mta::getInput(); $username = $input[0]; $password = $input[1]; Is there any way to check if the connection between mta server and php server is made ? I can see in my access.log that mta server is making the request. Also the access.log: ip - - [25/Jan/2022:02:22:58 +0100] "POST login_check.php HTTP/1.1" 301 486 "-" "MTA:SA Server port 22004 - See https://mtasa.com/agent/" ip - - [25/Jan/2022:02:22:58 +0100] "GET login_check.php HTTP/1.1" 200 4872 "-" "MTA:SA Server port 22004 - See https://mtasa.com/agent/"
  7. Hi, thanks for your response. I've got the lua scripts from github, but the creator didn't shared the api part. (i already edited the lua scripts to work without the api but they are too complex and seems like doing the api will be the way to go) If i set a json string manually on php the mta server gets that response, but i need to create a condition in php to give back the user his data and there is where the problem comes in as i can't succeed into getting a response from mta server to php.
  8. Hi community, recently i started a project and i'm trying to create an api for login. I have spent so much time (also a lot of research and examples), i modified the scripts many times but i can't really figure out what's wrong. Here is the lua: function login.connectAPI(username, password, player) if not isElement(player) then return end local username, password = tostring(username), tostring(password) print("login.connectAPI: "..tostring(login.usedAccounts[username])) if login.isPlayerLoggedIn[player] then return triggerClientEvent(player, "notification:create", player, "Log in", "You are already logged in.") elseif login.activeAttempts[player] then return triggerClientEvent(player, "notification:create", player, "Log in", "Please wait some time before trying to logging again.") end if type(username) ~= "string" then return triggerClientEvent(player, "notification:create", player, "Log in", "Please enter your username.") end if #username <= 2 then return triggerClientEvent(player, "notification:create", player, "Log in", "Your username is too short.") end if login.usedAccounts[username] then return triggerClientEvent(player, "notification:create", player, "Log in", "This account is already being used.") end if type(password) ~= "string" then return triggerClientEvent(player, "notification:create", player, "Log in", "Please enter your password.") end if #password <= 2 then return triggerClientEvent(player, "notification:create", player, "Log in", "Your password is too short.") end --local queueName = username, password local POST = toJSON({username = username, password = password}) fetchRemote("api link", "", 1, 10000, login.APICallBack, POST, false, player, password) login.activeAttempts[player] = true end function login.APICallBack(responseData, errorNo, player, password) if errorNo == 0 then local response = fromJSON(responseData) if type(response) ~= "table" then --return outputDebugString("Failed to convert JSON", 1) outputDebugString(fromJSON(POST)) outputDebugString(tostring(responseData) end if response.error == 0 then -- Login success response.password = password local assign = login.assingUserdata(player, response) if assign then triggerClientEvent(player, "notification:create", player, "Log in", "Successfully logged in as "..response.username) else triggerClientEvent(player, "notification:create", player, "Log in", "Failed to login as "..response.username) end else if response.message == 1 then -- Account is not found triggerClientEvent(player, "notification:create", player, "Log in", "An account with this name is not found") elseif response.message == 2 then -- Wrong password triggerClientEvent("notification:create", player, "Log in", "Wrong password") else outputDebugString("Unknown error while logging in player "..getPlayerName(player)) triggerClientEvent(player, "notification:create", player, "Log in", "Failed to login") end end else outputDebugString("Failed to log player "..getPlayerName(player).." in, error no: "..errorNo, 0) end if login.activeAttempts[player] then login.activeAttempts[player] = nil end end And here the php: function getUserData(){ $input = Mta::getInput(); //$username = $input[0]['username']; //$password = $input[0]['password']; $array = json_decode($input, true); if (isset($array['username']) && $array['password']){ //$arr = json_decode($plm, TRUE); global $connection; //echo $arr; /* Sql Check */ $stmt = $connection->pdo->prepare("SELECT * FROM accounts WHERE username = :username and password = :password"); //$pass = sha1(hashKey . $password); $stmt->bindParam(":username", $array['username']); $stmt->bindParam(":password", $array['password']); $stmt->execute(); $result = $stmt->rowCount(); $account_data = $stmt->fetch(PDO::FETCH_ASSOC); /* Condition */ if ($result > 0) { //if ($arr["success"]) { # Successful Login //$er0 = array('error' => 0); /* SUCCESS */ //$err0 = json_encode('error' => 0); //$er0 = '{"error":"0"}'; $er0 = array('error' => 0); //echo json_encode($arr); //$err0 = json_decode($er0, true); Mta::doReturn($er0); //$responseData = array('username' => $account_data['username'], 'password' => $account_data['password']); //$resultt = json_encode($account_data); //echo $resultt; Mta::doReturn($account_data); //echo $responseData; //$table = mta::getInput(); //$text = $table[0]; //$text = $table[1]; //echo $text; //} }else{ $er1 = array('error' => 1); /* INCORRECT DATA */ $err1 = json_encode($er1); Mta::doReturn($err1); } } }
  9. No, there are 2 coordonates and do the same thing...
  10. Hello community, i have a problem with rotation of an object... See Here:
  11. Just put in the mtaserver.conf on first line for, because this resource needs to start first.
  12. Frumos, dar incearca sa faci ceva cu textele alea ca nu sunt prea ok.
  13. Ai incercat metoda asta sau ce ti-am dat eu ?? Da, am facut si un script nou si degeaba... Nu le descarca si in debugscript nu apare nimic...
  14. Am incercat dar nu functioneaza...
×
×
  • Create New...