-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
GUIEditor_Window = {} GUIEditor_Label = {} function infoGui() GUIEditor_Window[1] = guiCreateWindow(347,257,452,339,"K-Info",false) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Label[1] = guiCreateLabel(8,22,157,17,"Health:",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],255,0,0) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Label[2] = guiCreateLabel(6,53,157,17,"Armour:",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Label[3] = guiCreateLabel(7,85,157,17,"Ping:",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[3],0,0,255) guiSetFont(GUIEditor_Label[3],"default-bold-small") GUIEditor_Label[4] = guiCreateLabel(7,115,157,17,"Serial:",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[4],9,255,0) guiSetFont(GUIEditor_Label[4],"default-bold-small") GUIEditor_Label[5] = guiCreateLabel(7,143,157,17,"IP:",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[5],255,255,0) guiSetFont(GUIEditor_Label[5],"default-bold-small") GUIEditor_Label[8] = guiCreateLabel(8,305,88,18,"Made By Kimmis",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[8],0,0,255) end addEventHandler("onClientPlayerSpawn",root, function() if not isElement(GUIEditor_Window[1]) then infoGui() end bindKey ( "F2", "down", openGui ) end ) function stats() local ping = getElementData (getLocalPlayer(), "ping") local ip = getElementData (getLocalPlayer(), "ip") local serial = getElementData (getLocalPlayer(), "serial") local health = getElementData (getLocalPlayer(), "health") local armour = getElementData (getLocalPlayer(), "armour") local nick = getElementData (getLocalPlayer(), "nick") guiSetText(GUIEditor_Label[4], "Serial: " ..tostring(serial).. " " ,true, GUIEditor_Window[1]) guiSetText(GUIEditor_Label[3], "Ping: " ..tostring(ping).. " " ,true, GUIEditor_Window[1]) guiSetText(GUIEditor_Label[5], "IP: " ..tostring(ip).. " " ,true, GUIEditor_Window[1]) guiSetText(GUIEditor_Label[1], "Health: " ..tostring(health).. " " ,true, GUIEditor_Window[1]) guiSetText(GUIEditor_Label[2], "Armour: " ..tostring(armour).. " " ,true, GUIEditor_Window[1]) end function openGui() if not guiGetVisible(GUIEditor_Window[1]) then stats() infoGui() else guiSetVisible ( GUIEditor_Window[1], false ) end end Not tested.
-
You can trigger it to server.
-
This https://wiki.multitheftauto.com/wiki/GetGroundPosition ?
-
If I'm right, I change the width acording to my value.
-
To achieve this you'll need to make a custom function which simulates HEX colors in DX drawing text's. Search for a function called dxDrawColorText in this forum (not the MTA WIKI, this is not a MTA function.).
-
I've written this basic account data weapon saver, should get you started. function saveWeapons(player, account) if player and account then for i=0,12 do local weapon = getPedWeapon(player, i) local ammo = getPedTotalAmmo(player, i) setAccountData(account,"w"..tonumber(i), weapon) setAccountData(account,"a"..tonumber(i), ammo) end takeAllWeapons(player) end end addEventHandler("onPlayerQuit",root,function () saveWeapons(source, getPlayerAccount(source)) end) addEventHandler("onPlayerLogout",root,function(prev) saveWeapons(source, prev) end) addEventHandler("onPlayerLogin",root, function () local account = getPlayerAccount(source) if not account or isGuestAccount(account) then return end for i=0,12 do local weapon = getAccountData(account,"w"..tonumber(i)) local ammo = getAccountData(account,"a"..tonumber(i)) if weapon and ammo then setTimer(giveWeapon, 1000, 1, source, tonumber(weapon), tonumber(ammo), true) end end end)
-
I'm currently using DX drawing to draw several "loading bars" and works perfectly.
-
Even if it's possible, nobody will script it for you, as we don't accept requests.
-
Um, thats for RACE, and needs to be added by adding addEvent('onMapStarting') function loadMap( resource ) for id, player in ipairs( getElementsByType ( "player" ) ) do accountname = getAccountName (getPlayerAccount(player)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then createBlipAttachedTo ( player, 0, 5, hivicolor[1], hivicolor[2], hivicolor[3] ) else createBlipAttachedTo ( player, 0, 3, nillcolor[1], nillcolor[2], nillcolor[3] ) end end end addEventHandler('onMapStarting') addEventHandler ( "onMapStarting", root, loadMap ) You put addEventHandler not addEvent("onMapStarting",true), that won't work.
-
Why are you not using DX drawing? they're perfect for this kind of script.
-
https://community.multitheftauto.com/index.php?p= ... &id=286885 That user uploaded all shader examples claming to be his.
-
Do you mean the speed of changing? if so, change the timer that it's set to 1 second to less.
-
local x,y = guiGetScreenSize() local image = guiCreateStaticImage ( x/4, y/5.8, 415,67, "H"..math.random(1,5)..".png", false ) function headshot ( killer ) guiSetVisible ( image, true ) guiStaticImageLoadImage(image, "H"..math.random(1,5)..".png") end addEventHandler ( "onClientPlayerWasted", getRootElement(), headshot )
-
-- server side: function randomVehicleColors() for index, vehicle in ipairs(getElementsByType("vehicle")) do red = math.random(0,255) green = math.random(0,255) blue = math.random(0,255) setVehicleColor (vehicle, red, green, blue) end end setTimer( randomVehicleColors, 1000, 0 )
-
Stolen resources & one that looks like a hack? https://community.multitheftauto.com/index.php?p= ... ls&id=2980 https://community.multitheftauto.com/index.php?p= ... ls&id=2979 https://community.multitheftauto.com/index.php?p= ... ls&id=2978 https://community.multitheftauto.com/ind ... ls&id=2973
-
You're welcome.
-
Well, your script had many errors, you we're trying to use the vehicle element as the vehicle name, trying to get vehicle data when he was not in one, that was causing the script not to work. addEventHandler("onClientRender",root, function() local name = getPlayerName(getLocalPlayer()) local ping = getPlayerPing(getLocalPlayer()) local serial = getPlayerSerial() local money = getPlayerMoney(getLocalPlayer()) local weapon = getPedWeapon (getLocalPlayer()) local ammo = getPedTotalAmmo (getLocalPlayer()) local carname = getPedOccupiedVehicle (getLocalPlayer()) if carname then state = isVehicleLocked ( carname ) if state then locked = "Locked" else locked = "Unlocked" end carhealth = math.floor(getElementHealth (carname)) lights = getVehicleLightState ( carname, 0 ) vehicleName = getVehicleName(carname) else carhealth = "Not in a vehicle." lights = "Not in a vehicle." locked = "Not in a vehicle." vehicleName = "Not in a vehicle." end local armor = getPedArmor ( getLocalPlayer() ) team = getPlayerTeam ( getLocalPlayer() ) if team then teamName = getTeamName(team) else teamName = "None" end local weaponslot = getPedWeaponSlot ( getLocalPlayer() ) local health = getElementHealth ( getLocalPlayer() ) dxDrawRectangle(778.0,521.0,246.0,94.0,tocolor(200,0,0,80),false) dxDrawText("Lights: "..lights,794.0,592.0,930.0,597.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawText("State: "..locked,794.0,563.0,930.0,578.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawText("Health: "..carhealth,794.0,547.0,930.0,563.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawRectangle(778.0,422.0,246.0,65.0,tocolor(200,0,0,80),false) dxDrawText("Vehicle Name: "..vehicleName,794.0,531.0,930.0,547.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawRectangle(778.0,287.0,246.0,106.0,tocolor(200,0,0,80),false) dxDrawRectangle(778.0,257.0,246.0,30.0,tocolor(50,0,0,200),false) dxDrawRectangle(778.0,393.0,246.0,34.0,tocolor(50,0,0,200),false) dxDrawRectangle(778.0,487.0,246.0,34.0,tocolor(50,0,0,200),false) dxDrawText("Vehicle Stats: ",836.0,487.0,982.0,517.0,tocolor(255,255,255,255),1.8,"default","left","top",false,false,false) dxDrawText("Ammo: ",794.0,461.0,930.0,477.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawText("Slot ID: "..weaponslot,794.0,447.0,930.0,461.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawText("Weapon Name: "..weapon,794.0,432.0,930.0,447.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawText("Weapon Stats",836.0,393.0,982.0,422.0,tocolor(255,255,255,255),1.8,"default","left","top",false,false,false) dxDrawText("Ping: "..ping,794.0,368.0,884.0,383.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawText("Team: "..teamName,794.0,352.0,884.0,368.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawText("Armor: "..armor,794.0,336.0,884.0,352.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawText("Health: "..health,794.0,321.0,884.0,336.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawText("Money: "..money,794.0,307.0,884.0,321.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawText("Name: "..name,794.0,292.0,884.0,307.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawText("My Stats",854.0,258.0,947.0,287.0,tocolor(255,255,255,255),1.8,"default","left","top",false,false,false) end )
-
Because maps are HIGHLY different than LUA scripts.
-
-- Server-side function respawn(command) outputChatBox("RESPAWNING ALL UNOCCUPIED VEHICLES IN 30Secs") outputDebugString("Cars Respawning") rspwn = setTimer(function () local vehicles = getElementsByType ( "vehicle" ) -- Return all the vehicles in a table for k, vehicle in ipairs ( vehicles ) do -- For every vehicle do the following... if isEmpty( vehicle ) then local seats = getVehicleMaxPassengers(vehicle) resetVehicleIdleTime ( vehicle ) -- Reset the vehicle's idle time respawnVehicle ( vehicle ) end end outputDebugString("Cars Respawned") outputChatBox("ALL UNOCCUPIED VEHICLES RESPAWNED") triggerClientEvent("r_close",getRootElement()) end,30000,1) triggerClientEvent("r_open",getRootElement(),remaining) update = setTimer(function () remaining = getTimerDetails(rspwn) triggerClientEvent("r_open",getRootElement(),remaining) end, 1000, 30) if (command) then resetTimer(rspwn) resetTimer(update) outputDebugString("Timer Reset") end end -- Client-side addEvent("r_open",true) addEventHandler("r_open",getRootElement(), function(remaining) if isElement(rlbl) and isElement(rlbl2) then guiSetText(rlbl2,tostring(remaining)) else rlbl = guiCreateLabel(13,572,106,15,"Respawning cars in: ",false) rlbl2 = guiCreateLabel(123,572,25,15,tostring(remaining),false) guiSetAlpha(rlbl,1) guiSetAlpha(rlbl2,1) end end) addEvent("r_close",true) addEventHandler("r_close",getRootElement(), function() if isElement(rlbl) and isElement(rlbl2) then destroyElement(rlbl) destroyElement(rlbl2) end end) Try it, I'm not sure if it'll work, the code is a bit messed.
-
Copy my script again, I forgot that they we're PED's .
-
Could you post your teamVehicles TABLE?
-
MOJRM-511, the problem is already solved. P.S: You took that example from the MTA wiki, at least if you want to help after being solved already, do it yourself.
-
If I'm right, the only IP you can get is player's.
