-
Posts
467 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Gravestone
-
Hello, anyone there?
-
Like I posted before, this post is related to the previous one. So basically this code selects whether the person goes to Police or Drug dealer. I want random selection, I mean a player types /dd and he is selected in the team. The selection should be done 1 by 1 so there are equal number of players in each team. * fixed *
-
I created a ptp game mode. This code selects the player as a president but I want to disable the selection if there is already a president selected. *removed*
-
Its working now. Thanks for the help.
-
Hello, I found this example of code on the wiki. So it basically give a reward of $10,000 to the player when he kills a person. I want to disable the reward if the player who was killed is in the same team as the killer. local team = getPlayerTeam(killer) local victim = getPlayerName ( source ) function rewardOnWasted ( ammo, killer, killerweapon, victim ) if isPlayerInTeam(victim, team) then return end if ( killer ) then givePlayerMoney ( killer, 10000 ) end end addEventHandler ( "onPlayerWasted", getRootElement(), rewardOnWasted )
-
Oh I see. We need to write this code in .lua file located in our map folder? And what if I want the map to be for everyone?
- 14 replies
-
Where the hell do I need to add my map name and target player name?
- 14 replies
-
My script enables god mode for the players who are not wanting to deathmatch. This code is supposed to take away weapons and allow the weapons which are in the allowed table. Need help in takeWeapon. ocal allowed = { [10] = true, [11] = true, [12] = true, [13] = true, [14] = true, [15] = true, [44] = true, [45] = true, [46] = true, [43] = true, } function disableWeaponOnGodMod (prev,new) if getElementData(localPlayer, "invincible") and not allowed[getPedWeapon(localPlayer)] then takeWeapon(localPlayer, not allowed[getPedWeapon(localPlayer)]) end end addEventHandler ( "onClientRender", root, disableWeaponOnGodMod )
-
I want to color the blips of players according to their name color. What should I edit in this code? function updatePlayerBlips() if not g_PlayerData then return end local wnd = isWindowOpen(wndSpawnMap) and wndSpawnMap or wndSetPos local mapControl = getControl(wnd, 'map') for elem,player in pairs(g_PlayerData) do if not player.gui.mapBlip then player.gui.mapBlip = guiCreateStaticImage(0, 0, 9, 9, elem == g_Me and 'localplayerblip.png' or 'playerblip.png', false, mapControl) player.gui.mapLabelShadow = guiCreateLabel(0, 0, 100, 14, player.name, false, mapControl) local labelWidth = guiLabelGetTextExtent(player.gui.mapLabelShadow) guiSetSize(player.gui.mapLabelShadow, labelWidth, 14, false) guiSetFont(player.gui.mapLabelShadow, 'default-bold') guiLabelSetColor(player.gui.mapLabelShadow, 0, 0, 0) player.gui.mapLabel = guiCreateLabel(0, 0, labelWidth, 14, player.name, false, mapControl) guiSetFont(player.gui.mapLabel, 'default-bold') local r, g, b = getPlayerNametagColor(g_Me) guiLabelSetColor(player.gui.mapLabel, r, g, b) for i,name in ipairs({'mapBlip', 'mapLabelShadow'}) do addEventHandler('onClientGUIDoubleClick', player.gui[name], function() server.warpMe(elem) closeWindow(wnd) end, false ) end end local x, y = getElementPosition(elem) x = math.floor((x + 3000) * g_MapSide / 6000) - 4 y = math.floor((3000 - y) * g_MapSide / 6000) - 4 guiSetPosition(player.gui.mapBlip, x, y, false) guiSetPosition(player.gui.mapLabelShadow, x + 14, y - 4, false) guiSetPosition(player.gui.mapLabel, x + 13, y - 5, false) end end
-
I drew an image on my login screen but the image does not work for every resolution. local Width,Height = 350,350 local x, y = guiGetScreenSize() local px, py = 1980, 1080 local sx, sy = (x/px), (x/py) Image = guiCreateStaticImage( x/2-640, y/2-360, 1980, 1280, "login_bg.png", false) Can anybody help me how do I make it work for every resolution?
-
How can I hide hud when the login screen is visible? 60% components of the hud are hidden but rest 40% are showing. The hud is custom btw. Functions of hud: DXdraw(), hudvisible(), pingFpsCiz() drawRadar() Function name of login panel: open_log_reg_pannel() I mean is there anyway I can stop the functions of hud when function of login panel is running?
-
'It outputs in chatbox as a blank message' if color coded. I mean if a player types message color coded it should show error like: Message should not contain color codes.
-
Didn't work. No errors in the debugscript either.
-
I want to disable color codes from the chat and from player's nickname. The color doesn't appear in chat but it outputs in chatbox as a blank message. This is my chat script, if needed: addEventHandler('onPlayerChat', g_Root, function(msg, type) if type == 0 then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox(getPlayerName(source) .. ': #FFFFFF' .. msg:gsub('#%x%x%x%x%x%x', ''), g_Root, r, g, b, true) outputServerLog( "CHAT: " .. getPlayerName(source) .. ": " .. msg ) end end )
-
Thanks DakiLLa, it worked. But still there is a problem that anim binds are working when in a vehicle although the animation isn't working from F1 / Animation. Tried this, but didn't work: addCommandHandler('anim', function(command, lib, name) if not getPedOccupiedVehicle(g_Me) then server.setPedAnimation(g_Me, lib, name, true, true) end )
-
Nope, did not work.
-
I had the animation code in freeroam file. This is the code: --------------------------- --- Set animation window --------------------------- function applyAnimation(leaf) if type(leaf) ~= 'table' then leaf = getSelectedGridListLeaf(wndAnim, 'animlist') if not leaf then return end end server.setPedAnimation(g_Me, leaf.parent.name, leaf.name, true, true) end function stopAnimation() server.setPedAnimation(g_Me, false) end wndAnim = { 'wnd', text = 'Set animation', width = 250, x = -20, y = 0.3, controls = { { 'lst', id='animlist', width=230, height=290, columns={ {text='Animation', attr='name'} }, rows={xml='animations.xml', attrs={'name'}}, expandlastlevel=false, onitemdoubleclick=applyAnimation }, {'btn', id='set', onclick=applyAnimation}, {'btn', id='stop', onclick=stopAnimation}, {'btn', id='close', closeswindow=true} } } addCommandHandler('anim', function(command, lib, name) server.setPedAnimation(g_Me, lib, name, true, true) end ) The definition for this g_Me is "g_Me = getLocalPlayer()"
-
I want to disable animation when the ped is in vehicle. I tried this, but it didn't work. Any help please? function stopAnimation2() if isPedInVehicle (g_Me) then server.setPedAnimation(g_Me, false) end
-
[REL] ModLoader 1.0 - Loads any mod without scripting!
Gravestone replied to Deltanic's topic in Resources
Where should we add the .hnd file? -
Where do I add the .hnd file?
-
[REL] ModLoader 1.0 - Loads any mod without scripting!
Gravestone replied to Deltanic's topic in Resources
Where do I place the handling file? -
Downloaded a brand new mod, still, appearing white.
-
Thanks @Bonus!
-
I want to add shade to nametags. I tried this: dxDrawText ( playerName, sx, sy - offset, sx, sy - offset, tocolor(0,0,0,200), textScale*Nametags_Size*0.8, myfont, "center", "bottom", false, false, false, true, true ) dxDrawText ( playerName, sx, sy - offset, sx, sy - offset, tocolor(r,g,b,255), textScale*Nametags_Size*0.7, myfont, "center", "bottom", false, false, false, true, true ) Result : http://imgur.com/A5mki3i