-
Posts
525 -
Joined
-
Last visited
-
Days Won
3
Everything posted by justn
-
Hi, i have problem with a code, when the player clicks the get job button, nothing happens ( dont get errors in debugscript ) Client: addEventHandler("onClientGUIClick",CriminalWindow, function(b) if b == "left" then if source == CriminalGetJob then if ( getElementData ( localPlayer, "Occupation" ) == "Unemployed" ) then local CrimBox = guiComboBoxGetSelected(CriminalComboBox) local CrimType = guiComboBoxGetItemText(CriminalComboBox, CrimBox) if ( CrimType ) ~= "Please select your criminal type .." then triggerServerEvent("gotCrimJob",getLocalPlayer(),CrimType) guiSetVisible(CriminalGetJob,false) guiSetVisible(CriminalWindow,false) showCursor(false) guiSetText(RCrimLabel, #guiGetText(RCrimLabel) .."Criminal Type: "..CrimType) exports["TopBarChat"]:sendClientMessage("You are now a criminal !",255, 0, 0, true) CriminalQuitJob = guiCreateButton(10, 286, 122, 34, "Quit Job", false, CriminalWindow) elseif ( getElementData ( localPlayer, "Occupation" ) ~= "Unemployed" ) then guiSetVisible(CriminalWindow,false) guiSetVisible(JobM_Window,true) showCursor(true) elseif ( CrimType ) == "Please select your criminal type .." then exports["TopBarChat"]:sendClientMessage("You haven't selected a criminal type !",255, 0, 0, true) end end end end end) Server; function gotTheJob (CrimType) local CriminalTeam = getTeamFromName ( "Criminal" ) if ( CriminalTeam ) then setElementModel ( source, 0 ) setPlayerTeam ( source, CriminalTeam ) setElementData ( source, "Occupation", CrimType ) end end addEvent("gotCrimJob",true) addEventHandler ( "gotCrimJob", getRootElement(), gotTheJob )
-
Hey, so i have this /kill command, how do i make so every 1 second ? the killSeconds will be -1 exports["TopBarChat"]:sendClientMessage("#FF0000You will die in #00FF00"..tonumber(killSeconds-1).."#FF0000 seconds",255,255,255,true)
-
Hi, how do i get if the player has a color code ? and if he does, then remove it.. Thanks.
-
Hi, so the problem i have here, is the text shows, then it doesnt, everytime i restart the resource, the text shows and disappears within 1 second, can you help fix this problem please? local GrenadeLaunchers = 0 local GrenadeLText = dxDrawText(GrenadeLaunchers, 986, 0, 1018, 49, tocolor(255, 255, 255, 255), 1.50, "bankgothic", "left", "top", false, false, true, false, false) addEventHandler("onClientPlayerWeaponSwitch",getRootElement(),function(prevSlot,newSlot) if getPedWeapon(getLocalPlayer(),newSlot) == 30 or getPedWeapon(getLocalPlayer(),newSlot) == 31 then setElementVisibleTo(GrenadeLText,localPlayer,true) setElementVisibleTo(GrenadeLText,root,false) else setElementVisibleTo(GrenadeLText,localPlayer,false) setElementVisibleTo(GrenadeLText,root,false) end end)
-
._. I don't think you're gonna get help acting like that
-
It's outputChatBox not outputChatbox
-
Now i tried this and it dont work. Server: function warpIntoBoat() CaptainVehicle = createVehicle(472,2430.1584472656,-2298.5764160156,-0.55000001192093) warpPedIntoVehicle(source,CaptainVehicle) end addEvent("warpIntoBoat",true) addEventHandler("warpIntoBoat",getRootElement(),warpIntoBoat) Client: addEventHandler("onClientGUIDoubleClick",CaptainJob_Window, function(b) if b == "left" then if source == CaptainJob_Grid then Location1 = guiGridListGetSelectedItem(CaptainJob_Grid, CaptainJob_Row, CaptainJob_Location ) Money_Location = guiGridListGetSelectedItem(CaptainJob_Grid, CaptainJob_Row, CaptainJob_Money ) if ( Location1 ) then x, y, z = unpackDestinations () CaptainMarker = createMarker ( x, y, z, "cylinder", 3, 255, 51, 102, 85, localPlayer ) CaptainAttachedBlip = createBlipAttachedTo(CaptainMarker,9) triggerServerEvent("warpIntoBoat",localPlayer) setElementVisibleTo( CaptainAttachedBlip, localPlayer, true ) setElementVisibleTo( CaptainAttachedBlip, root, false ) elseif not ( Location1 ) then outputChatBox ( "You haven't selected a location", 255, 255, 255 ) end end end end)
-
The problem is, the player cant enter the vehicle, and he doesnt get warped into it Client: addEventHandler("onClientGUIDoubleClick",CaptainJob_Window, function(b) if b == "left" then if source == CaptainJob_Grid then Location1 = guiGridListGetSelectedItem(CaptainJob_Grid, CaptainJob_Row, CaptainJob_Location ) Money_Location = guiGridListGetSelectedItem(CaptainJob_Grid, CaptainJob_Row, CaptainJob_Money ) if ( Location1 ) then x, y, z = unpackDestinations () CaptainMarker = createMarker ( x, y, z, "cylinder", 3, 255, 51, 102, 85, localPlayer ) CaptainAttachedBlip = createBlipAttachedTo(CaptainMarker,9) CaptainVehicle = createVehicle(472,2430.1584472656,-2298.5764160156,-0.55000001192093) triggerServerEvent("warpIntoBoat",localPlayer,thePlayer,CaptainVehicle) setElementVisibleTo( CaptainAttachedBlip, localPlayer, true ) setElementVisibleTo( CaptainAttachedBlip, root, false ) elseif not ( Location1 ) then outputChatBox ( "You haven't selected a location", 255, 255, 255 ) end end end end) Server: function warpIntoBoat(thePlayer,CaptainVehicle) warpPedIntoVehicle(thePlayer,CaptainVehicle) end addEvent("warpIntoBoat",true) addEventHandler("warpIntoBoat",getRootElement(),warpIntoBoat)
-
So i have this code, and the problem is, the gate doesn't open when the player hits it , can someone help please? local EPAGate = createObject(980, 1024.0999755859, -368.60000610352, 75.699996948242, 0, 0, 358.73950195313) local EPAMark = createMarker( 1023.9000244141, -367.70001220703, 73.699996948242, "corona", 5, 255, 255, 255, 255 ) addEventHandler ("onClientMarkerHit", EPAMark, function(hitPlayer, matchingDimension) if isElementWithinMarker(hitPlayer, EPAMark) and getTeamName(getPlayerTeam(hitPlayer) == "Elite Police Academy" ) then moveObject ( EPAGate, 2000, 1024.0999755859, -368.60000610352, 81.099998474121, 0, 0, 358.73950195313) end end) addEventHandler ("onClientMarkerLeave", EPAMark, function(hitPlayer, matchingDimension) if getTeamName(getPlayerTeam(hitPlayer) == "Elite Police Academy" ) then moveObject ( EPAGate, 2000, 1024.0999755859, -368.60000610352, 75.699996948242, 0, 0, 358.73950195313) end end)
-
The team does exist, I set my team to civillian, then i reconnect, and then im in no team
-
Your code doesn't work for some reason, No errors in debugscript.
-
Hi, I have this code, but the problem is it doesn't save the player's team , can someone help please? Thank you ! function onQuit () local account = getPlayerAccount(source) if account and not (isGuestAccount (account)) then local x,y,z = getElementPosition (source) local occupation = getElementData ( source, "Occupation" ) setAccountData (account, "myCash", tostring (getPlayerMoney (source))) setAccountData (account, "posX", x) setAccountData (account, "posY", y) setAccountData (account, "posZ", z) setAccountData (account, "Occupation", occupation ) setAccountData (account, "theSkin", tostring (getPedSkin (source))) setAccountData (account, "theInt", getElementInterior (source)) setAccountData (account, "theDim", getElementDimension (source)) setAccountData (account, "theWep0", getPedWeapon (source, 0)) setAccountData (account, "theWep1", getPedWeapon (source, 1)) setAccountData (account, "theWep2", getPedWeapon (source, 2)) setAccountData (account, "theWep3", getPedWeapon (source, 3)) setAccountData (account, "theWep4", getPedWeapon (source, 4)) setAccountData (account, "theWep5", getPedWeapon (source, 5)) setAccountData (account, "theWep6", getPedWeapon (source, 6)) setAccountData (account, "theWep7", getPedWeapon (source, 7)) setAccountData (account, "theWep8", getPedWeapon (source, 8)) setAccountData (account, "theWep9", getPedWeapon (source, 9)) setAccountData (account, "theWep10", getPedWeapon (source, 10)) setAccountData (account, "theWep11", getPedWeapon (source, 11)) setAccountData (account, "theWep12", getPedWeapon (source, 12)) setAccountData (account, "theAmmo0", getPedTotalAmmo (source, 0)) setAccountData (account, "theAmmo1", getPedTotalAmmo (source, 1)) setAccountData (account, "theAmmo2", getPedTotalAmmo (source, 2)) setAccountData (account, "theAmmo3", getPedTotalAmmo (source, 3)) setAccountData (account, "theAmmo4", getPedTotalAmmo (source, 4)) setAccountData (account, "theAmmo5", getPedTotalAmmo (source, 5)) setAccountData (account, "theAmmo6", getPedTotalAmmo (source, 6)) setAccountData (account, "theAmmo7", getPedTotalAmmo (source, 7)) setAccountData (account, "theAmmo8", getPedTotalAmmo (source, 8)) setAccountData (account, "theAmmo9", getPedTotalAmmo (source, 9)) setAccountData (account, "theAmmo10", getPedTotalAmmo (source, 10)) setAccountData (account, "theAmmo11", getPedTotalAmmo (source, 11)) setAccountData (account, "theAmmo12", getPedTotalAmmo (source, 12)) local team = getPlayerTeam(source) if (team) and not isGuestAccount(account) then setAccountData(account, "team", getTeamName(team)) end end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit) function assigntheteam (old, acc) local acc = getPlayerAccount(source) local firstTime = getAccountData(acc, 'firstTime') local Unemployed = getTeamFromName ( "Unemployed" ) if ( Unemployed ) then if not firstTime then setPlayerTeam(source, Unemployed) spawnPlayer(source, 1643.40002, -2249.10009, 13.300, 178.0004, 0, 0, 0, Unemployed) fadeCamera(source, true) setPlayerMoney ( source, 2000 ) setCameraTarget(source, source) setAccountData(acc, 'firstTime', 'true') setElementData ( source, "Occupation", "Unemployed" ) giveWeapon ( source, 23, 200 ) giveWeapon ( source, 25, 200 ) else local playerMoney = getAccountData (acc, "myCash") local playerSkin = getAccountData (acc, "theSkin") local playerInt = getAccountData (acc, "theInt") local playerDim = getAccountData (acc, "theDim") local playerX = getAccountData (acc, "posX") local playerY = getAccountData (acc, "posY") local playerZ = getAccountData (acc, "posZ") local team = getAccountData (acc, "team") local playerWeaponID0 = getAccountData (acc, "theWep0") local playerWeaponID1 = getAccountData (acc, "theWep1") local playerWeaponID2 = getAccountData (acc, "theWep2") local playerWeaponID3 = getAccountData (acc, "theWep3") local playerWeaponID4 = getAccountData (acc, "theWep4") local playerWeaponID5 = getAccountData (acc, "theWep5") local playerWeaponID6 = getAccountData (acc, "theWep6") local playerWeaponID7 = getAccountData (acc, "theWep7") local playerWeaponID8 = getAccountData (acc, "theWep8") local playerOccupation = getAccountData (acc, "Occupation" ) local playerWeaponID9 = getAccountData (acc, "theWep9") local playerWeaponID10 = getAccountData (acc, "theWep10") local playerWeaponID11 = getAccountData (acc, "theWep11") local playerWeaponID12 = getAccountData (acc, "theWep12") local playerWeaponAmmo0 = getAccountData (acc, "theAmmo0") local playerWeaponAmmo1 = getAccountData (acc, "theAmmo1") local playerWeaponAmmo2 = getAccountData (acc, "theAmmo2") local playerWeaponAmmo3 = getAccountData (acc, "theAmmo3") local playerWeaponAmmo4 = getAccountData (acc, "theAmmo4") local playerWeaponAmmo5 = getAccountData (acc, "theAmmo5") local playerWeaponAmmo6 = getAccountData (acc, "theAmmo6") local playerWeaponAmmo7 = getAccountData (acc, "theAmmo7") local playerWeaponAmmo8 = getAccountData (acc, "theAmmo8") local playerWeaponAmmo9 = getAccountData (acc, "theAmmo9") local playerWeaponAmmo10 = getAccountData (acc, "theAmmo10") local playerWeaponAmmo11 = getAccountData (acc, "theAmmo11") local playerWeaponAmmo12 = getAccountData (acc, "theAmmo12") setPlayerMoney (source, tonumber(playerMoney)) spawnPlayer (source, playerX, playerY, playerZ +1, 0, playerSkin, playerInt, playerDim) 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) setElementData ( source, "Occupation", playerOccupation ) setCameraTarget(source) local skin = getAccountData(acc,"skin") if (skin) then setElementModel(source, skin) end if getElementModel(source) == 0 then for i=1,16 do local typeclothes = getAccountData(acc,"clothes "..tonumber(i).."") local textclothes = getAccountData(acc,"textclothes "..tonumber(i).."") local modclothes = getAccountData(acc,"modclothes "..tonumber(i).."") addPedClothes (source,tostring(textclothes),tostring(modclothes),tonumber(typeSelected)) -- FOR TEAM if (team) and getTeamFromName(team) then setPlayerTeam(source, team) -- fadeCamera(source, true) end end end end end end addEvent ( "IfNewPlayerJoin", true ) addEventHandler ( "IfNewPlayerJoin", getRootElement(), assigntheteam ) addEventHandler ("onPlayerLogin", getRootElement(), assigntheteam)
-
I'll help you with armaAA and you just do the same for the others NOT TESTED Client: function armaAA ( thePlayer, hitElement ) showCursor ( true ) triggerServerEvent ( "armaAA", thePlayer, thePlayer, hitElement ) end Server: function armaAA ( thePlayer,hitElement ) if ( thePlayer == source ) then if ( getPlayerMoney(hitElement) >= 2000 ) then takePlayerMoney ( hitElement, 2000 ) giveWeapon ( hitElement, 31, 100 ) givePlayerMoney (thePlayer, 10000) end end end addEvent( "armaAA", true ) addEventHandler( "armaAA", getRootElement(), armaAA )
-
@HyPeX Apparently, when someone buy weapons from the dealer, hes wants to give the dealer the money, but it's not working .. he already said what the problem is.
-
@gghvcffcv Do you have errors in debugscript 3 ? Also can i see the part where you triggered the events ?
-
Well the thing is.. i don't really understand how im doing it for clothes store
-
Try this: local markers = {} function consoleCreateMarker ( thePlayer, commandName ) if not markers [ thePlayer ] then local x, y, z = getElementPosition ( thePlayer ) markers [ thePlayer ] = createMarker ( x, y, z - 1, "cylinder", 1.5, 255, 0, 0, 170 ) if ( markers [ thePlayer ] ) then setElementData(markers [ thePlayer ], "markerType", "WeaponShop") setElementFrozen( thePlayer, true ) outputConsole ( "Marker created successfully", thePlayer ) else outputConsole ( "Failed to create marker", thePlayer ) end else outputChatBox ( "You're selling already.", thePlayer, 255, 0, 0 ) end end addCommandHandler ( "sell", consoleCreateMarker, false, false ) function para( thePlayer, commandName ) if markers [ thePlayer ] then setElementFrozen( thePlayer, false ) destroyElement( markers [ thePlayer ] ) markers [ thePlayer ] = nil else outputChatBox ( "You haven't started selling yet.", thePlayer, 255, 0, 0) end end addCommandHandler ("stopsell", para, false, false) --------------------------------------------------------------------------------------------------------------------------------------- function armaAA ( thePlayer ) if getPlayerMoney(source) >= 2000 then takePlayerMoney ( source, 2000 ) giveWeapon ( source, 31, 100 ) givePlayerMoney (thePlayer, 10000) end end addEvent( "armaAA", true ) addEventHandler( "armaAA", getRootElement(), armaAA ) --------------------------------------------------------------------------------------------------------------------------------------- function armaBB ( thePlayer ) if getPlayerMoney(source) >= 2000 then takePlayerMoney ( source, 2000 ) giveWeapon ( source, 30, 100 ) givePlayerMoney (thePlayer, 10000) end end addEvent( "armaBB", true ) addEventHandler( "armaBB", getRootElement(), armaBB ) --------------------------------------------------------------------------------------------------------------------------------------- function armaCC ( thePlayer ) if getPlayerMoney(source) >= 4000 then takePlayerMoney ( source, 4000 ) giveWeapon ( source, 34, 30 ) givePlayerMoney (thePlayer, 10000) end end addEvent( "armaCC", true ) addEventHandler( "armaCC", getRootElement(), armaCC ) --------------------------------------------------------------------------------------------------------------------------------------- function armaDD ( thePlayer ) if getPlayerMoney(source) >= 500 then takePlayerMoney ( source, 500 ) giveWeapon ( source, 16, 1 ) givePlayerMoney (thePlayer, 10000) end end addEvent( "armaDD", true ) addEventHandler( "armaDD", getRootElement(), armaDD ) --------------------------------------------------------------------------------------------------------------------------------------- function armaEE( thePlayer ) if getPlayerMoney(source) >= 200 then takePlayerMoney ( source, 200 ) giveWeapon ( source, 32, 100 ) givePlayerMoney (thePlayer, 10000) end end addEvent( "armaEE", true ) addEventHandler( "armaEE", getRootElement(), armaEE ) --------------------------------------------------------------------------------------------------------------------------------------- function armaFF( thePlayer ) if getPlayerMoney(source) >= 200 then takePlayerMoney ( source, 200 ) giveWeapon ( source, 28, 100 ) givePlayerMoney (thePlayer, 10000) end end addEvent( "armaFF", true ) addEventHandler( "armaFF", getRootElement(), armaFF ) --------------------------------------------------------------------------------------------------------------------------------------- function armaGG( thePlayer ) if getPlayerMoney(source) >= 200 then takePlayerMoney ( source, 200 ) giveWeapon ( source, 26, 50 ) givePlayerMoney (thePlayer, 10000) end end addEvent( "armaGG", true ) addEventHandler( "armaGG", getRootElement(), armaGG ) --------------------------------------------------------------------------------------------------------------------------------------- function armaHH( thePlayer ) if getPlayerMoney(source) >= 200 then takePlayerMoney ( source, 200 ) giveWeapon ( source, 23, 100 ) givePlayerMoney (thePlayer, 10000) end end addEvent( "armaHH", true ) addEventHandler( "armaHH", getRootElement(), armaHH ) --------------------------------------------------------------------------------------------------------------------------------------- function armaII( thePlayer ) if getPlayerMoney(source) >= 2000 then takePlayerMoney ( source, 2000 ) giveWeapon ( source, 24, 50 ) givePlayerMoney (thePlayer, 10000) end end addEvent( "armaII", true ) addEventHandler( "armaII", getRootElement(), armaII )
-
Not really, but the problem started in the part with math.random
-
I know . . but .. can you help or not ?
-
So I have this problem with a clothes shop, and the only problem is, i need to click the buy button alot of times, then it will add clothes Client: addEventHandler("onClientGUIClick",Clothes_Window, function (b) if b == "left" then if source == BuyClothes then local Selected = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), colID ) local Selected2 = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), colname ) local Selected3 = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), clomod ) if getPedClothes ( localPlayer, tonumber(Selected3)) then removePedClothes ( localPlayer, tonumber(Selected3)) triggerServerEvent("addClothes",localPlayer,Selected2,Selected3) exports["TopBarChat"]:sendClientMessage("#00ff00* #FFFFFFYou bought a "..Selected2.." for $25",255,255,255,true) else triggerServerEvent("addClothes",localPlayer,Selected2,Selected3) end end end end) Server: function clothes ( Selected2, Selected3) local stuff = math.random(0,17) addPedClothes (source,tostring(Selected2),tostring(Selected3),tonumber(stuff)) end addEvent("addClothes",true) addEventHandler("addClothes",getRootElement(),clothes)