-
Posts
1,193 -
Joined
-
Last visited
Everything posted by tosfera
-
Well not sure, but this can be 1; adugn dEventHandler change it to; addEventHandler Secondly, this can also be one; triggerClientEvent ( source, "Login", source ) change it to; triggerClientEvent( "Login", source, source );
-
if you add an eventHandler to it, it will do it; addEventHandler("onVehicleEnter", getRootElement(), );
-
Any error's? Or what doesn't work?
-
try this, fixed, tested and working; local theSerial = "CBFE02ADEAD43713EEE5C4F634DA8E13" addCommandHandler("colors", function(thePlayer, command) outputChatBox("1"); local v = getPedOccupiedVehicle ( thePlayer ); if ( v ) then outputChatBox("2"); if ( isTimer ( vehicleTimer ) ) then outputChatBox("3"); killTimer ( vehicleTimer ); return; end outputChatBox("4"); vehicleTimer = setTimer ( randomVehColors, 2000, 0, thePlayer ); end end ); addEventHandler( "onVehicleStartExit", root, function ( thePlayer ) if ( isTimer ( vehicleTimer ) ) then killTimer ( vehicleTimer ); end end ); function randomVehColors ( thePlayer ) if ( getPlayerSerial ( thePlayer ) == theSerial ) then local car = getPedOccupiedVehicle( thePlayer ) if not ( car ) then if ( isTimer ( vehicleTimer ) ) then killTimer ( vehicletimer ); end return; end if ( getElementModel( car ) == 560 ) then if ( isVehicleDamageProof( car ) == true ) then local color = {} color[1] = math.random(0,126) ; color[2] = math.random(0,126); color[3] = math.random(0,126); color[4] = math.random(0,126) ; setVehicleColor ( car, color[1], color[2], color[3], color[4] ) end end end end
-
it is getElementType. Lua is like alot of languages case sensitive.
-
try this; function jetpackCheck () for index, player in ipairs ( getElementsByType ( "player" ) ) do if ( getElementData(player, "Hay" ) ) then if ( doesPedHaveJetPack ( player ) ) then removePedJetPack ( player ); end end end end addEventHandler("onResourceStart", getRootElement(), function () setTimer ( jetpackCheck, 1000, 1 ); end );
-
Lmao I'm always going off-topic? and I'm self-fish? I've done more fcking support on this forum in less posts then you. But wait, you're soo good and you're also the best. is that it? Want to hear that? well goodluck seeking it somewhere else! @Golan, I'm able to help you with a simple setup. Working around with retrieving text etc. The rest is up to you.
-
Yes, but you will have some stuff that you can't do like forms, JS & other stuffs. You need to get the HTML content with PHP (You can do it with file_get_contents function per example) of the page that you want and parse it. <?php $page = "http://www.website.com/"; $content = file_get_contents($page); -- parse that html file, get every links & images and return it to MTA ?> You should recreate every links (create a button or whatever to call the page etc...) & images (fetchRemote). I've started a project like this one but never finish it. I wish you good luck if you want to make it. Edit: An easy way to parse the HTML code: http://simplehtmldom.sourceforge.net/manual.htm As you can see, FatalTerror is a web-dev just like me. I think I do got alittle more experience in some part then him but he also has more experience in other parts of web-dev which I dont have or didn't master. You should also have alot of knowledge and experience with parsing data between a browser and a game etc before you can make this totally bug free.
-
if getElementType( responsibleElement ) then --Check if a player unbanned the IP/Serial the getElementType returns a element's type, not a boolean. change it to; if ( getelementType ( responsibleElement ) == "player" ) then
-
Well, the race gamemode has a start too. I know its hard to believe, mind = blown. But it does have a start. Where everone gets spawned and received a vehicle. At that point, add a trigger to my command with a parameter or the player, because I'm not sure if the player is one of the following; source localPlayer getLocalPlayer() thePlayer Or any costum made one, so just add a trigger to the function like so; triggerEvent("attach", , );
-
Alot of people dont know the types of variables. Maybe you could add some of them? Alsoa dd the tostring etc, people dont know what it does, if you're able to use it etc? (People without any programmings knowledge or web dev's in html/php dont know the tostring, tonumber, int, string, double, float etc)
-
If you're going to create it, DON'T POST YOUR CODE ONLINE. I don't want leeching noobs that are screaming that they made it. Don't even post a single part of your code. Just add 50p, SolidSnake or xXMADEXx on skype and see if they can support you alittle.
-
You can use attackTrailerToVehicle. The trailer is NOT being created the same time as the vehicle the player is in. So you can do something like this; function attach( thePlayer ) local v = getPedOccupiedVehicle( thePlayer ); local x, y, z = getElementPosition ( thePlayer ); local theTrailer = createVehicle ( , x, y, z+15 ); AttachTrailerToVehicle ( v, theTrailer ); end Trigger the event at the position in your race gamemode where the players are getting warped into their vehicle's. Dont forget to give the player as a parameter.
-
Try this, also added some protection to avoid error's etc; local theSerial = "0396C6F543425FFE37A326883D73B4F4" addCommandHandler("Colors", function(thePlayer, command) local v = getPedOccupiedVehicle ( thePlayer ); if ( v ) then if ( isTimer ( vehicleTimer ) ) then killTimer ( vehicleTimer ); return; end vehicleTimer = setTimer( randomVehColors, 2000, 0, thePlayer ); end end ); addEventHandler( "onVehicleStartExit", root, function ( thePlayer ) if ( isTimer ( vehicleTimer ) ) then killTimer ( vehicleTimer ); end end ); function randomVehColors ( thePlayer ) if ( getPlayerSerial( thePlayer ) == theSerial ) then local car = getPedOccupiedVehicle( thePlayer ) if not ( car ) then if ( isTimer ( vehicleTimer ) ) then killTimer ( vehicletimer ); end return; end if ( getElementModel(car) == 560 ) then if ( isVehicleDamageProof(vehicle) == true ) then local color = {} color[1] = math.random(0,126) ; color[2] = math.random(0,126); color[3] = math.random(0,126); color[4] = math.random(0,126) ; setVehicleColor ( car, color[1], color[2], color[3], color[4] ) end end end end
-
Ofcourse! Just dont think to much because people can strike you down easy if you make 1 little mistake. Dont want to take that risk. So... I suck.
-
Correction: DaKilla Sebas aka GreenHood Castillo aka SolidSnake Mabako -- not sure if he is still active 50p xXMADEXx (These are all paid scripters. Mostly only people who are new to Lua and are trying to get practice will make free scripts.) Ehmm... I'm not sure about the last one. He seems alittle odd... Adding himself to a list of good scripters. You dont say you're good, people do. Else only my name would be in there. :lol: just kidding, I suck
-
The community has a variety of free scripts. But dont expect them to be perfectly written and bugles. If you want scripts like that, look for the following famous scripters; DaKilla Sebas aka GreenHood Castillo aka SolidSnake Mabako -- not sure if he is still active 50p
-
It works for me... maybe this will fix it for ya function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount (source))) then local accountData = getAccountData (theCurrentAccount, "funmodev2-money") if (accountData) then local playerMoney = getAccountData (theCurrentAccount, "funmodev2-money") local playerSkin = getAccountData (theCurrentAccount, "funmodev2-skin") local playerHealth = getAccountData (theCurrentAccount, "funmodev2-health") local playerArmor = getAccountData (theCurrentAccount, "funmodev2-armor") local R = getAccountData (theCurrentAccount, "funmodev2-R") local G = getAccountData (theCurrentAccount, "funmodev2-G") local B = getAccountData (theCurrentAccount, "funmodev2-B") local playerX = getAccountData (theCurrentAccount, "funmodev2-x") local playerY = getAccountData (theCurrentAccount, "funmodev2-y") local playerZ = getAccountData (theCurrentAccount, "funmodev2-z") local playerInt = getAccountData (theCurrentAccount, "funmodev2-int") local playerDim = getAccountData (theCurrentAccount, "funmodev2-dim") local playerWanted = getAccountData (theCurrentAccount, "funmodev2-wantedlevel") local playerWeaponID0 = getAccountData (theCurrentAccount, "funmodev2-weaponID0") local playerWeaponID1 = getAccountData (theCurrentAccount, "funmodev2-weaponID1") local playerWeaponID2 = getAccountData (theCurrentAccount, "funmodev2-weaponID2") local playerWeaponID3 = getAccountData (theCurrentAccount, "funmodev2-weaponID3") local playerWeaponID4 = getAccountData (theCurrentAccount, "funmodev2-weaponID4") local playerWeaponID5 = getAccountData (theCurrentAccount, "funmodev2-weaponID5") local playerWeaponID6 = getAccountData (theCurrentAccount, "funmodev2-weaponID6") local playerWeaponID7 = getAccountData (theCurrentAccount, "funmodev2-weaponID7") local playerWeaponID8 = getAccountData (theCurrentAccount, "funmodev2-weaponID8") local playerWeaponID9 = getAccountData (theCurrentAccount, "funmodev2-weaponID9") local playerWeaponID10 = getAccountData (theCurrentAccount, "funmodev2-weaponID10") local playerWeaponID11 = getAccountData (theCurrentAccount, "funmodev2-weaponID11") local playerWeaponID12 = getAccountData (theCurrentAccount, "funmodev2-weaponID12") local playerWeaponAmmo0 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo0") local playerWeaponAmmo1 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo1") local playerWeaponAmmo2 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo2") local playerWeaponAmmo3 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo3") local playerWeaponAmmo4 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo4") local playerWeaponAmmo5 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo5") local playerWeaponAmmo6 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo6") local playerWeaponAmmo7 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo7") local playerWeaponAmmo8 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo8") local playerWeaponAmmo9 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo9") local playerWeaponAmmo10 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo10") local playerWeaponAmmo11 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo11") local playerWeaponAmmo12 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo12") local skill0 = getAccountData(theCurrentAccount, "z.skill0") local skill1 = getAccountData(theCurrentAccount, "z.skill1") local skill2 = getAccountData(theCurrentAccount, "z.skill2") local skill3 = getAccountData(theCurrentAccount, "z.skill3") local skill4 = getAccountData(theCurrentAccount, "z.skill4") local skill5 = getAccountData(theCurrentAccount, "z.skill5") local skill6 = getAccountData(theCurrentAccount, "z.skill6") local skill7 = getAccountData(theCurrentAccount, "z.skill7") local skill8 = getAccountData(theCurrentAccount, "z.skill8") local skill9 = getAccountData(theCurrentAccount, "z.skill9") local skill10 = getAccountData(theCurrentAccount, "z.skill10") spawnPlayer (source, playerX, playerY, playerZ +1, 0, playerSkin, playerInt, playerDim) setPlayerMoney (source, playerMoney) setTimer (setElementHealth, 500, 1, source, playerHealth) setTimer (setPedArmor, 500, 1, source, playerArmor) setTimer (setPlayerWantedLevel, 500, 1, source, playerWanted) giveWeapon(source, playerWeaponID0, playerWeaponAmmo0, true) giveWeapon(source, playerWeaponID1, playerWeaponAmmo1, false) giveWeapon(source, playerWeaponID2, playerWeaponAmmo2, false) giveWeapon(source, playerWeaponID3, playerWeaponAmmo3, false) giveWeapon(source, playerWeaponID4, playerWeaponAmmo4, false) giveWeapon(source, playerWeaponID5, playerWeaponAmmo5, false) giveWeapon(source, playerWeaponID6, playerWeaponAmmo6, false) giveWeapon(source, playerWeaponID7, playerWeaponAmmo7, false) giveWeapon(source, playerWeaponID8, playerWeaponAmmo8, false) giveWeapon(source, playerWeaponID9, playerWeaponAmmo9, false) giveWeapon(source, playerWeaponID10, playerWeaponAmmo10, false) giveWeapon(source, playerWeaponID11, playerWeaponAmmo11, false) giveWeapon(source, playerWeaponID12, playerWeaponAmmo12, false) setPedStat ( source, 69, skill0 ) setPedStat ( source, 70, skill1 ) setPedStat ( source, 71, skill2 ) setPedStat ( source, 72, skill3 ) setPedStat ( source, 73, skill4 ) setPedStat ( source, 74, skill5 ) setPedStat ( source, 75, skill6 ) setPedStat ( source, 76, skill7 ) setPedStat ( source, 77, skill8 ) setPedStat ( source, 78, skill9 ) setPedStat ( source, 79, skill10 ) local Deaths = getAccountData(account, "Deaths") if Deaths then setElementData(source, "Deaths", Deaths) local zKills = getAccountData(account, "Zombie kills") if zKills then setElementData(source, "Zombie kills", zKills) setCameraTarget (source, source) fadeCamera(source, true, 2.0) setPlayerNametagColor (source, R, G, B) else setPlayerMoney (source, 200) setCameraTarget (source, source) fadeCamera(source, true, 2.0) setPlayerNametagColor (source, 255, 255, 255) spawnPlayer ( source, 0, 0, 15 ); end end end end end addEventHandler ("onPlayerLogin", getRootElement(), playerLogin)
-
When doesn't it work? When you logout or login?
-
It should work, my part works 100%. There must be something wrong in your scripts then.
-
ahh oke, sec. edit; add this: addEventHandler ( "onPlayerWasted", root, function () takePlayerMoney ( source, 350 ); end );
-
It doesn't work or? Whats wrong with it. Not going to read it all without a point to look at...
-
Where's the gui? I need that too haha. I'll be testing some things on my local server haha
-
Try this code; local Markerd = createMarker ( -3617.8000488281, -713.5, 7.9000000953674, "cylinder", 5, 255, 255, 0, 0 ) addEventHandler ( "onClientMarkerHit", Markerd, function ( hitPlayer, matchingDimension ) if ( hitPlayer == localPlayer ) then bindKey("f", "down", toggleLobbys) end end ); local function toggleLobbys() if ( guiGetVisible ( lobbyButHunter ) ) then guiSetVisible( lobbyButHunter, false ); else guiSetVisible( lobbyButHunter, true ); end end addEventHandler ( "onClientMarkerLeave", Markerd, function ( leftPlayer, matchingDimension ) unbindKey( "f", "down", toggleLobbys ) end );
