-
Posts
156 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Ayush Rathore
-
[Help] Is there any way to automate the player's movement?
Ayush Rathore replied to Swagy's topic in Scripting
https://community.multitheftauto.com/index.php?p=resources&s=details&id=347 This resource might help you. ? -
Client Side: addEventHandler("onClientVehicleExplode", getRootElement(), function() destroyElement(source) end) Server Side: function deleteVehicleOnBurst() destroyElement(source) end addEventHandler("onVehicleExplode", getRootElement(), deleteVehicleOnBurst) This should do the trick. ?
-
In my opinion you should read the guidelines before posting. I cant understand anything please tell more.
-
Good work keep it up! ??
-
Hi, I have a stable running MTA client in ubuntu 16.04 but when I join a server the HTML pages aren't loading why? I was joining the ffs-gaming server which uses HTML page for login. To recheck I joined in my own server and started web browser resource but still, nothing happened! Thanks in advance!
-
This link might help you to accomplish your task ?.
-
Thanks for the reply but i did installed win7+ version from mtasa.com. I don't know what i did wrong would you please tell me me step by step how to install it. This line is for everyone please tell me me step by step how to install mtasa in Ubuntu 16.04 Thanks in advance!
-
Version = 1.5.5-release-11975.0.000 Time = Wed May 2 22:27:15 2018 Module = C:\Program Files (x86)\MTA San Andreas 1.5\MTA\libcef.dll Code = 0xC0000005 Offset = 0x022EAC5F EAX=00000000 EBX=00000000 ECX=00000000 EDX=00000000 ESI=00000000 EDI=7B48A400 EBP=0177E6DC ESP=0177E6B0 EIP=2270AC5F FLG=00010246 CS=0023 DS=002B SS=002B ES=002B FS=0063 GS=006B Hi, I recently shifted to Ubuntu 16.04 and I installed MTASA-1.5.5 when I join a game and after the download get finished it just crash please help my wine version is wine 1.9.15 Thanks in advance!
-
Hi, if you have an intro video on youtube you can go to this link: https://wiki.multitheftauto.com/wiki/PlayVideo. Your's other suggestions like gif intro and image intro might load the client side.
-
You could do one thing make a account data vip_hours in which you set a real time stamp(when you given a vip to a player) in millisecond and then every time a player logs in to a account check it with the server time if the difference is greater than 100 then remove the vip use mta wiki for reference of getRealTime function
-
if you pass 360 in function or any other value result would be like this totalHours = 360 hours = (360/60) -- > 6 hours = 360 - (6*60) -- > 0 and btw i cant understand why you doing this
-
Try this btw seeing your code you might get an error function takeMoney(player, price) local cash = getElementData(player, "player:money") if cash then cash = tonumber(cash) if cash >= tonumber(price) then setElementData(player, "player:money", cash-price) return true else return false end else setElementData(player,"player:money",0) return false end end function giveCash(player, price) local cash = getElementData(player, "player:money") if cash then setElementData(player, "player:money", cash+price) return true else setElementData(player, "player:money", 0) return false end end addEvent("giveCash", true) addEventHandler("giveCash", root, function(value) if client and value then giveCash(client, value) end end) addEvent("takeCash", true) addEventHandler("takeCash", root, function(price) if client and price then takeMoney(client, price) end end)
-
my bad sorry try this local screenWidth, screenHeight = guiGetScreenSize() local visible = false local window = nil local browser = nil local theBrowser = nil addCommandHandler("youtube",function() visible = not visible if visible == true then window = guiCreateWindow( (screenWidth-800)/2 , (screenHeight-600)/2, 800, 600, "Web Browser", false ) browser = guiCreateBrowser( 0, 28, 800, 600, false, false, false, window ) theBrowser = guiGetBrowser( browser ) addEventHandler("onClientBrowserCreated", theBrowser, function() loadBrowserURL(source, "http://www.youtube.com") end) elseif visible == false then destroyElement(browser) destroyElement(window) browser = nil window = nil theBrowser = nil end showCursor(visible) end) if you like my work please like and follow me happy scripting .
-
local screenWidth, screenHeight = guiGetScreenSize() local webBrowser = nil local visible = false function webBrowserRender() if visible then dxDrawImage(0, 0, screenWidth, screenHeight, webBrowser, 0, 0, 0, tocolor(255,255,255,255), true) end end addEventHandler("onClientRender", root, webBrowserRender) addEventHandler("onClientBrowserCreated", webBrowser, function() loadBrowserURL(webBrowser, "http://www.youtube.com") end) addCommandHandler("youtube",function() visible = not visible webBrowser = createBrowser(screenWidth, screenHeight, false, false) showCursor(visible) end) This would fix your problem
-
Man you really cracked it so i suggest you to first tell all about the mission i will give you a working script in a day or 2 ok ? happy scripting P.S. give me your original script read my message above
-
Any time no problem your welcome
-
Sure i will help u but seriously u don't know scripting, local commands = { ['event'] = true, ['participate'] = true } function checkForEventJoining(commandName) if commands[commandName] then local playerResponsible = source if commandName == "event" then if (exports.integration:isPlayerLeadAdmin(playerResponsible)) then local playerName = getPlayerName ( playerResponsible ) outputChatBox("Admin Joined the Event Script Works!", playerResponsible, 255, 194, 14) else outputChatBox("You need Admin for joining event!", playerResponsible, 255, 194, 14) end elseif commandName == "participate" then if (exports.integration:isPlayerLeadAdmin(playerResponsible)) then local playerName = getPlayerName ( playerResponsible ) outputChatBox("Admin participated Script Works!", playerResponsible, 255, 194, 14) else outputChatBox("You need Admin for participating in event!", playerResponsible, 255, 194, 14) end end end end addEventHandler("onPlayerCommand", root, checkForEventJoining) help yourself by learning scripting and also see above how to do it Please re read my post as i edited it
-
first read how to post in this forum your code hurt my eyes and also go to mta wiki to learn some coding btw let me help you function joinEvent(thePlayer, commandName, ...) if (exports.integration:isPlayerLeadAdmin(thePlayer)) then local playerName = getPlayerName ( thePlayer ) outputChatBox("Adminul '" .. playerName.. "' testeaza un script personal.", thePlayer, 255, 194, 14) outputChatBox("Scrie /event pentru a participa !", thePlayer, 255, 194, 14) outputChatBox("Test", thePlayer, 255, 194, 14) else outputChatBox("Trebuie sa fi 'Lider Admin' pentru aceasta comanda !", thePlayer, 255, 194, 14) outputChatBox("Script creat de 'Griffin_Connor'.", thePlayer, 255, 194, 14) end end addCommandHandler("event", joinEvent) this should be correct as i don't know your language .
-
Try this btw u have to change many things in addEventHandler Thingy as : see below --// Made by: MoPoMaN --//Tables and other stuff tableLocationsX = {} tableLocationsY = {} tableLocationsZ = {} tableMoney = {} locationCount = 3 --//Location 1 tableLocationsX[1] = 2253.7 tableLocationsY[1] = -84.0 tableLocationsZ[1] = 25.3 tableMoney[1] = 500 --//Location 2 tableLocationsX[2] = 1093.7 tableLocationsY[2] = -931.6 tableLocationsZ[2] = 41.9 tableMoney[2] = 550 --//Location3 tableLocationsX[3] = -47.3 tableLocationsY[3] = -1137.5 tableLocationsZ[3] = 0.07 tableMoney[3] = 500 function startScript () --Marker marker = createMarker (2776.6, -2425.5, 12.6, "cylinder", 1.1, 0, 255, 0) addEventHandler ("onClientMarkerHit", marker, startMission) --Objects and Ped ped = createPed (302, 2776.7, -2428.1, 13.6) tableObj = createObject (2205, 2775.9, -2426.8, 12.6) chairObj = createObject (2309, 2776.7, -2427.4, 12.6) addEventHandler ("onClientPedWasted", getRootElement(), respawnPed) --Blip startBlip = createBlip (2776.9, -2423.9, 12.7, 51) end function startMission (hitElement) if getElementType (hitElement) == "player" then truck = createVehicle (515, 2779.6, -2437.2, 14.7, 0, 0, 90) trailer = createVehicle (450, 2789.2, -2437.1, 14.2, 0, 0, 90) randomLoc = math.random (1, locationCount) finish = createMarker (tableLocationsX[randomLoc], tableLocationsY[randomLoc], tableLocationsZ[randomLoc], "cylinder", 3, 0, 200, 55, 255, hitElement) blip = createBlip (tableLocationsX[randomLoc], tableLocationsY[randomLoc], tableLocationsZ[randomLoc], 0, 2, 255, 0, 0, 255, 0, 10000, hitElement) --addEventHandlers addEventHandler ("onClientTrailerDetach", getRootElement(), trailerDetach) addEventHandler ("onClientVehicleExit", getRootElement(), vehicleExit) addEventHandler ("onClientMarkerHit", finish, reward) addEventHandler ("onClientPlayerQuit", getRootElement(), onQuit) --other setVehicleLocked (truck, true) destroyElement (startBlip) player = hitElement outputChatBox ("#ffaa00***#ffffffDrive to the red blip on the map #ffaa00***", player, 255, 255, 255, true) setElementPosition (marker, -406, -64, 2.4) warpPedIntoVehicle (hitElement, truck) -- end else return false end end function trailerDetach () if source == trailer then --destroyThings outputChatBox ("#ffffffMission failed, go back for more cargo!", player, 255, 255, 255, true) destroyElement (trailer) destroyElement (finish) destroyElement (blip) --removeEventHandlers removeEventHandler ("onClientTrailerDetach", getRootElement(), trailerDetach) removeEventHandler ("onClientVehicleExit", getRootElement(), vehicleExit) removeEventHandler ("onClientPlayerQuit", getRootElement(), onQuit) --other startBlip = createBlip (2776.9, -2423.9, 12.7, 51) setElementPosition (marker, 2776.6, -2425.5, 12.6) else return false end end function vehicleExit (leaver) if source == truck and leaver == player then setVehicleLocked (truck, false) outputChatBox ("#ffaa00// #ffffffGo back to the truck in 10 seconds!", leaver, 255, 255, 255, true) destroyTimer = setTimer (destroyVehicle, 10000, 1) addEventHandler ("onClientVehicleEnter", getRootElement(), destrTimer) else return false end end function destrTimer (thePlayer) if source == truck and thePlayer == player then local team = getPlayerTeam (thePlayer) if getTeamName (team) == "Freeroam" or getTeamName (team) == "The Police" then return false else killTimer (destroyTimer) removeEventHandler ("onClientVehicleEnter", getRootElement(), destrTimer) setVehicleLocked (truck, true) end else return false end end function destroyVehicle () if destroyTimer then --destroyThings destroyElement (trailer) destroyElement (finish) destroyElement (blip) --removeEventHandlers removeEventHandler ("onClientTrailerDetach", getRootElement(), trailerDetach) removeEventHandler ("onClientVehicleExit", getRootElement(), vehicleExit) removeEventHandler ("onClientVehicleEnter", getRootElement(), destrTimer) removeEventHandler ("onClientPlayerQuit", getRootElement(), onQuit) --other startBlip = createBlip (2776.9, -2423.9, 12.7, 51) setElementPosition (marker, 2776.6, -2425.5, 12.6) else return false end end function onQuit () if source == player then --destroyThings destroyElement (truck) destroyElement (trailer) destroyElement (finish) destroyElement (blip) --removeEventHandlers removeEventHandler ("onClientTrailerDetach", getRootElement(), trailerDetach) removeEventHandler ("onClientVehicleExit", getRootElement(), vehicleExit) removeEventHandler ("onClientPlayerQuit", getRootElement(), onQuit) --other startBlip = createBlip (2776.9, -2423.9, 12.7, 51) setElementPosition (marker, 2776.6, -2425.5, 12.6) end end function reward (hitElement) if hitElement == truck then --other startBlip = createBlip (2776.9, -2423.9, 12.7, 51) outputChatBox ("#ffaa00// #ffffffGood job! You've been rewarded " .. tableMoney[randomLoc] .. "$", player, 255, 255, 255, true) setElementPosition (marker, 2776.6, -2425.5, 12.6) occupant = getVehicleOccupant (truck, 0) givePlayerMoney (occupant, tableMoney[randomLoc]) --destroyThings destroyElement (trailer) destroyElement (finish) destroyElement (blip) --removeEventHandlers removeEventHandler ("onClientTrailerDetach", getRootElement(), trailerDetach) removeEventHandler ("onClientVehicleExit", getRootElement(), vehicleExit) removeEventHandler ("onClientPlayerQuit", getRootElement(), onQuit) else return false end end function respawnPed () if source == ped then timer = setTimer (pedRespawn, 5000, 1) else return false end end function pedRespawn () killTimer (timer) destroyElement (ped) ped = createPed (302, 2776.7, -2428.1, 13.6) end addEventHandler ("onClientResourceStart", getResourceRootElement(getThisResource()), startScript)
-
use this tag in meta file its the easiest way --in meta.xml of every resource you want to download earlier than login panel <download_priority_group>1</download_priority_group> --increse the value in every resource by one <download_priority_group>2</download_priority_group> <download_priority_group>3</download_priority_group> <download_priority_group>4</download_priority_group> --...... all resources you want to be downloaded before login --and lastly add the below line in meta.xml of login <download_priority_group>0</download_priority_group>
-
function pairsByKeys (t, f) local a = {} for n in pairs(t) do table.insert(a, n) end table.sort(a, f) local i = 0 -- iterator variable local iter = function () -- iterator function i = i + 1 if a[i] == nil then return nil else return a[i], t[a[i]] end end return iter end function aktualizujKontakty() lista={} for i,v in ipairs(getElementsByType("player")) do if v~=localPlayer then lista[getPlayerName(v)]={v,getElementData(localPlayer,"PW:"..getPlayerName(v)) or ""} end end end function wyswietlKontakty() guiGridListClear(gridlist[1]) for i,v in pairsByKeys(lista) do -- see this line r=guiGridListAddRow(gridlist[1]) guiGridListSetItemText(gridlist[1],r,1,skipColorCode(i),false,false) guiGridListSetItemData(gridlist[1],r,1,i) if nieodczytane[i] then guiGridListSetItemColor(gridlist[1],r,1,0,255,0) end if zablokowany[i] then guiGridListSetItemColor(gridlist[1],r,1,255,0,0) end end end This will sort table by key and will add players automatically
-
So i would ask u if you can make changes to your saving system by adding two column for banAccount and banTime and then on player Login by that account he can never cheat and also go to below link and u will get to know that Mac Addresses can also be changed so my above method will be best
-
BTW you should first read mta wiki if u are a scripter Server Side : function playerDamageCheckForSniper ( attacker, weapon, bodypart, loss ) if ( weapon == 34 ) then killPed ( source, attacker, weapon, bodypart ) end end addEventHandler ( "onPlayerDamage", getRootElement (), playerDamageCheckForSniper ) this would do the trick
-
In my opinion only serial will suffice for your ban system as serial cant be changed of a pc or laptop and also if you have a data saving system make it store values on basis of serial key which means SERIALNUMBER WILL BE PRIMARY KEY OF YOUR DATABASE Happy scripting making it unexploitable
-
try this function onThisResourceStart ( ) downloadFile ( "test.png" ) end addEventHandler ( "onClientResourceStart", resourceRoot, onThisResourceStart ) function onDownloadFinish ( file, success ) if ( source == resourceRoot ) then if ( success ) then if ( file == "test.png" ) then outputChatBox ( "test.png downloaded" ) end else if ( file == "test.png" ) then outputChatBox ( "test.png failed to download" ) end end end end addEventHandler ( "onClientFileDownloadComplete", root, onDownloadFinish ) And also add in meta.xml the attribute download="false" and also add this line in your meta <min_mta_version client="1.5.4" server="1.5.4" /> happy scripting