Jump to content

LasHa

Members
  • Posts

    96
  • Joined

  • Last visited

Everything posted by LasHa

  1. Why? Is that really needed?!
  2. https://community.multitheftauto.com/in ... s&id=13477 This is the first script i'm uploading here! As far as you know stunts are well paid and useful thing for MultiGameMode race servers. I'm beginner scripter so i am very thankful to Walid. The scripter which helped me much! Leave the comment if you find some bugs or want me to add new features... Use /fstunts to check how many stunts you have finished from how many. Change "512" to any count of stunts you will have!
  3. LasHa

    AccountData Help

    I will 100% put your name on my scripts Authors Thank you so much <3 you worked more on that script than me
  4. LasHa

    AccountData Help

    This is the latest full code atm. local Blips = {} local details = {} local Entred = {} --"Vector 1 = Vehicle ID", "Vector 2 - Vector 3 - Vector 4 = X, Y, Z Coordinates", "Vector 5 = Reward Money for completing Stunt", "Vector 6 = Name of the stunt", "Vector 7 = Needed time for completing the stunt" local Markers = { {522, 1986, -1478.1, 21.5, 17500, "Test Stunt #1", 3000}, -- Marker 1 {522, 1114, -1822, 33.5, 17500, "Test Stunt #2", 0}, -- Marker 2 {522, 776.8, -1036, 39.5, 9000, "Test Stunt #3", 0}, -- Marker 3 {522, 1313, -1163, 41, 7500, "Test Stunt #4", 0}, -- Marker 4 {522, 1404, -806, 85, 7500, "Test Stunt #5", 0}, -- Marker 5 {522, 775.7, -1060.5, 33.2, 5000, "Test Stunt #6", 0}, -- Marker 6 } function allowedVehicles( hitElement, matchingDimension ) if matchingDimension and isElement(hitElement) and getElementType(hitElement) == "player" then if isPedInVehicle ( hitElement ) then local vehicle = getPedOccupiedVehicle ( hitElement ) if vehicle then if Entred[hitElement] == source then outputChatBox("Sorry you can't enter the marker twice" , hitElement,255,0,0) return end local theTable = details[source] if (theTable) then local model, cash, name, timer = details[source][1], details[source][2], details[source][3], details[source][4] if getElementModel ( vehicle ) == model then if timer then StuntComplete(hitElement,source,cash,name) Entred[hitElement] = source else outputChatBox ( "You have entered in Stunt with wrong vehicle", hitElement, 255, 0, 0 ) end end end end end end end function StuntComplete (player,marker,cash,markerName) if isElement ( player ) then givePlayerMoney ( player, tonumber(cash)) outputChatBox ( "You have completed the Stunt and earned "..tonumber(cash).."$", player, 0, 255, 0 ) if isElement( Blips[marker] ) then setBlipColor ( Blips[marker], 0, 255, 0, 255 ) setMarkerColor (marker,0, 255, 0, 255 ) outputDebugString("done") end local playerAccount = getPlayerAccount (player) if ( playerAccount ) and not isGuestAccount ( playerAccount ) then local totalStunts = getAccountData ( playerAccount, "totalStunts" ) or 0 local name = markerName local rb,gb,bb,ab = getBlipColor (Blips[marker]) local rm,gm,bm,am = getMarkerColor ( marker ) local Det = toJSON({name,rb,gb,bb,ab,rm,gm,bm,am}) setAccountData (playerAccount, "entered.marker", Det ) setAccountData (playerAccount, "Details", Det ) setAccountData(playerAccount, "totalStunts" , tonumber(totalStunts)+1) end end end function leaveMar( leaveElement ) if ( isElement ( leaveElement ) and getElementType ( leaveElement ) == "player" ) then setElementData ( leaveElement, "entered.marker", false ) outputChatBox("You failed the Stunt!", leaveElement, 255, 0, 0) end end for i , v in pairs (Markers) do HitMarker = createMarker ( v[2], v[3], v[4], "corona", 1.20, 255, 0, 0, 255 ) Blips[HitMarker] = createBlipAttachedTo( HitMarker, 0 ) details[HitMarker] = {v[1],v[5],v[6],v[7]} addEventHandler( "onMarkerHit", HitMarker, allowedVehicles ) addEventHandler ( "onMarkerLeave", HitMarker, leaveMar) end function stuntsFinished ( player ) if isElement(player) then local playerAccount = getPlayerAccount ( player ) if ( playerAccount ) and not isGuestAccount ( playerAccount ) then local count = getAccountData( playerAccount, "totalStunts" ) or 0 outputChatBox( "You have finished "..tonumber(count).."/512 Stunts", player, 0, 255, 0) end end end addCommandHandler("fstunts", stuntsFinished) function Load (_,cur) local Det = getAccountData(cur,"Details") if Det then local marName,rb,gb,bb,ab,rm,gm,bm,am = unpack(fromJSON(Det)) for i , mar in pairs (getElementsByType("marker")) do local theTable = details[mar] if (theTable) then local name = details[mar][3] if name == tostring(marName) then Entred[source] = mar setMarkerColor (mar,tonumber(rm),tonumber(gm),tonumber(bm),tonumber(am)) end end end end end addEventHandler("onPlayerLogin",root,Load)
  5. LasHa

    AccountData Help

    So i just need to save the marker color and set it as AccountData not ElementData. I tried to do it but didn't work and fix that after restarting script, accounts still save the stunts Finished. And these timers too. You are and will be the best if you help me do that
  6. LasHa

    AccountData Help

    + After restarting script. #FinishedStunts is saved but not stunts. After restarting script i can take the stunt again. After relogging or reconnecting i see the same color as on the last activity on last account, but can take the stunt with another account as its new account.
  7. LasHa

    AccountData Help

    Walid, sorry for so much questions but, I added timer as you said and it doesn't work. local Blips = {} local details = {} local Entred = {} --"Vector 1 = Vehicle ID", "Vector 2 - Vector 3 - Vector 4 = X, Y, Z Coordinates", "Vector 5 = Reward Money for completing Stunt", "Vector 6 = Name of the stunt", "Vector 7 = Needed time for completing the stunt" local Markers = { {522, 1986, -1478.1, 21.5, 17500, "Test Stunt #1", 3000}, -- Marker 1 {522, 1114, -1822, 33.5, 17500, "Test Stunt #2", 0}, -- Marker 2 {522, 776.8, -1036, 39.5, 9000, "Test Stunt #3", 0}, -- Marker 3 {522, 1313, -1163, 41, 7500, "Test Stunt #4", 0}, -- Marker 4 {522, 1404, -806, 85, 7500, "Test Stunt #5", 0}, -- Marker 5 {522, 775.7, -1060.5, 33.2, 5000, "Test Stunt #6", 0}, -- Marker 6 } function allowedVehicles( hitElement, matchingDimension ) if matchingDimension and isElement(hitElement) and getElementType(hitElement) == "player" then if isPedInVehicle ( hitElement ) then local vehicle = getPedOccupiedVehicle ( hitElement ) if vehicle then if Entred[hitElement] == source then outputChatBox("Sorry you can't enter the marker twice" , hitElement,255,0,0) return end local theTable = details[source] if (theTable) then local model, cash, name, timer = details[source][1], details[source][2], details[source][3], details[source][4] if getElementModel ( vehicle ) == model then if timer then StuntComplete(hitElement,source,cash,name) Entred[hitElement] = source else outputChatBox ( "You have entered in Stunt with wrong vehicle", hitElement, 255, 0, 0 ) end end end end end end end function StuntComplete (player,marker,cash,markerName) if isElement ( player ) then givePlayerMoney ( player, tonumber(cash)) outputChatBox ( "You have completed the Stunt and earned "..tonumber(cash).."$", player, 0, 255, 0 ) if isElement( Blips[marker] ) then setBlipColor ( Blips[marker], 0, 255, 0, 255 ) setMarkerColor (marker,0, 255, 0, 255 ) outputDebugString("done") end local playerAccount = getPlayerAccount (player) if ( playerAccount ) and not isGuestAccount ( playerAccount ) then local totalStunts = getAccountData ( playerAccount, "totalStunts" ) or 0 local name = markerName local rb,gb,bb,ab = getBlipColor (Blips[marker]) local rm,gm,bm,am = getMarkerColor ( marker ) local Det = toJSON({name,rb,gb,bb,ab,rm,gm,bm,am}) setAccountData (playerAccount, "entered.marker", true ) setAccountData (playerAccount, "Details", Det ) setAccountData(playerAccount, "totalStunts" , tonumber(totalStunts)+1) end end end function leaveMar( leaveElement ) if ( isElement ( leaveElement ) and getElementType ( leaveElement ) == "player" ) then setElementData ( leaveElement, "entered.marker", false ) outputChatBox("You failed the Stunt!", leaveElement, 255, 0, 0) end end for i , v in pairs (Markers) do HitMarker = createMarker ( v[2], v[3], v[4], "corona", 1.20, 255, 0, 0, 255 ) Blips[HitMarker] = createBlipAttachedTo( HitMarker, 0 ) details[HitMarker] = {v[1],v[5],v[6],v[7]} addEventHandler( "onMarkerHit", HitMarker, allowedVehicles ) addEventHandler ( "onMarkerLeave", HitMarker, leaveMar) end function stuntsFinished ( player ) if isElement(player) then local playerAccount = getPlayerAccount ( player ) if ( playerAccount ) and not isGuestAccount ( playerAccount ) then local count = getAccountData( playerAccount, "totalStunts" ) or 0 outputChatBox( "You have finished "..tonumber(count).."/512 Stunts", player, 0, 255, 0) end end end addCommandHandler("fstunts", stuntsFinished) function Load (_,cur) local Det = getAccountData(cur,"Details") if Det then local marName,rb,gb,bb,ab,rm,gm,bm,am = unpack(fromJSON(Det)) for i , mar in pairs (getElementsByType("marker")) do local theTable = details[mar] if (theTable) then local name = details[mar][3] if name == tostring(marName) then Entred[source] = mar setMarkerColor (mar,tonumber(rm),tonumber(gm),tonumber(bm),tonumber(am)) end end end end end addEventHandler("onPlayerLogin",root,Load)
  8. LasHa

    AccountData Help

    if timer then How that works?
  9. LasHa

    AccountData Help

    Oh the problem... i put "client" in xml not server sorry. :D but can you help me modify its vector for timing too? "isElementWithinMarker() -- after 3 second check if the player still inside the marker" << This could work. But i don't want that every script had timing...
  10. LasHa

    AccountData Help

    No chatbox, no timer, nothing, just nothing.
  11. LasHa

    AccountData Help

    local Blips = {} local details = {} local Entred = {} local Markers = { {522, 1986, -1478.1, 21.5, 17.500, "Test Stunt #1"}, -- Marker 1 {522, 1114, -1822, 33.5, 17.500, "Test Stunt #2"}, -- Marker 2 {522, 776.8, -1036, 39.5, 9000, "Test Stunt #3"}, -- Marker 3 {522, 1313, -1163, 41, 7500, "Test Stunt #4"}, -- Marker 4 {522, 1404, -806, 85, 7500, "Test Stunt #5"}, -- Marker 5 {522, 775.7, -1060.5, 33.2, 5000, "Test Stunt #6"}, -- Marker 6 } function allowedVehicles( hitElement, matchingDimension ) if matchingDimension and isElement(hitElement) and getElementType(hitElement) == "player" then if isPedInVehicle ( hitElement ) then local vehicle = getPedOccupiedVehicle ( hitElement ) if vehicle then if Entred[hitElement] == source then outputChatBox("Sorry you can't enter the marker twice" , hitElement,255,0,0) return end local theTable = details[source] if (theTable) then local model, cash, name = details[source][1], details[source][2], details[source][3] if getElementModel ( vehicle ) == model then StuntComplete(hitElement,source,cash,name) -- You don't a timer here Entred[hitElement] = source else outputChatBox ( "You have entered in Stunt with wrong vehicle", hitElement, 255, 0, 0 ) end end end end end end function StuntComplete (player,marker,cash,markerName) if isElement ( player ) then givePlayerMoney ( player, tonumber(cash)) outputChatBox ( "You have completed the Stunt and earned "..tonumber(cash).."$", player, 0, 255, 0 ) if isElement( Blips[marker] ) then setBlipColor ( Blips[marker], 0, 255, 0, 255 ) setMarkerColor (marker,0, 255, 0, 255 ) outputDebugString("done") end local playerAccount = getPlayerAccount (player) if ( playerAccount ) and not isGuestAccount ( playerAccount ) then local totalStunts = getAccountData ( playerAccount, "totalStunts" ) or 0 local name = markerName local rb,gb,bb,ab = getBlipColor (Blips[marker]) local rm,gm,bm,am = getMarkerColor ( marker ) local Det = toJSON({name,rb,gb,bb,ab,rm,gm,bm,am}) setElementData (player, "entered.marker", true ) setAccountData (playerAccount, "Details", Det ) setAccountData(playerAccount, "totalStunts" , tonumber(totalStunts)+1) end end end -- I don't know why you need it ??? function leaveMar( leaveElement ) if ( isElement ( leaveElement ) and getElementType ( leaveElement ) == "player" ) then setElementData ( leaveElement, "entered.marker", false ) outputChatBox("You failed the Stunt!", leaveElement, 255, 0, 0) end end for i , v in pairs (Markers) do HitMarker = createMarker ( v[2], v[3], v[4], "corona", 1.20, 255, 0, 0, 255 ) Blips[HitMarker] = createBlipAttachedTo( HitMarker, 0 ) details[HitMarker] = {v[1],v[5],v[6]} addEventHandler( "onMarkerHit", HitMarker, allowedVehicles ) addEventHandler ( "onMarkerLeave", HitMarker, leaveMar) end function stuntsFinished ( player ) if isElement(player) then local playerAccount = getPlayerAccount ( player ) if ( playerAccount ) and not isGuestAccount ( playerAccount ) then local count = getAccountData( playerAccount, "totalStunts" ) or 0 outputChatBox( "You have finished "..tonumber(count).."/512 Stunts", player, 0, 255, 0) end end end addCommandHandler("fstunts", stuntsFinished) function Load (_,cur) local Det = getAccountData(cur,"Details") if Det then local marName,rb,gb,bb,ab,rm,gm,bm,am = unpack(fromJSON(Det)) for i , mar in pairs (getElementsByType("marker")) do local theTable = details[mar] if (theTable) then local name = details[mar][3] if name == tostring(marName) then Entred[source] = mar setMarkerColor (mar,tonumber(rm),tonumber(gm),tonumber(bm),tonumber(am)) end end end end end addEventHandler("onPlayerLogin",root,Load) This is whole script. Can you help me modify it, that i could add stunts which need timers and stunts which doesn't need timer? in vectors. I really want to learn that lua thing. But too hard to understand some complicated things as a beginner.
  12. LasHa

    AccountData Help

    Walid, have you tested this on your local server? Nothing seems to be broken, but still nothing works, not any commandHandler not any outputted chatbox. I got no errors but still nothing works
  13. LasHa

    AccountData Help

    -- I don't know why you need it ??? function leaveMar( leaveElement ) if ( isElement ( leaveElement ) and getElementType ( leaveElement ) == "player" ) then setElementData ( leaveElement, "entered.marker", false ) outputChatBox("You failed the Stunt!", leaveElement, 255, 0, 0) end end Walid i use that thing because if a guy couldn't handle for 3 sec on stunt he fails the stunt and won't be rewarded.
  14. LasHa

    AccountData Help

    Walid you've helped me before on that script too.
  15. LasHa

    AccountData Help

    Can you help me? That's why i am here!
  16. Guys help me please? :3 i tried a lot things but nothing worked. I want to make that when player enters marker, account data saved "finished stunts" and when player relogins the color and the counts of stunt were same as before relogin. :3 I'm beginner scripter and i don't think that i started too low Please Help <3 local TimeTable = {} local waitTime = 3000 -- 3 seconds local Blips = {} local details = {} local Entred = {} local Markers = { {522, 1986, -1478.1, 21.5, 17.500, "Test Stunt #1"}, -- Marker 1 {522, 1114, -1822, 33.5, 17.500,"Test Stunt #2"}, -- Marker 2 {522, 776.8, -1036, 39.5, 9000,"Stunt Name Here"}, -- Marker 3 {522, 1313, -1163, 41, 7500,"Stunt Name Here"}, -- Marker 4 {522, 1404, -806, 85, 7500,"Stunt Name Here"}, -- Marker 5 {522, 775.7, -1060.5, 33.2, 5000,"Stunt Name Here"}, -- Marker 6 } for i , v in pairs (Markers) do HitMarker = createMarker ( v[2], v[3], v[4], "corona", 1.20, 255, 0, 0, 255 ) Blips[HitMarker] = createBlipAttachedTo( HitMarker, 0 ) details[HitMarker] = {v[1],v[5],v[6]} end function allowedVehicles( hitElement, matchingDimension ) if matchingDimension and isElement(hitElement) and getElementType(hitElement) == "player" then if isPedInVehicle ( hitElement ) then local vehicle = getPedOccupiedVehicle ( hitElement ) if vehicle then if Entred[hitElement] == source then outputChatBox("Sorry you can't enter the marker twice" , hitElement,255,0,0) return end local theTable = details[source] if (theTable) then local model, cash, name = details[source][1], details[source][2], details[source][3] if getElementModel ( vehicle ) == model then TimeTable[hitElement] = setTimer(StuntComplete, waitTime, 1, hitElement,source,cash,name) setElementData ( hitElement, "entered.marker", true ) Entred[hitElement] = source else outputChatBox ( "You have entered in Stunt with wrong vehicle", hitElement, 255, 0, 0 ) end end end end end end addEventHandler( "onMarkerHit", resourceRoot, allowedVehicles ) function StuntComplete (player,marker,cash,markerName) if isElement ( player ) then if getElementData ( player, "entered.marker" ) then givePlayerMoney ( player, tonumber(cash)) outputChatBox ( "You have completed the Stunt and earned "..tonumber(cash).."$", player, 0, 255, 0 ) if isElement( Blips[marker] ) then setBlipColor ( Blips[marker], 0, 255, 0, 255 ) setMarkerColor (marker,0, 255, 0, 255 ) end local playerAccount = getPlayerAccount ( player ) if ( playerAccount ) and not isGuestAccount ( playerAccount ) then local totalStunts = getAccountData ( playerAccount, "totalStunts" ) or 0 local name = markerName local rb,gb,bb,ab = getBlipColor ( Blips[marker] ) local rm,gm,bm,am = getMarkerColor ( marker ) local Det = toJSON({name,rb,gb,bb,ab,rm,gm,bm,am}) setAccountData ( playerAccount, "Details", Det ) setAccountData( playerAccount, "totalStunts" , tonumber(totalStunts)+1) end end end end addEventHandler ( "onMarkerLeave", resourceRoot, function ( leaveElement ) if ( isElement ( leaveElement ) and getElementType ( leaveElement ) == "player" ) then setElementData ( leaveElement, "entered.marker", false ) outputChatBox("You failed the Stunt!", leaveElement, 255, 0, 0) end end ) function stuntsFinished ( player ) if isElement(player) then local playerAccount = getPlayerAccount ( player ) if ( playerAccount ) and not isGuestAccount ( playerAccount ) then local count = getAccountData( playerAccount, "totalStunts" ) or 0 outputChatBox( "You have finished "..tonumber(count).."/512 Stunts", player, 0, 255, 0) end end end addCommandHandler("fstunts", stuntsFinished) function Load (_,cur) local Det = getAccountData(cur,"Details") if Det then local marName,rb,gb,bb,ab,rm,gm,bm,am = unpack( fromJSON(Det)) for i , mar in pairs (getElementsByType("marker")) do local theTable = details[mar] if (theTable) then local name = details[mar][3] if name == tostring(marName) then setMarkerColor (mar,tonumber(rm),tonumber(gm),tonumber(bm),tonumber(am)) end end end end end addEventHandler("onPlayerLogin",root,Load)
  17. Let me know how to pm you on facebook and read my private outbox...
  18. Can i pm you on facebook? gonna talk much!
  19. Hello! The New Evolution has started... I, with my great team that isn't complete yet, 'm going to make a project that has never been talked yet in MTA. I'm going to share just some things, so the project won't be stolen. Some of you know Darhal Omar - The great scripter - He is in my team. I'm not even going to tell you the name of new Gamemode. because its name already tells you everything about the Gamemode. Just a few things to know about the project: Castles, Towers, Dragons, Medieval things, Every car changed to phaetons, Every gun changed to Bows/Crossbows/Cannons, Gold Storage in every castle... With many other features By COK Team. We're looking for scripters/mappers/photoshoppers. But the most scripters because we have to work really hard on it. ©Lasha Gabashvili ©Omar C'h If anyone's going to steal my project, i'm deeply sure i'll report him on every forum of MTA, to provide a benefit of fair punishment. For them who're going to join us: Skype: lasha1375 - darhal.omar1 Facebook: https://www.facebook.com/lasha.gabashvili - https://www.facebook.com/darhal.omar?fref=ts Telephone: +995597808002
  20. @CodyL as a proof can i have you? if something happens ofc :D
  21. @Codyl i haven't even started and the idea is very easy to be done and ofc the copy would never be as beautiful as the original one but... if they've got a good developing team they could even easy reach the future of my server...
×
×
  • Create New...