Jump to content

CapY

Members
  • Posts

    1,646
  • Joined

  • Last visited

Everything posted by CapY

  1. I used relative screen,but now is the problem, to set the right cordinates
  2. CapY

    MountedVeh

    Check this vid. I want minigun aims and moves exactly like this one on the vid. EDIT:Just watch whole vid. and you'll know what im talking about.
  3. My default res is 1280x1024 and i was used that GUI on 1024x768 with this updated code : -- Created: 02/07/2011 09:45 -- Direct X Drawing addEventHandler("onClientRender",root, function() dxDrawText("",0.0,14.0,1279.0,1023.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawLine(0.0,0.0,1279.0,0.0,tocolor(255,255,255,255),1.0,false) dxDrawText("",6.0,368.0,1277.0,935.0,tocolor(255,255,255,255),100.0,"default","left","top",false,true,false) end ) addEventHandler("onClientResourceStart",resourceRoot, function() guiEditor_Memo = {} guiEditor_Label = {} guiEditor_Image = {} guiFgWelcomeWindow = guiCreateWindow(-2,3,1279,1023," R U L E S ! ",false) guiSetAlpha(guiFgWelcomeWindow,1) guiWindowSetMovable(guiFgWelcomeWindow,false) guiWindowSetSizable(guiFgWelcomeWindow,false) guiFgOkButton = guiCreateButton(564,943,172,59,"O K ! ",false,guiFgWelcomeWindow) showCursor( true ) guiSetAlpha(guiFgOkButton,1) guiSetFont(guiFgOkButton,"clear-normal") guiFgImage = guiCreateStaticImage(9,21,1261,333,"Logo.png",false,guiFgWelcomeWindow) guiEditor_Label[1] = guiCreateLabel(8,355,1271,570,"",false,guiFgWelcomeWindow) guiSetAlpha(guiEditor_Label[1],1) guiLabelSetColor(guiEditor_Label[1],0, 155 ,155) guiSetFont(guiEditor_Label[1],"clear-normal") guiEditor_Memo[1] = guiCreateMemo(2,5,1265,565," Welcome To [FG]Clan 24/7 Croatian Playground Freeroam \n\n\n\nPress F9 for any HELP or Commands. \n\n**********************************************************************************************************************************************************************************\nFreeroam Rules:\n \n\n*DO NOT ADVERTISE !\n\n*DO NOT SPAM THE CHAT !\n\n*DO NOT SPAM VEHICLES ! \n\n*DO NOT ANNOY OTHERS !\n\n*BE NICE, RESPECT OTHERS !\n\n*DO NOT USE HACKS, CHEATS OR HANDLING CFG !\n\n*DO NOT BOTHER STAFF !\n\n\n\n**********************************************************************************************************************************************************************************\n\nAtleast, you will be warned 2 times before BAN !\n\n\nAbove all, Have fun ! \n",false,guiEditor_Label[1]) guiMemoSetReadOnly(guiFgRulesMemo,false) guiEditor_Image[1] = guiCreateStaticImage(19,953,91,56,"Shruk.png",false,guiFgWelcomeWindow) addEventHandler("onClientGUIClick", guiFgOkButton, function() guiSetVisible(guiFgWelcomeWindow,false) showCursor(false) end, false) end ) and still nothing ... Picture looks like a : http://imageshack.us/photo/my-images/836/unlednmn.png/
  4. Aibo then what i need ?
  5. @Bandi94 I don't see my variables here .
  6. CapY

    MountedVeh

    Okay! Thanks for your help.
  7. And that code is ? (Sry i don't understand that things so good. )
  8. CapY

    MountedVeh

    @NeXTreme I want to aim with minigun . @Bandi94 It doesn't works for now .
  9. How i can make my gui compatible on all resoulutions ? Here is the code: -- Created: 02/07/2011 09:45 addEventHandler("onClientResourceStart",resourceRoot, function() guiEditor_Memo = {} guiEditor_Label = {} guiEditor_Image = {} guiFgWelcomeWindow = guiCreateWindow(-2,3,1279,1023," R U L E S ! ",false) guiSetAlpha(guiFgWelcomeWindow,1) guiWindowSetMovable(guiFgWelcomeWindow,false) guiWindowSetSizable(guiFgWelcomeWindow,false) guiFgOkButton = guiCreateButton(564,943,172,59,"O K ! ",false,guiFgWelcomeWindow) showCursor( true ) guiSetAlpha(guiFgOkButton,1) guiSetFont(guiFgOkButton,"clear-normal") guiFgImage = guiCreateStaticImage(9,21,1261,333,"Logo.png",false,guiFgWelcomeWindow) guiEditor_Label[1] = guiCreateLabel(8,355,1271,570,"",false,guiFgWelcomeWindow) guiSetAlpha(guiEditor_Label[1],1) guiLabelSetColor(guiEditor_Label[1],0, 155 ,155) guiSetFont(guiEditor_Label[1],"clear-normal") guiEditor_Memo[1] = guiCreateMemo(2,5,1265,565," Welcome To [FG]Clan 24/7 Croatian Playground Freeroam \n\n\n\nPress F9 for any HELP or Commands. \n\n**********************************************************************************************************************************************************************************\nFreeroam Rules:\n \n\n*DO NOT ADVERTISE !\n\n*DO NOT SPAM THE CHAT !\n\n*DO NOT SPAM VEHICLES ! \n\n*DO NOT ANNOY OTHERS !\n\n*BE NICE, RESPECT OTHERS !\n\n*DO NOT USE HACKS, CHEATS OR HANDLING CFG !\n\n*DO NOT BOTHER STAFF !\n\n\n\n**********************************************************************************************************************************************************************************\n\nAtleast, you will be warned 2 times before BAN !\n\n\nAbove all, Have fun ! \n",false,guiEditor_Label[1]) guiMemoSetReadOnly(guiFgRulesMemo,false) guiEditor_Image[1] = guiCreateStaticImage(19,953,91,56,"Shruk.png",false,guiFgWelcomeWindow) addEventHandler("onClientGUIClick", guiFgOkButton, function() guiSetVisible(guiFgWelcomeWindow,false) showCursor(false) end, false) end )
  10. CapY

    MountedVeh

    So here it is : local root = getRootElement() local player = getLocalPlayer() local toggleVehicleWeapon = false local previousTick = getTickCount() local projectileType = 20 function updateVehicleWeapon(source, dataName) if (getElementType(source) == "vehicle" and dataName == "toggleVehicleWeapon") then toggleVehicleWeapon = (getElementData(source, dataName) and isPedInVehicle(player)) end end function callbackDataChange(dataName) updateVehicleWeapon(source, dataName) end function callbackVehicleEnter(thePlayer, seat) updateVehicleWeapon(source, "toggleVehicleWeapon") end function callbackRender() if (getControlState("vehicle_fire") and toggleVehicleWeapon) then if getKeyState( "rclick" ) == true then createProjectile(player,projectileType, pX, pY, pZ, 0, nil, 0, 0, 0, vX, vY, vZ)) elseif (getTickCount() > (previousTick + 150) and previousTick > 0) then fireProjectile() end end end function fireProjectile() local vehicle = getPedOccupiedVehicle(player) local gun = false local gX, gY, gZ = 0, 0, 0 local gRotX, gRotY, gRotZ = 0, 0, 0 local pX, pY, pZ = 0, 0, 0 local vX, vY, vZ = 0, 0, 0 local currentLoSOffset = 3.5 local zPosOffset = 1.1 local thrust = 2.0 previousTick = 0 if (vehicle) then if (#getAttachedElements(vehicle) > 0) then gun = getAttachedElements(vehicle)[1] if (gun) then gX, gY, gZ = getElementPosition(gun) gRotX, gRotY, gRotZ = getElementRotation(gun) pX = gX - math.sin(-math.rad(gRotZ + 90)) * currentLoSOffset pY = gY + math.cos(-math.rad(gRotZ + 90)) * currentLoSOffset pZ = gZ + zPosOffset vX = math.sin (math.rad((gRotZ + 90))) * thrust vY = math.cos(math.rad((gRotZ + 90))) * thrust vZ = 0 createExplosion(pX, pY, pZ, 5, true, -1.0, false) createProjectile(player, projectileType, pX, pY, pZ, 0, nil, 0, 0, 0, vX, vY, vZ) end end end previousTick = getTickCount() end function changeProjectileType(commandName, arg) projectileType = tonumber(arg) or 20 end addEventHandler("onClientElementDataChange", root, callbackDataChange, true) addEventHandler("onClientVehicleEnter", root, callbackVehicleEnter, true) addEventHandler("onClientRender", root, callbackRender, true) addCommandHandler("guntype", changeProjectileType) It doesn't want to fire anymore and still nothing with aim .
  11. CapY

    MountedVeh

    I'm stuck on the line 4 function minigunAimFunction() -- if the right click has pressed, you'll be able to aim if getKeyState( "rclick" ) == true then Any solution ?
  12. CapY

    MountedVeh

    I tryied it, but i don't know, how to let it work .
  13. CapY

    MountedVeh

    I will be check it...
  14. CapY

    Why server Kick ME!

    Cheat Engine is a program and Cheat is a cheat...so don't mess up Cheat Engine with a Cheat.
  15. CapY

    Why server Kick ME!

    Well...yeah(On some way.)
  16. CapY

    MountedVeh

    I have this code(Ace_Gambit is the original creator of it) for mounting weapons onto a vehicle's passenger side for shooting that. I want edit it. I wanna aim with that minigun(mouse aiming) Client: local root = getRootElement() local player = getLocalPlayer() local toggleVehicleWeapon = false local previousTick = getTickCount() local projectileType = 20 function updateVehicleWeapon(source, dataName) if (getElementType(source) == "vehicle" and dataName == "toggleVehicleWeapon") then toggleVehicleWeapon = (getElementData(source, dataName) and isPedInVehicle(player)) end end function callbackDataChange(dataName) updateVehicleWeapon(source, dataName) end function callbackVehicleEnter(thePlayer, seat) updateVehicleWeapon(source, "toggleVehicleWeapon") end function callbackRender() if (getControlState("vehicle_fire") and toggleVehicleWeapon) then if (getTickCount() > (previousTick + 150) and previousTick > 0) then fireProjectile() end end end function fireProjectile() local vehicle = getPedOccupiedVehicle(player) local gun = false local gX, gY, gZ = 0, 0, 0 local gRotX, gRotY, gRotZ = 0, 0, 0 local pX, pY, pZ = 0, 0, 0 local vX, vY, vZ = 0, 0, 0 local currentLoSOffset = 3.5 local zPosOffset = 1.1 local thrust = 2.0 previousTick = 0 if (vehicle) then if (#getAttachedElements(vehicle) > 0) then gun = getAttachedElements(vehicle)[1] if (gun) then gX, gY, gZ = getElementPosition(gun) gRotX, gRotY, gRotZ = getElementRotation(gun) pX = gX - math.sin(-math.rad(gRotZ + 90)) * currentLoSOffset pY = gY + math.cos(-math.rad(gRotZ + 90)) * currentLoSOffset pZ = gZ + zPosOffset vX = math.sin (math.rad((gRotZ + 90))) * thrust vY = math.cos(math.rad((gRotZ + 90))) * thrust vZ = 0 createExplosion(pX, pY, pZ, 5, true, -1.0, false) createProjectile(player, projectileType, pX, pY, pZ, 0, nil, 0, 0, 0, vX, vY, vZ) end end end previousTick = getTickCount() end function changeProjectileType(commandName, arg) projectileType = tonumber(arg) or 20 end addEventHandler("onClientElementDataChange", root, callbackDataChange, true) addEventHandler("onClientVehicleEnter", root, callbackVehicleEnter, true) addEventHandler("onClientRender", root, callbackRender, true) addCommandHandler("guntype", changeProjectileType) Server(little edited by me): local guns = { [411] = { ["xPosOffset"] = 0, ["yPosOffset"] = 1.0, ["zPosOffset"] = -0.5 } } function attachMod(playerSource, commandName) local vehicle = getPedOccupiedVehicle(playerSource) local gun = false if (vehicle) then gun = guns[getElementModel(vehicle)] or false if (gun) then attachElements(createObject(2985, 0, 0, -100, 0, 0, 0), vehicle, gun.xPosOffset, gun.yPosOffset, gun.zPosOffset, 0, 0, 90) setElementData(vehicle, "toggleVehicleWeapon", true) end end end function detachMod(playerSource, commandName) local vehicle = getPedOccupiedVehicle(playerSource) if (vehicle) then for _, element in ipairs(getAttachedElements(vehicle)) do destroyElement(element) end setElementData(vehicle, "toggleVehicleWeapon", false) end end addCommandHandler("mountit", attachMod, false) addCommandHandler("unmountit", detachMod, false) Is these 2 functions i must include in client side ? moveObject: -- Find a player called 'someguy' someGuy = getPlayerFromNick ( "someguy" ) -- If a player called someguy was found then if ( someGuy ) then -- Get the player's position x, y, z = getElementPosition ( someGuy ) -- Create a bed (1700) object near to the player bed = createObject ( 1700, x + 5, y, z ) -- Move the bed towards the player over 3 seconds (3000 milliseconds) moveObject ( bed, 3000, x, y, z ) -- Tell the player in the chat box outputChatBox ( "Moving a bed towards you!", someGuy ) else -- Tell everyone that a player called 'someguy' could not be found outputChatBox ( "Player someguy doesn't exist" ) end setObjectRotation: function onResourceStart ( name, root ) -- predefined variables, needed for the math code below rotX = 0 rotY = 0 rotZ = 0 -- assign element named 'minigun' in map file to variable pirateship = getElementByID ( "minigun" ) end function chatboxShipRotateLeft ( playerSource, commandName ) -- On console command 'increaserotations' outputChatBox ( "Rotational values increased" ) -- rotations = rotations + 10 rotX = rotX + 10 rotY = rotY + 10 rotZ = rotZ + 10 -- Changed rotation is applied setObjectRotation ( minigun, rotX, rotY, rotZ ) end function chatboxMinigunRotateRight ( playerSource, commandName ) -- On console command 'decreaserotations' outputChatBox ( "Rotational values decreased" ) -- rotations = rotations - 10 rotX = rotX - 10 rotY = rotY - 10 rotZ = rotZ - 10 -- Changed rotation is applied setObjectRotation ( minigun, rotX, rotY, rotZ ) end -- Set up event and command handlers addEventHandler ( "onResourceStart", getRootElement(), onResourceStart ) addCommandHandler ( "increaserotations", chatboxShipRotateLeft ) addCommandHandler ( "decreaserotations", chatboxShipRotateRight) And my problem is that IDK how to add it to let it work ...
  17. CapY

    GUI Welcome Screen

    Can you edit my code to the only one window ?
  18. Is it possible to aim there with mouse ?
  19. CapY

    GUI Welcome Screen

    Hmm... maybe. You don't know any code for this/my mistake ? Any solution ?
  20. CapY

    GUI Welcome Screen

    I don't see 3 Windows
  21. CapY

    GUI Welcome Screen

    Client : -- Created: 02/07/2011 09:45 local screenWidth, screenHeight = guiGetScreenSize() local x, y = screenWidth/2 - 1279/2, screenHeight/2 - 1023/2 addEventHandler("onClientResourceStart",resourceRoot, function() guiEditor_Memo = {} guiEditor_Label = {} guiEditor_Image = {} guiFgWelcomeWindow = guiCreateWindow(x,y,1279,1023," R U L E S ! ",false) guiSetAlpha(guiFgWelcomeWindow,1) guiWindowSetMovable(guiFgWelcomeWindow,false) guiWindowSetSizable(guiFgWelcomeWindow,false) guiFgOkButton = guiCreateButton(564,943,172,59,"O K ! ",false,guiFgWelcomeWindow) showCursor( true ) guiSetAlpha(guiFgOkButton,1) guiSetFont(guiFgOkButton,"clear-normal") guiFgImage = guiCreateStaticImage(9,21,1261,333,"Logo.png",false,guiFgWelcomeWindow) guiEditor_Label[1] = guiCreateLabel(8,355,1271,570,"",false,guiFgWelcomeWindow) guiSetAlpha(guiEditor_Label[1],1) guiLabelSetColor(guiEditor_Label[1],0, 155 ,155) guiSetFont(guiEditor_Label[1],"clear-normal") guiEditor_Memo[1] = guiCreateMemo(2,5,1265,565," Welcome To [FG]Clan 24/7 Croatian Playground Freeroam \n\n\n\nPress F9 for any HELP or Commands. \n\n**********************************************************************************************************************************************************************************\nFreeroam Rules:\n \n\n*DO NOT ADVERTISE !\n\n*DO NOT SPAM THE CHAT !\n\n*DO NOT SPAM VEHICLES ! \n\n*DO NOT ANNOY OTHERS !\n\n*BE NICE, RESPECT OTHERS !\n\n*DO NOT USE HACKS, CHEATS OR HANDLING CFG !\n\n*DO NOT BOTHER STAFF !\n\n\n\n**********************************************************************************************************************************************************************************\n\nAtleast, you will be warned 2 times before BAN !\n\n\nAbove all, Have fun ! \n",false,guiEditor_Label[1]) guiMemoSetReadOnly(guiFgRulesMemo,false) guiEditor_Image[1] = guiCreateStaticImage(19,953,91,56,"Shruk.png",false,guiFgWelcomeWindow) addEventHandler("onClientGUIClick", guiFgOkButton, function() guiSetVisible(guiFgWelcomeWindow,false) showCursor(false) end, false) end )
  22. CapY

    GUI Welcome Screen

    It's the same increased value on 1024x768
  23. CapY

    BANNER SCRIPT

    Lol! Blabla.com really exist
  24. CapY

    GUI Welcome Screen

    It doesn't works . Are you tested it by yourself ?
×
×
  • Create New...