Jump to content

-stolka-

Members
  • Posts

    144
  • Joined

  • Last visited

Everything posted by -stolka-

  1. could someone tell me what's the name of flamethrower 'standing' aimation in ped block?
  2. is there any function to edit players' driving skills ?
  3. hi i found this function on the wiki that get a random player 'getRandomPlayer' is it possible to make a function that do the same thing but cannot get the player i'm using... for exaple if i use the command /random can i get a random player exept myself?
  4. it doesn't work exports.scoreboard:addScoreboardColumn('Country') function showcountry() local flag = exports.admin:getPlayerCountry ( source ) if flag then setElementData( source,"Country",{type="image", src="./admin/client/images/flags/"..flag..".png", width=30, height=20} ) else flag = "N/A" end end addEventHandler("onPlayerJoin",getRootElement(),showcountry)
  5. i downloaded this script but it doesn't work... it outputs the string of the directory insted the flag image exports.scoreboard:addScoreboardColumn('Country') function showcountry() local flag = exports.admin:getPlayerCountry ( source ) if flag then setElementData(source,"Country",":admin/client/images/flags/"..flag..".png") else flag = "N/A" end end addEventHandler("onPlayerJoin",getRootElement(),showcountry)
  6. the debug report error line 7 of server but the clien doesn't even dispay the name of the weapon ( for now there is only one weapon ) server local ammuMarker1 = createMarker(295.30, -38.15, 1000.51, "cylinder", 2,180, 180, 180, 180 ) setElementInterior( ammuMarker1, 1 ) local vehicles = {} function spawnVeh(id, price) if ( getPlayerMoney( source ) >= tonumber( price ) ) then outputChatBox( tostring( id ), source ) takePlayerMoney( source, tonumber( price ) ) giveWeapon(source, id, 90 ) end end addEvent("buyGunForPlayer",true) addEventHandler("buyGunForPlayer", root, spawnVeh) function showAmmuGui(hitPlayer) if hitPlayer and getElementType(hitPlayer) == "player" then triggerClientEvent (hitPlayer,"showAmmuGUI",getRootElement(),hitPlayer) end end addEventHandler("onMarkerHit",ammuMarker1,showAmmuGui) client guiWindowSetSizable( wndAmmu, false ) guiWindowSetMovable( wndAmmu, false ) guns = { {"m4", 500}, } gridAmmu = guiCreateGridList(0.01, 0.2, 0.99, 0.5, true, wndAmmu) guiGridListAddColumn(gridAmmu, "Guns", 0.85) guiGridListAddColumn(gridAmmu, "Price", 0.85) for i,gun in ipairs(guns) do row = guiGridListAddRow(gridAmmu) -- guiGridListSetItemText(gridAmmu, row, 1, tostring(guns[1]), false, false) guiGridListSetItemData(gridAmmu, row, 1, tostring(guns[2])) end function buyGun() local row, col = guiGridListGetSelectedItem(gridAmmu) if (row and col and row ~= -1 and col ~= -1) then local gun = tostring(guiGridListGetItemData(gridAmmu, row, 0)) local price = tonumber(guiGridListGetItemData(gridAmmu, row, 1)) if (( price ~= "" ) and ( gun ~= "" )) then triggerServerEvent("buyGunForPlayer", localPlayer, gun, price) end end end addEventHandler("onClientGUIClick", buyGunBtn, buyGun, false) function closeAmmuGui() if (source == cancelGunBtn) then guiSetVisible(wndAmmu,false) showCursor(false) end end addEventHandler("onClientGUIClick", cancelGunBtn, closeAmmuGui) function showGUIp() guiSetVisible(wndAmmu,true) showCursor(true) end addEvent("showAmmuGUI",true) addEventHandler("showAmmuGUI", getRootElement(), showGUIp)
  7. the debug reports "attempt to perform arithmethic on a nil value line 4" so i tried to see how getBankAccountBalance returns and output it in the chatbox! it outputs 'false' in chatbox function enterClubConfirmed( ) oldBalance = exports [ "bank-reloaded" ]:getBankAccountBalance ( "stolka" ) outputChatBox(tostring(oldBalance)) exports [ "bank-reloaded" ]:setBankAccountBalance ( bankAccount, tonumber( oldBalance ) + 120 ) fadeCamera( player, true, 1.5 ) setElementDimension( player, 2 ) setElementInterior( player, 2 ) end addEvent( "onPlayerClubConfirm", true ) addEventHandler( "onPlayerClubConfirm", getRootElement(), enterClubConfirmed )
  8. so how do i make minigun has unlimited ammo?
  9. what's wrong in this function? addEventHandler( "onWeaponFire", root, function () if ( isElement( source ) ) and ( getElementType( source ) == "player" ) then if getPlayerWeapon( source ) == 38 then giveWeapon ( source, 38, 1 ) end end end )
  10. which is the event that i have to use? i can't find it in the wiki
  11. hi which functions should i use to make a weapon has unlimited ammo?
  12. 4 girls dancing... i wanted to make 'em immortal... i don't know why the debug reports bad argument on all onClientPedDamage events client addEventHandler( "onClientResourceStart", getRootElement( ), function ( ) strip1 = createPed ( 237, -2677.8662109375,1403.3516845703,907.5703125 ) strip2 = createPed ( 238, -2678.0302734375,1409.7257080078,907.5703125 ) strip3 = createPed ( 246, -2673.3210449219,1409.7158203125,907.5703125 ) strip4 = createPed ( 152, -2678.7436523438,1414.4287109375,907.56634521484 ) setElementInterior ( strip1, 3 ) setElementInterior ( strip2, 3 ) setElementInterior ( strip3, 3 ) setElementInterior ( strip4, 3 ) setElementDimension ( strip1, 12 ) setElementDimension ( strip2, 12 ) setElementDimension ( strip3, 12 ) setElementDimension ( strip4, 12 ) setPedAnimation( strip1, "STRIP", "STR_Loop_A", 0, true, false, false ) setPedAnimation( strip2, "STRIP", "STR_A2B", 0, true, false, false ) setPedAnimation( strip3, "STRIP", "STR_C1", 0, true, false, false ) setPedAnimation( strip4, "STRIP", "STR_C2", 0, true, false, false ) end ) function cancelPedDamage ( attacker ) cancelEvent() -- cancel any damage done to peds end addEventHandler ( "onClientPedDamage", strip1, cancelPedDamage ) addEventHandler ( "onClientPedDamage", strip2, cancelPedDamage ) addEventHandler ( "onClientPedDamage", strip3, cancelPedDamage ) addEventHandler ( "onClientPedDamage", strip4, cancelPedDamage )
  13. i have a resource that creates few teams at startup... function createGameTeams () createTeam ("Criminal", 250, 0, 0 ) createTeam ("Delta Force", 0, 153, 0) createTeam ("police", 100, 149, 237) createTeam ("Pilot", 255, 255, 0 ) createTeam ("Taxi Driver", 255, 255, 0) createTeam ("Medic", 6, 183, 248) end addEventHandler ("onResourceStart", resourceRoot, createGameTeams) that's the only thing it does... why when i restart it i cannot join a team any more?
  14. i tested it.. it doesn't work any help?
  15. i cant test it right now... is it correct x,y,z = getElementPosition( source ) local ho = {} ho[0] = { 2036.1735839844, -1413.0563964844, 16.9921875, 0 } ho[1] = { -2656.12, 631.01, 14.45, 0 } ho[2] = { 1607.07, 1825.3, 10.83, 0 } ho[0][3] = getDistanceBetweenPoints3D ( x,y,z,ho[0][0], ho[0][1], ho[0][2] ) ho[1][3] = getDistanceBetweenPoints3D ( x,y,z,ho[1][0], ho[1][1], ho[1][2] ) ho[2][3] = getDistanceBetweenPoints3D ( x,y,z,ho[2][0], ho[2][1], ho[2][2] ) local e=0 local i=0 local xs,ys,zs for e=0,3,1 do if ho[e][3] < ho[e+1][3] then xs = ho[e][0] ys = ho[e][1] zs = ho[e][2] end end setTimer (spawnPlayer, 1000, 1, source, xs,ys,zs, 0, getPedSkin (source), 0, 0, getPlayerTeam(source)) setTimer (setCameraTarget, 1250, 1, source, source)
  16. well there are no topics that use this system
  17. Take a look at this one: https://community.multitheftauto.com/index.php?p=resources&s=details&id=9056. Specially made to work with this group system and open source as well. Just remember to verify that the exported functions to get turf color and team color are in the meta.xml file of the group system. <export function="getGroupChatColor" type="server"/> <export function="getGroupTurfColor" type="server"/> It's currently in an early beta state and has only been quickly scripted and tested so there are some configuration to do to make it work, like a few variable names and other exports, but except for that it seems to be pretty appreciated after all. For some reason the whole inspiration for the turf system came from this group system so a special thanks to Smart for the group system. I have a question about your turf system.. it works but when i create a turf and i capture it, then i restart the resource the turf gets created but the owner is set to 'none'
  18. these 3 arrays are the cordinates of three hospitals, the fourth value is the distance... how do i make the player spawn ant the nearest one? x,y,z = getElementPosition( source ) local ho = {} ho[0] = { 2036.1735839844, -1413.0563964844, 16.9921875, 0 } -- x, y, z, distance ho[1] = { -2656.12, 631.01, 14.45, 0 } ho[2] = { 1607.07, 1825.3, 10.83, 0 } -- change 0 calculating the distance between the position of the player and the hospital ho[0][3] = getDistanceBetweenPoints3D ( x,y,z,ho[0][0], ho[0][1], ho[0][2] ) ho[1][3] = getDistanceBetweenPoints3D ( x,y,z,ho[1][0], ho[1][1], ho[1][2] ) ho[2][3] = getDistanceBetweenPoints3D ( x,y,z,ho[2][0], ho[2][1], ho[2][2] )
  19. thanks, i couldn't find it cause i searched for ac-message and not ac_message..
  20. Take a look at this one: https://community.multitheftauto.com/index.php?p=resources&s=details&id=9056. Specially made to work with this group system and open source as well. Just remember to verify that the exported functions to get turf color and team color are in the meta.xml file of the group system. <export function="getGroupChatColor" type="server"/> <export function="getGroupTurfColor" type="server"/> It's currently in an early beta state and has only been quickly scripted and tested so there are some configuration to do to make it work, like a few variable names and other exports, but except for that it seems to be pretty appreciated after all. For some reason the whole inspiration for the turf system came from this group system so a special thanks to Smart for the group system. co thanks.. can you give me a working link for the resource 'ac-message' ?
  21. how do i put web information such as the number of player in the server and the status in my website???
  22. the debug reports two errors line 79: createColCuboid line 80: expectedElemnt at argument 1 local turfPos = { { 2133.1950683594, 633.66455078125, 0, 197.5, 92, 90 }, { 2486.5935058594, 678.20172119141, 0, 245, 133, 30 }, { 1856.2864990234, 627.07629394531, 0, 138.25, 152.75, 90 }, { 1576.8956298828, 662.84362792969, 0, 181, 120.5, 90 }, { 1577.6783447266, 943.66607666016, 0, 190, 190, 90 }, { 1383.4364013672, 909.61499023438, 0, 142, 230, 90 }, { 956.94744873047, 1011.635925293, 0, 220, 140, 90 }, { 1017.7476196289, 1203.4068603516, 0, 180, 165, 90 }, { 1017.623046875, 1383.4741210938, 0, 190, 290, 90 }, { 917.99707031253, 1623.6003417969, 0, 80, 220, 90 }, { 1017.7178955078, 1862.6740722656, 0, 140, 180, 90 }, { 912.50573730469, 1958.6761474609, 0, 90, 230, 90 }, { 1017.3455200195, 2063.38671875, 0, 150, 300, 90 }, { 1300.7644042969, 2095.5100097656, 0, 200, 140, 90 }, { 1398.1997070313, 2323.5505371094, 0, 160, 65, 90 }, { 1578.1955566406, 2284.0825195313, 0, 180, 110, 90 }, { 1237.6285400391, 2581.4663085938, 0, 450, 130, 90 }, { 1780.478515625, 2567.2121582031, 0, 130, 130, 90 }, { 1698.2750244141, 2724.494140625, 0, 200, 150, 90 }, { 2237.9494628906, 2723.7814941406, 0, 180, 110, 90 }, { 2498.6853027344, 2704.6188964844, 0, 300, 140, 90 }, { 2798.1267089844, 2303.9643554688, 0, 120, 300, 90 }, { 2557.5688476563, 2243.4963378906, 0, 100, 230, 90 }, { 2532.5830078125, 2063.4118652344, 0, 100, 150, 90 }, { 2558.1779785156, 1624.0816650391, 0, 100, 300, 90 }, { 2437.685546875, 1483.7209472656, 0, 160, 120, 90 }, { 2077.7106933594, 1203.5559082031, 0, 340, 170, 90 }, { 2082.3193359375, 979.23583984375, 0, 270, 210, 90 } } local areaPos = { { 2130, 630, 200, 100 }, { 2488.8793945313, 680.78289794922, 250, 130 }, { 1858, 623, 140, 165 }, { 1577, 663, 180, 130 }, { 1577, 943, 185, 190 }, { 1383, 909, 120, 230 }, { 956, 1011, 220, 140 }, { 1017, 1203, 180, 165 }, { 1017, 1383, 190, 290 }, { 917, 1623, 80, 220 }, { 1017, 1862, 140, 180 }, { 912, 1958, 90, 240 }, { 1017, 2063, 150, 300 }, { 1300, 2092, 200, 140 }, { 1398, 2323, 160, 65 }, { 1578, 2284, 180, 110 }, { 1237, 2581, 450, 130 }, { 1780, 2567, 130, 130 }, { 1698, 2724, 200, 150 }, { 2237, 2723, 180, 110 }, { 2498, 2704, 300, 140 }, { 2798, 2303, 120, 300 }, { 2557, 2243, 100, 230 }, { 2532, 2063, 100, 150 }, { 2558, 1624, 100, 300 }, { 2437, 1483, 160, 120 }, { 2077, 1203, 340, 170}, { 2082, 979, 270, 210 } } local turfElement = {} local turfTimer = {} checkComplete = false addEventHandler("onResourceStart", resourceRoot, function() executeSQLQuery("CREATE TABLE IF NOT EXISTS Turf_System ( Turfs TEXT, GangOwner TEXT, r INT, g INT, b INT)") local check = executeSQLQuery("SELECT * FROM Turf_System" ) if #check == 0 then for i=1,#turfPos do executeSQLQuery("INSERT INTO Turf_System(Turfs,GangOwner,r,g,b) VALUES(?,?,?,?,?)", "Turf["..tostring(i).."]", "Nadie", 0, 255, 0) end end for i,v in ipairs(turfPos) do local sqlData = executeSQLQuery("SELECT * FROM Turf_System WHERE Turfs=?", "Turf["..tostring(i).."]") local turfCol = createColCuboid(unpack(turfPos)) setElementData(turfCol, "getTurfGang", sqlData[1].GangOwner) local arg1,arg2,arg3,arg4 = unpack(areaPos[i]) local turfArea = createRadarArea(arg1, arg2, arg3, arg4, sqlData[1].r, sqlData[1].g, sqlData[1].b, 175) turfElement[turfCol] = {turfCol, turfArea, i} end outputDebugString("Turf System by Sasuke* was started correctly!") end ) function radar ( player ) local turf,area,id = turfElement[player] if turf and area and source == turf then local playerGang = exports [ "groupsys" ]:getPlayerGroup( player ) local turfGang = executeSQLQuery("SELECT GangOwner FROM Turf_System WHERE Turfs=?", "Turf["..tostring(id).."]" ) if ( turfGang[1].GangOwner == playerGang ) then outputChatBox("This territory already belongs to "..turfGang[1].GangOwner or "None", player, 0, 255, 0, false) else if not getPlayerTeam(player) then return end local team = getPlayerTeam ( player ) if getPlayerName( player ) then local playerGang = exports [ "groupsys" ]:getPlayerGroup( player ) if ( isTimer ( turfTimer[source] ) ) then return end if ( playerGang ) then local r, g, b = exports [ "groupsys" ]:getGroupChatColor ( playerGang ) setRadarAreaFlashing ( area, true ) if turfGang[1].GangOwner ~= "Nadie" then outputChatBox("You enter into the "..turfGang[1].GangOwner.."'s turf zone. Wait 2 minutes to capture the turf and win 4k", player, 0, 255, 0, false) else outputChatBox("This turf do not belong to anyone. Wait 2 minutes to capture the turf and win 4k", player, 0, 255, 0, false) end turfTimer[source] = setTimer ( function ( ) local beachTurfCplayers = getElementColShape ( turf ) local players = getElementsWithinColShape ( turf, "player" ) setRadarAreaColor ( area, tonumber(r), tonumber(g), tonumber(b), 175 ) for _, player in ipairs ( players ) do if exports [ "groupsys" ]:getPlayerGroup( player ) == playerGang then outputChatBox("Congratulations. You capture the turf. +10K!", player, 0, 255, 0, false) triggerClientEvent("onTakeTurf", player) givePlayerMoney ( player, 10000 ) executeSQLQuery("UPDATE Turf_System SET GangOwner=?,r=?,g=?,b=? WHERE Turfs=?", playerGang, tonumber(r), tonumber(g), tonumber(b), "Turf["..tostring(id).."]" ) -- setElementData ( turf, "getTurfGang", playerGang ) end end setRadarAreaFlashing ( area, false ) end ,120000, 1) -- 120000, 2 min end end end end end addEventHandler ( "onColShapeHit", root, radar )
  23. i just created an account called 'smart' but it still doesnt give the same error
  24. I added this line outputChatBox( tostring( data.account ) ) it outputs 'smart' in the chatbox
×
×
  • Create New...