ali
Members-
Posts
132 -
Joined
-
Last visited
Everything posted by ali
-
no errors and its not setting the stat
-
if i use onClientVehicleExplode or onVehicleExplode then how will it add the players stat?
-
I mean when i destroy one car it shows that i destroyed 35 cars and when i destroyed 2 cars it showed 70 cars in the Gui given above
-
this worked a bit but this makes 1 car detroying like 35 cars
-
[2013-01-14 18:39:20] WARNING: ali\logss.lua:2: Bad 'ped' pointer @ 'getPedStat'(1) [2013-01-14 18:39:20] ERROR: ali\logss.lua:3: attempt to perform arithmetic on local 'ils' (a boolean value)
-
now there are no errors but still here is the full codes client: marker55 = createMarker( 1000, 1000, 47,"cylinder", 1.5, 255, 225, 0 ) GUIEditor = { window = {}, } GUIEditor.window[1] = guiCreateWindow(321, 142, 694, 532, "Stats", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) Cars = guiCreateLabel(8, 42, 325, 36, "", false, GUIEditor.window[1]) guiSetFont(Cars, "default-bold-small") Helicopters = guiCreateLabel(10, 110, 325, 36, "", false, GUIEditor.window[1]) guiSetFont(Helicopters, "default-bold-small") Boats = guiCreateLabel(10, 176, 325, 36, "", false, GUIEditor.window[1]) guiSetFont(Boats, "default-bold-small") BikeSkills = guiCreateLabel(10, 248, 325, 36, "", false, GUIEditor.window[1]) guiSetFont(BikeSkills, "default-bold-small") CycleSkills = guiCreateLabel(10, 328, 325, 36, "", false, GUIEditor.window[1]) guiSetFont(CycleSkills, "default-bold-small") Muscles = guiCreateLabel(10, 415, 325, 36, "", false, GUIEditor.window[1]) guiSetFont(Muscles, "default-bold-small") guiSetVisible(GUIEditor.window[1], false) showCursor(false) function MarkerHit (hitPlayer) if ( hitPlayer == localPlayer ) then guiSetVisible (GUIEditor.window[1], true) showCursor (true) end end addEventHandler ( "onClientMarkerHit", marker55, MarkerHit ) addEventHandler("onClientRender", root, function () local heli = getPedStat( localPlayer, 124) local car = getPedStat( localPlayer, 122) local boa = getPedStat( localPlayer, 123) local bike = getPedStat( localPlayer, 229) local cycle = getPedStat( localPlayer, 230) local Muss = getPedStat( localPlayer, 23) guiSetText(Cars, "Cars Destroyed: " ..car) guiSetText(Helicopters, "Helicopters Destroyed: " ..heli) guiSetText(Boats, "Boats Destroyed: " ..boa) guiSetText(BikeSkills, "Bike Skills: " ..bike) guiSetText(CycleSkills, "cycle Skills : " ..cycle) guiSetText(Muscles, "Your Muscles: " ..Muss) end ) function firing( _, _, _, _, _, _, hitElement) if hitElement and getElementType( hitElement ) == "Vehicle" then triggerServerEvent("onFire", getRootElement()) end end addEventHandler("onClientPlayerWeaponFire", getRootElement(), firing ) server: function iii( ) local ils = getPedStat( source, 122) setPedStat( localPlayer, 122, ils+1 ) end function lll( ) local ilss = getPedStat( source, 123) setPedStat( localPlayer, 123, ilss+1 ) end function ooo( ) local il = getPedStat( source, 122) setPedStat( localPlayer, 124, il+1 ) end function add() if (getVehicleType ( source ) == "Automobile")then addEventHandler("onVehicleExplode", getRootElement, iii) else if (getVehicleType ( source ) == "Helicopter")then addEventHandler("onVehicleExplode", getRootElement, ooo) else if (getVehicleType ( source ) == "Boat")then addEventHandler("onVehicleExplode", getRootElement, lll) end end end end addEvent("onFire",true) addEventHandler("onFire", getRootElement(), add ) [url=http://speedy.sh/DqzSy/mta-screen-2013-01-14-18-09-31.png]http://speedy.sh/DqzSy/mta-screen-2013- ... -09-31.png[/url]
-
still its giving [2013-01-14 17:50:05] WARNING: ali\logsss.lua:57: Bad argument @ 'getElementType
-
client function firing(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement) if getElementType(hitElement)== "Vehicle" then triggerServerEvent("onFire", getRootElement()) end end addEventHandler("onClientPlayerWeaponFire", getRootElement(), firing ) server function iii( ) local ils = getPedStat( localPlayer, 122) setPedStat( localPlayer, 122, ils+1 ) end function lll( ) local ilss = getPedStat( localPlayer, 123) setPedStat( localPlayer, 123, ilss+1 ) end function ooo( ) local il = getPedStat( localPlayer, 122) setPedStat( localPlayer, 124, il+1 ) end function add(theVehicle) if (getVehicleType ( theVehicle ) == "Automobile")then addEventHandler("onVehicleExplode", getRootElement, iii) else if (getVehicleType ( theVehicle ) == "Helicopter")then addEventHandler("onVehicleExplode", getRootElement, ooo) else if (getVehicleType ( theVehicle ) == "Boat")then addEventHandler("onVehicleExplode", getRootElement, lll) end end end end addEvent("onFire",true) addEventHandler("onFire", getRootElement(), add ) error In Client :
-
marker55 = createMarker( 1000, 1000, 47,"cylinder", 1.5, 255, 225, 0 ) GUIEditor = { staticimage = {}, window = {}, } GUIEditor.window[1] = guiCreateWindow(321, 142, 694, 532, "Stats", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) Cars = guiCreateLabel(8, 42, 325, 36, "", false, GUIEditor.window[1]) guiSetFont(Cars, "default-bold-small") Helicopters = guiCreateLabel(10, 110, 325, 36, "", false, GUIEditor.window[1]) guiSetFont(Helicopters, "default-bold-small") Boats = guiCreateLabel(10, 176, 325, 36, "", false, GUIEditor.window[1]) guiSetFont(Boats, "default-bold-small") BikeSkills = guiCreateLabel(10, 248, 325, 36, "", false, GUIEditor.window[1]) guiSetFont(BikeSkills, "default-bold-small") CycleSkills = guiCreateLabel(10, 328, 325, 36, "", false, GUIEditor.window[1]) guiSetFont(CycleSkills, "default-bold-small") GUIEditor.staticimage[1] = guiCreateStaticImage(383, 56, 203, 296, ":lils/images/examples/mtalogo.png", false, GUIEditor.window[1]) Muscles = guiCreateLabel(10, 415, 325, 36, "", false, GUIEditor.window[1]) guiSetFont(Muscles, "default-bold-small") guiSetVisible(GUIEditor.window[1], false) showCursor(false) function MarkerHit (hitPlayer) if ( hitPlayer == localPlayer ) then guiSetVisible (GUIEditor.window[1], true) showCursor (true) end end addEventHandler ( "onClientMarkerHit", marker55, MarkerHit ) addEventHandler("onClientRender", root, function (localPlayer) local heli = getPedStat( localPlayer, 124 ) local car = getPedStat( localPlayer, 122 ) local boa = getPedStat( localPlayer, 123 ) local bike = getPedStat( localPlayer, 229 ) local cycle = getPedStat( localPlayer, 230 ) local Muss = getPedStat( localPlayer, 23 ) guiSetText(Cars, "Cars Destroyed: " ..car.. ) guiSetText(Helicopters, "Helicopters Destroyed: " ..heli.. ) guiSetText(Boats, "Boats Destroyed: " ..Boat.. ) guiSetText(BikeSkills, "Bike Skills: " ..Bike.. ) guiSetText(CycleSkills, "cycle Skills : " ..cycle.. ) guiSetText(Muscles, "Your Muscles: " ..Muss.. ) end ) errors
-
try this function idk () local X, Y, Z = 2279.1000976563, -1671.1999511719, 15.10000038147 abcvehicle = createVehicle ( 602, X, Y, Z ) addEventHandler("onVehicleStartEnter", abcvehicle, abc ) end addEventHandler ( "onResourceStart", resourceRoot, idk ) function abc ( thePlayer, seat, jacked ) local accname = getAccountName ( getPlayerAccount ( thePlayer ) ) if accname == "Alen" then outputChatBox ("Welcome to your vehicle,Sir!", thePlayer, 0,255,0) else cancelEvent() outputChatBox("This vehicle is private", thePlayer, 255, 0, 0) end end
-
this was suppoesed to be spawn protection Server: addEventHandler("onPlayerSpawn",root, function () setElementData(source,"spawn_state","spawn",true ) end) addEventHandler("onPlayerDamage", root , function (thePlayer) local state = getElementData(thePlayer,"spawn_state") if tostring(state) == "spawn" then cancelEvent( ) end end ) setTimer( function (player) local state = getElementData(player,"spawn_state") if tostring(state) == "spawn" then setElementData(source,"spawn_state","finish",true) end end , 50000 , 0 )
-
My Above script ( tested )
-
hydra = createVehicle ( 520, 1526.5999755859, 2877.1000976563, 13.89999961853, 0, 0, 90 ) function hydralock(player, seat, jacked) local level = tonumber ( getElementData ( player, "level" ) or 0 ) if (source == hydra) then if (seat == 0) then if (level <= 7) then cancelEvent() outputChatBox ( "To enter this hydra you need to be level 7 and higher", player, 255, 0, 0, true ) end end end end addEventHandler ( "onVehicleStartEnter", hydra, hydralock) 1)you forgot to mention which vehicle it should be the name of vehicle in-place of getRootElement() 2)an extra End
-
https://wiki.multitheftauto.com/wiki/Scripting_Introduction
-
I CURRENTLY DONT HAVE MTA in my PC
-
createTeam spawnPlayer setElementModel giveWeapon
-
nvm found it it is http://codepad.org/
-
some time ago a guy had a website in his signiture which tells errors in scripts