Jump to content

Static-X

Members
  • Posts

    128
  • Joined

  • Last visited

Everything posted by Static-X

  1. Have been using this host for almost 9 months now. Really cheap, reliable and has a very good support. Not even a single day of downtime ( I faced ). Thank you No1Servers.
  2. You can change the first six lines according to your needs, adminTag = "[ADMIN]" sModTag = "[sMOD]" modTag = "[MOD]" adminColor = "#FF0000" -- leave blank if you dont want pre defined color sModColor = "#FF0000" -- leave blank if you dont want pre defined color modColor = "#FF0000" -- leave blank if you dont want pre defined color function chatbox( message ) cancelEvent ( ) local account = getAccountName ( getPlayerAccount ( source ) ) if ( isAccountInGroup ( account, "Admin" ) ) then tag = adminColor .. adminTag .. " " elseif ( isAccountInGroup ( account, "SuperModerator" ) ) then tag = sModColor .. sModTag .. " " elseif ( isAccountInGroup ( account, "Moderator" ) ) then tag = modColor .. modTag .. " " else tag = "" -- no tag end output ( tag, source, message ) end addEventHandler("onPlayerChat", root, chatbox) function output ( tag, player, text ) if ( getPlayerTeam ( player) ) then r,g,b = getTeamColor ( getPlayerTeam ( player) ) else r,g,b = getPlayerNametagColor ( player ) end outputChatBox ( tag .. "" .. getPlayerName ( player ) .. ":#FFFFFF " .. text, root, r, g, b, true ) tag = string.gsub( tag, "#%x%x%x%x%x%x", "" ) outputServerLog ( tag .. "" .. getPlayerName ( player ) .. ": " .. text ) end function isAccountInGroup ( _acc, _group ) if ( isObjectInACLGroup ( "user." .. _acc, aclGetGroup ( _group ) ) ) then return true end end
  3. 'player' should be defined as the first parameter Use isGuestAccount to avoid errors ( check if the player is logged in the account before getting the account name ). setPedSkin is deprecated, use setElementModel. function militarySkin( player ) if ( isGuestAccount ( getPlayerAccount ( getPlayerAccount ( player ) ) ) ) then return end local account = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup("user." .. account, aclGetGroup("Military")) then setElementModel(player, 287) outputChatBox("You are now on duty as a Military Soldier!", player, 0, 255, 0, false) else outputChatBox("You must be in Military to use this command!", player, 255, 0, 0, false) end end addCommandHandler("mduty", militarySkin)
  4. playerName isn't defined, you can use this function onAdminJoin(_,account) local account = getAccountName ( account ) if ( isObjectInACLGroup ( "user." .. account, aclGetGroup ( "Admin" ) ) ) then local team = getTeamFromName ( "Admins" ) setPlayerTeam( source, team ) end end addEventHandler("onPlayerLogin", getRootElement(), onAdminJoin)
  5. onPlayerWeaponFire, there is no such event. You can use onClientPlayerWeaponFire and make the script client sided or use triggering
  6. Yep. It seems to be working fine.
  7. *Bump* Same error on 1.1.1 too, I can't stay on 1.0.5 forever ... Any idea of how I could fix this? (anyone ?)
  8. outputChatBox("text",getRootElement())
  9. Static-X

    problem oO

    function setPlayerID( id,player ) Here, id is the first parameter and player is second, @line 163 setPlayerID(source,1) Use setPlayerID(1,source)
  10. Static-X

    problem oO

    This code seems to work fine, could you please mention the part/function where are you using this?
  11. Static-X

    Taken vehicle

    You can create a marker on player vehicle enter and clone the car or create it (use getElementPosition to get the params) when the player leaves that marker.
  12. PS: It works, if there is no player in range of it, try v = createVehicle(500, 0, 0, 0) setVehicleIdleRespawnDelay(v, 5000) toggleVehicleRespawn(v, true)
  13. Those are colored 'corona' markers.
  14. Use this handler addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),lol)
  15. @line 3 remove quotations around team.
  16. oops you are right, setObjectRotation is an easy way to do it.
  17. Static-X

    Giving Money

    use this? I fixed some of the errors ( that could occur ) gpickup = {} function takemoney ( thePlayer ) givePlayerMoney(thePlayer, getElementData(source, "moneyDropped")) destroyElement(source) end function err(str,rec) -- lazy to type outputChatBox each time if not (rec) then rec = getRootElement() end outputChatBox(str,rec,255,0,0) end function givemoney(thePlayer, command, amount) if not (amount) then -- if the player didnot type the amount then err("Incorrect syntax",thePlayer) return end if not tonumber(amount) then -- if the amount is not a number then err("Invalid amount",thePlayer) return end if (tonumber(amount)>=getPlayerMoney(thePlayer)) then -- if the player's money is less than the amount then err("Invalid amount",thePlayer) return end if (tonumber(amount)==0) or (tonumber(amount)<=0) then -- if the amount is 0 or negative then err("Invalid amount",thePlayer) return end if isElement(gpickup[thePlayer]) then -- if the element gpickup[thePlayer] exists then return end local x,y,z = getElementPosition(thePlayer) local x = x + 5 gpickup[thePlayer] = createPickup(x,y,z,3,1212) setElementData(gpickup[thePlayer], "moneyDropped", math.ceil(tonumber(amount))) takePlayerMoney (thePlayer, math.abs(math.ceil(tonumber(amount)))) addEventHandler('onPickupHit', gpickup[thePlayer], takemoney) end addCommandHandler ("givemoney", givemoney)
  18. Static-X

    HGui

    Use this, not tested btw. GUIEditor_Window = {} GUIEditor_Memo = {} GUIEditor_Memo1 = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.207,0.1426,0.607,0.5605,"Help Manager",true) guiSetVisible(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(14,52,121,485,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListAddColumn(GUIEditor_Grid[1],"Description",0.6) for i = 1,3 do guiGridListAddRow(GUIEditor_Grid[1]) end guiGridListSetItemText(GUIEditor_Grid[1],1,1,"FAQ",false,false) guiGridListSetItemText(GUIEditor_Grid[1],2,1,"Static-X",false,false) GUIEditor_Memo[1] = guiCreateMemo(139,54,601,484,"",false,GUIEditor_Window[1]) guiWindowSetSizable(GUIEditor_Window[1], false) guiWindowSetMovable(GUIEditor_Window[1], false) guiMemoSetReadOnly(GUIEditor_Memo[1],false) function setMemoText(text) guiSetText(GUIEditor_Memo[1],text) end function gridSelect() if guiGridListGetSelectedCount(GUIEditor_Grid[1]) == 0 then setMemoText("") return end local selc = guiGridListGetItemText(GUIEditor_Grid[1],guiGridListGetSelectedItem(GUIEditor_Grid[1]),1) if selc == "FAQ" then setMemoText("Here are recently asked questions by other players\n\n\nQ:What type of server is this ?\nA:It's Freeroam.\n\n\nQ: For what FG stands for ? \nA: It's stand for Friend Gang\n\n\nQ: Where i can visit your site ? \nA: Site link is Fggaming.forumcroatian.com/") elseif selc == "Static-X" then setMemoText("static-x ftw") end end function showUserPanel () local playerName = getPlayerName ( getLocalPlayer() ) if guiGetVisible (GUIEditor_Window[1]) then guiSetVisible (GUIEditor_Window[1], false) showCursor (false) removeEventHandler("onClientGUIClick",GUIEditor_Grid[1],gridSelect,false) else guiSetVisible (GUIEditor_Window[1], true) showCursor (true) addEventHandler("onClientGUIClick",GUIEditor_Grid[1],gridSelect,false) end end bindKey ("F9", "down", showUserPanel)
  19. wtf fadeCamera for a label? GUIEditor_Label = {} function lol () GUIEditor_Label[1] = guiCreateLabel(0.4063,0.3779,0.1531,0.209,"Welcome to our server ! Server is under construction at the moment , but feel free to play on it , expect more gamemodes from us , more features and much , much more ...",true) guiLabelSetColor(GUIEditor_Label[1],0,255,0) guiLabelSetVerticalAlign(GUIEditor_Label[1],"center") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"center",true) guiSetFont(GUIEditor_Label[1],"clear-normal") fadeCamera(false,1.0) setTimer( fadeCamera, 10000,1,true) setTimer ( guiSetVisible, 10000, 1, GUIEditor_Label[1], false) end addEventHandler("onClientResourceStart",getRootElement(), lol )
  20. moveObject or simply use omg ( Object movement generator ), available on community
  21. Static-X

    HGui

    you are adding rows in a window ? Fixed it but still dont know what you are doing with the gridlist GUIEditor_Window = {} GUIEditor_Memo = {} GUIEditor_Memo1 = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.207,0.1426,0.607,0.5605,"Help Manager",true) guiSetVisible(GUIEditor_Window[1],false) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) GUIEditor_Grid[1] = guiCreateGridList(14,52,121,485,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListAddColumn(GUIEditor_Grid[1],"Description",0.6) for i = 1, 2 do guiGridListAddRow(GUIEditor_Grid[1]) end guiGridListSetItemText(GUIEditor_Grid[1],1,1,"FAQ",false,true) GUIEditor_Memo[1] = guiCreateMemo(139,54,601,484," Here are recently asked questions by other players\n\n\nQ:What type of server is this ?\nA:It's Freeroam.\n\n\nQ: For what FG stands for ? \nA: It's stand for Friend Gang\n\n\nQ: Where i can visit your site ? \nA: Site link is Fggaming.forumcroatian.com/\n",false,GUIEditor_Window[1]) guiGridListSetItemText(GUIEditor_Grid[1],1,1,"Glue",false,true) guiWindowSetSizable(GUIEditor_Window[1], false) guiWindowSetMovable(GUIEditor_Window[1], false) guiMemoSetReadOnly(GUIEditor_Memo[1],false) --GUIEditor_Memo1[1] = guiCreateMemo(139,54,601,484,"Test, test",false,GUIEditor_Window[1]) -- BIND F9 function showUserPanel () local playerName = getPlayerName ( getLocalPlayer() ) if guiGetVisible (GUIEditor_Window[1]) then guiSetVisible (GUIEditor_Window[1], false) showCursor (false) else guiSetVisible (GUIEditor_Window[1], true) showCursor (true) end end bindKey ("F9", "down", showUserPanel)
  22. Use setTimer ( guiSetVisible, 5000, 1, GUIEditor_Label[1], false)
  23. Static-X

    HGui

    Can you post your code again?
  24. Copied mta 1.0.5 from other computer, works, however 1.1 still doesn't.
×
×
  • Create New...