Jump to content

Anubhav

Members
  • Posts

    2,277
  • Joined

  • Last visited

Everything posted by Anubhav

  1. Anubhav

    Blocking

    I am trying to say that if he typed /ignore playerName then it will ignore him. If he sended him you can canel the event or return and output to who send to him.
  2. function setAlpha() local vehi = createVehicle(arguments) if getElementAlpha( vehi ) == 150 then setElementAlpha(vehi,255) else setElementAlpha(vehi,155) end end addCommandHandler("toggle",setAlpha) If you type toggle it will create a vehicle. you need to fill it. Then it will check if its alpha if its 155 it will set vehicle's alpha to 255 else it will set vehicle's alpha 150.
  3. Anubhav

    Blocking

    Try using return or cancelEvent()
  4. addEvent("onPlayerRequestVehicle",true); addEventHandler("onPlayerRequestVehicle",getRootElement(), function(carID) local vehicleSpawnCounter = {} local vehicleSpawnLimit = 2 if getElementType(source) == "player" then for i,v in ipairs (disallowedVehicles) do if (v[1] == carID) then outputChatBox("This is disallowed vehicle!",source,255,0,0) return false end end if vehicleSpawnCounter[source] <= vehicleSpawnLimit then playerX,playerY,playerZ = getElementPosition(source) vehicle = createVehicle(carID,playerX + 2,playerY +2, playerZ) vehicleSpawnCounter[source] = vehicleSpawnCounter[source] + 1 else outputChatBox("Vehicle Spawn Limit Reached!",source,255,0,0) end end end )
  5. GUIEditor.edit[1] = guiCreateEdit(116, 286, 149, 28, "", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(276, 278, 95, 46, "Buy wine", false, GUIEditor.window[1]) addEventHandler ( "onClientGUIClick", GUIEditor.button[1], function ( ) num = tonumber ( GUIEditor.edit[1] ) if not num then outputChatBox ( "Invalid number.", 255,0,0 ) return elseif num > 50000 then return outputChatBox ( "Maximum time is 50000 (50 secs)", 255,0,0 ) end triggerServerEvent ( "onbuywine", localPlayer ) end) You used > instead of <. If you would use it will output it because it will be less.
  6. addEvent("onPlayerRequestVehicle",true); addEventHandler("onPlayerRequestVehicle",getRootElement(), function(carID) if getElementType(source) == "player" then for i,v in ipairs (disallowedVehicles) do if (v[1] == carID) then outputChatBox("This is disallowed vehicle!",source,255,0,0) return false end end playerX,playerY,playerZ = getElementPosition(source) vehicle = createVehicle(carID,playerX + 2,playerY +2, playerZ) end end )
  7. Anubhav

    IRC Help

    Go to scripts folder. Edit the echo.lua.
  8. Anubhav

    New Chat

    addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, player in ipairs ( getElementsByType ( "player" ) ) do -- Loop all the players. bindKey ( player, "U", "down", "chatbox", "gangChat" ) -- Bind the key "U" to the "GangChat" command. end end ) addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "U", "down", "chatbox", "gangChat" ) -- Bind the key "U" to the "GangChat" command. end ) function gangChat ( thePlayer, _, ... ) local isInvited = getElementData ( thePlayer, "invited" ) or false if ( isInvited ) then local text = table.concat ( { ... }, " " ) if ( #text > 0 ) then outputChatBox ("#FF32AA (GANG) "..getPlayerName(thePlayer)..": #FFFFFF" ..text, thePlayer, 255, 255, 255, true ) end end end addCommandHandler ( "gangChat", gangChat ) function invitePlayer ( thePlayer, _, playerName ) if not playerName then return end local playerToInvite = getPlayerFromName(playerName) if ( isElement ( playerToInvite ) ) and getElementType( argument ) == "player" then setElementData ( playerToInvite, "invited", true ) outputChatBox ( "You have been invited to the chat.", playerToInvite) else outputChatBox ( "There is no such a player!", thePlayer ) end end addCommandHandler ( "invite", invitePlayer ) If he would type any element then it will accept it. It must be player.
  9. I think so. Try using SQL or Mysql.
  10. function initGUI( ) -- Create our button button = guiCreateButton(311, 254, 162, 19, "Rules", false) GUIEditor.window[1] = guiCreateWindow(166, 127, 540, 359, "", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.memo[1] = guiCreateMemo(9, 22, 521, 327, "/n button not working", false, GUIEditor.window[1]) guiMemoSetReadOnly(GUIEditor.memo[1], true) end addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource( ) ), initGUI ) function onClick() guiSetVisible(GUIEditor.memo[1],true) end addEventHandler ( "onClientGUIClick", button, onClick )
  11. Anubhav

    mods

    [lua] engineLoadDFF engineLoadTXD[/lua
  12. Anubhav

    Bad Argument

    Same error. Bad Argument @ 'addCommandHandler' [Expected function at argument 2, got nil]
  13. Anubhav

    Radar

    Its 600x600 image height and width. Write ratioX, ratioY of the picture.
  14. Anubhav

    Bad Argument

    Realy LOL? It gives me 1 more error.
  15. Anubhav

    Bad Argument

    Its not much. There must 3 or it will give error. 1 for if. 1 for else. 1 for function.
  16. Anubhav

    Bad Argument

    function bri (client,command) local accName = getAccountName ( getPlayerAccount ( client ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "Moderator" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "Super Moderator" ) ) then setPlayerTeam(client,"Staff") setElementModel ( client, 217 ) outputChatBox("[sTAFF TOOLS] Welcome to the Staff Team!",client,255,0,0) else outputChatBox("[sTAFF TOOLS] You are not a staff.",client,255,0,0) end end end addCommandHandler("gostaff", bri ) It got error that: Bad Argument @ 'addCommandHandler' [Expected function at argument 2, got nil] Please fix it i need it a lot!
  17. If you need circular radar theN: [lua] dxDrawPartialCircle [/lua
  18. function SetPlayerTeam(prev, acc, auto) OnlineTable[source] = source local acc = getPlayerAccount(source) if getAccountData(acc, "Played") ~= false then outputChatBox(" Player "..string.gsub(getPlayerName(source), "#%x%x%x%x%x%x", "").. " Logged in", getRootElement(), TextColour.R, TextColour.G, TextColour.B) if player == client then executeCommandHandler("gui23456") end end end
  19. Anubhav

    Chatbox

    If you mean that you want to change it (WITHOUT BIND KEY) use onPlayerChat event. See the wiki's example. You can make say chat to global and alll...
  20. LOOOL. Its is to create new events. Have you seen some resources it has events. (NOT EXPORTS). I have seen one . Its something of Bank system.
×
×
  • Create New...