Jump to content

Anubhav

Members
  • Posts

    2,277
  • Joined

  • Last visited

Everything posted by Anubhav

  1. I meant his one had mistakes. @ Paulo, ok
  2. function saveWeaponStats(player) if (not player or not isElement(player)) then return end local account = getPlayerAccount(player) if (account and not isGuestAccount(account)) then local stats = "" for stat=69, 81 do local value = getPedStat(player, stat) stats = stats ..",".. stat ..";".. value end setAccountData(account, "weaponStats", stats) end end addEventHandler("onPlayerQuit",root,function () saveWeaponStats(source) end) function loadWeaponStats(player) if (not player or not isElement(player)) then return end local account = getPlayerAccount(player) if (account and not isGuestAccount(account)) then local statsData = tostring(getAccountData(account,"weaponStats")) local stats = split(statsData, ",") for k, v in ipairs(stats) do local stat = split(v, ";") setPedStat(player, tonumber(stat[1]), tonumber(stat[2])) end end end addEventHandler("onPlayerLogin",root,function () loadWeaponStats(source) end)
  3. function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ) local name = getPlayerName(thePlayer) if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Admin" ) ) then outputChatBox("#ad515a[Global]"..name..": #FDFDFD"..message, getRootElement(), 255, 255, 255, true) end if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Moderator" ) ) then outputChatBox("#ad515a[Moderator]"..name..": #FDFDFD"..message, getRootElement(), 255, 255, 255, true) end if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "SuperModerator" ) ) then outputChatBox("#ad515a[superModerator]"..name..": #FDFDFD"..message, getRootElement(), 255, 255, 255, true) else outputChatBox("#ad515a[Global]"..name..": #FDFDFD"..message, getRootElement(), 255, 255, 255, true) end end addCommandHandler("global", globalMessage)
  4. function colt ( ) outputChatBox("Colt-45") end addEventHandler ( "onClientGUIClick", GUIEditor.button[1], colt, false )
  5. Exactly, I agree to Bonsai and I am with him.
  6. lol local join = createMarker ( 2348.09, 2455.07, 13.97, "cylinder", 2, 67, 156, 252 ) local join1 = createMarker ( -2161.64, -2385.5, 29.62, "cylinder", 2, 67, 156, 252 ) local join2 = createMarker ( 1574.700, -1634.300, 12.600, "cylinder", 2, 67, 156, 252 ) local join3 = createMarker ( 630.84, -569.06, 15.33, "cylinder", 2, 67, 156, 252 ) local join4 = createMarker ( -1622.52, 686.91, 6.18, "cylinder", 2, 67, 156, 252 ) myFont = dxCreateFont( "SF Automaton Bold.ttf", 20 ) -- Create custom font GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_gridlist = {} windowjob = guiCreateWindow(392, 176, 408, 437, "CNG ~ Police", false) guiWindowSetSizable(windowjob, false) guiSetVisible(windowjob, false) GUIEditor_Memo[1] = guiCreateMemo(18, 30, 362, 221, "Here you can join the police service.\n\nPolice officer job is all about arresting wanted players. You can pick one of 8 various skins and 4 different types of police vehicles. When you get enough arrests you will be able to get promoted and become one of the special ranks in police job. Also good progress as a police officer can lead to joining one of the special government services. \n\nJob perk: To arrest players simply hit them with a nighstick. You can also use tazer to stun them. The player is wanted if he has numbers (1-6) behind his name.\n", false, windowjob) guiMemoSetReadOnly(GUIEditor_Memo[1], true) GUIEditor_gridlist[1] = guiCreateGridList(21, 264, 359, 115, false, windowjob) guiGridListAddColumn(GUIEditor_gridlist[1], "ID", 0.5) guiGridListAddColumn(GUIEditor_gridlist[1], "Skin Name", 0.5) for i = 1, 5 do guiGridListAddRow(GUIEditor_gridlist[1]) end guiGridListSetItemText(GUIEditor_gridlist[1], 0, 1, "265", false, false) guiGridListSetItemText(GUIEditor_gridlist[1], 0, 2, "Cop 1", false, false) guiGridListSetItemText(GUIEditor_gridlist[1], 1, 1, "266", false, false) guiGridListSetItemText(GUIEditor_gridlist[1], 1, 2, "Cop 2", false, false) guiGridListSetItemText(GUIEditor_gridlist[1], 2, 1, "267", false, false) guiGridListSetItemText(GUIEditor_gridlist[1], 2, 2, "Cop 3", false, false) guiGridListSetItemText(GUIEditor_gridlist[1], 3, 1, "280", false, false) guiGridListSetItemText(GUIEditor_gridlist[1], 3, 2, "Cop 4", false, false) guiGridListSetItemText(GUIEditor_gridlist[1], 3, 1, "281", false, false) guiGridListSetItemText(GUIEditor_gridlist[1], 3, 2, "Cop 5", false, false) guiGridListSetItemText(GUIEditor_gridlist[1], 3, 1, "281", false, false) guiGridListSetItemText(GUIEditor_gridlist[1], 3, 2, "Cop 6", false, false) guiGridListSetItemText(GUIEditor_gridlist[1], 3, 1, "282", false, false) guiGridListSetItemText(GUIEditor_gridlist[1], 3, 2, "Cop 7", false, false) GUIEditor_Button[1] = guiCreateButton(21, 379, 175, 48, "Take job !", false, windowjob) GUIEditor_Button[2] = guiCreateButton(206, 379, 174, 48, "Cancel", false, windowjob) function SAPDjob(hitElement) if getElementData (source, "NameGroup") == "SWAT" then setElementData ( localPlayer, "ownskin", getElementModel (localPlayer) ) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then if not guiGetVisible(windowjob) then guiSetVisible(windowjob, true) showCursor(true) end end end end addEventHandler("onClientMarkerHit", join, SAPDjob) addEventHandler("onClientMarkerHit", join1, SAPDjob) addEventHandler("onClientMarkerHit", join2, SAPDjob) addEventHandler("onClientMarkerHit", join3, SAPDjob) addEventHandler("onClientMarkerHit", join4, SAPDjob) function FBIjobleave(leaveElement) if getElementType(leaveElement) == "player" and (leaveElement == localPlayer) then if guiGetVisible(windowjob) then guiSetVisible(windowjob, false) showCursor(false) end end end addEventHandler("onClientMarkerLeave", marker, SAPDjobleave) function setskintest() local skin = guiGridListGetItemText ( GUIEditor_gridlist[1], guiGridListGetSelectedItem ( GUIEditor_gridlist[1] ), 1 ) setElementModel ( localPlayer, skin ) end addEventHandler ( "onClientGUIClick", GUIEditor_gridlist[1], setskintest, false ) function joinTeam() triggerServerEvent("Police",localPlayer) local skin = guiGridListGetItemText ( GUIEditor_gridlist[1], guiGridListGetSelectedItem ( GUIEditor_gridlist[1] ), 1 ) if skin ~= 0 or getElementData(localPlayer, "ownskin") then guiSetVisible(windowjob, false) showCursor(false) setElementModel ( localPlayer, skin ) else exports["TopBarChat"]:sendClientMessage ("You didn't select a Skin", 255, 0, 0 ) end end addEventHandler("onClientGUIClick", GUIEditor_Button[1] , joinTeam, false) function removeSAPDWindow() guiSetVisible(windowjob, false) showCursor(false) setElementModel(localPlayer, getElementData(localPlayer, "ownskin")) end addEventHandler("onClientGUIClick", GUIEditor_Button[2] , removeSAPDWindow, false)
  7. getElementData( source, "GroupName" ) Use this and do yourself. Found any error? Feel free to post here again . You can add me on skype: anubhav.agarwal87
  8. SQL is stable and works perfect. An example: con = dbConnect("sqlite", ":/file.db/sql") function f1() dbExec(con,"CREATE TABLE IF NOT EXISTS tableName(x INT, y INT, z INT)") dbExec(con,"INSERT INTO tableName VALUES(?,?,?)", 0, 0, 0 ) end
  9. May I ask you one thing?? What group system are you using? Then only we can help you.
  10. Anubhav

    Table

    local xc,yc,zc = { x=yourString, y=yourString, z=yourString, } local xc2,yc2,zc2 = unpack(xc,yc,zc) if not xc2 or yc2 or zc2 then return end and use math.random. Maybe its usefull for you?
  11. Without window, everything is normal GUI. Seriously bullshit.
  12. lol. What part doesn't work?
  13. I'm not sure how do with it. I don't think its possible to check 2 hex in nick. You may suggest it.
  14. What is the problem? What part in it doesn't set ?
  15. /debugscript 3 If no errors, What isn't working?
  16. The string.gsub will remove ALL HEX codes.
  17. local xml = xmlLoadFile ("spawn.xml") local class = xmlFindChild(xml,"class",0) local color = xmlFindChild(class,"color",0) local skin = xmlFindChild(class,"skin",0) local spawn = xmlFindChild(class,"spawnpoint",0) local r = xmlNodeGetAttribute(color,"red") local g = xmlNodeGetAttribute(color,"green") local b = xmlNodeGetAttribute(color,"blue") local skinid = xmlNodeGetAttribute(skin,"id") local x = xmlNodeGetAttribute(spawn,"x") local y = xmlNodeGetAttribute(spawn,"y") local z = xmlNodeGetAttribute(spawn,"z") local rot = xmlNodeGetAttribute(spawn,"rot") local acl = xmlNodeGetAttribute(xml, "group") ---------- --and then you need to add this into the spawn script ------- function setNameTag(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( tostring ( acl ) ) ) then spawnPlayer(thePlayer , tonumber(x), tonumber(y), tonumber(z), tonumber(rot), tonumber(skinid)) setPlayerNametagColor(thePlayer , tonumber(r), tonumber(g), tonumber(b) end end Mistakes..
  18. I am not sure what do you want do, If I am right you are making a text on screen which shows player name right?
  19. Its not HTML colors. HTML don't have colors. Its hex codes lol. What is pnick? What is it data.
  20. I loved the map.. But I have one doubt How do you make the custom models?
  21. XML functions would work?
  22. However, I suggest this company. Its very cheap.. My friend was going to buy on server but he got a problem of PayPal. I think that this hosting will go forever. I will post when he buys the server.
  23. function gui() myWindow = guiCreateWindow(116, 135, 603, 346, "Test gui", false) guiWindowSetSizable(myWindow, false) myTabpanel = guiCreateTabPanel(9, 20, 584, 316, false, myWindow) myTab = guiCreateTab("Health", myTabpanel) myButton1 = guiCreateButton(33, 32, 218, 72, "car3", false, myTab) guiSetProperty(myButton1, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick",myButton1,health1) myButton2 = guiCreateButton(308, 150, 218, 72, "car4", false, myTab) guiSetProperty(myButton2, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick",myButton2,health4) myButton3 = guiCreateButton(33, 150, 218, 72, "car2", false, myTab) guiSetProperty(myButton3, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick",myButton3,health3) myButton4 = guiCreateButton(308, 32, 218, 72, car"", false, myTab) guiSetProperty(myButton4, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick",myButton4,health2) button5 = guiCreateButton(479, 255, 95, 27, "close", false, myTab) guiSetProperty(button5, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick",button5, function() guiSetVisible(myWindow,false) showCursor(false) end ) end
×
×
  • Create New...