-
Posts
3,875 -
Joined
-
Days Won
67
Everything posted by DNL291
-
remove it from file fr_server.lua of your resource freeroam addEventHandler('onPlayerChat', g_Root, function(msg, type) if type == 0 then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox(getPlayerName(source) .. '#FFFFFF: #FFFFFF' .. msg:gsub('#%x%x%x%x%x%x', ''), g_Root, r, g, b, true) outputServerLog( "CHAT: " .. getPlayerName(source) .. ": " .. msg ) end end )
-
server showPlayerHudComponent ( thePlayer, component, show ) client showPlayerHudComponent ( component, show )
-
https://community.multitheftauto.com/index.php?p= ... ls&id=4157
-
need to cancel the event for other skins not catch the pickup
-
I do not want to know whether it is single or not. the question is whether it works.
-
why do you say that? does not work for you? arrange and then only post. as I said please post the error that hinders the functioning of the script, as you say
-
oh, not needed it. location = getPedWeapon weapon (player) if ( matchingDimension ) then destroyElement( player ) removeEventHandler ( "onPickupHit" , origem, onDeathPickupHit ) giveWeapon( player, weapon, false ) but anyway operate normally.
-
cancelEvent the pickup will not disappear and the player will not pick up the weapon. destroyElement dont work. then show the error
-
only the specified skins can get the pickup. and it is working.
-
not take anything from your code.
-
function playSoundOnJoin() playSound("mySound.mp3") -- the name of your sound .mp3 end addEventHandler("onClientResourceStart", resourceRoot, playSoundOnJoin) setTimer(playSoundOnJoin, 15000, 1)
-
we've spent enough information. the rest you can learn in the wiki. https://wiki.multitheftauto.com/wiki/Main_Page
-
lockSkins = { [287] = true, [121] = true } function onDeathPickupHit( player ) local skin = getElementModel(player) if ( lockSkins[skin] ) then getPickupWeapon( player ) else cancelEvent() outputChatBox("*Só militares podem pegar esta arma.", player, 255, 0, 0) end end function destroyDeathPickup( pickup ) removeEventHandler("onPickupHit", pickup, onDeathPickupHit ) destroyElement( pickup ) end addEventHandler("onPlayerWasted", root, function (totalammo, killer, killerweapon, bodypart) local timeout = 60000 local x, y, z = getElementPosition( source ) local currentweapon = getPedWeapon( source ) local totalammo = getPedTotalAmmo( source ) local pickup = createPickup( x, y, z, 2, currentweapon, timeout, totalammo ) addEventHandler("onPickupHit", pickup, onDeathPickupHit) setTimer( destroyDeathPickup, timeout, 1, pickup ) end) is an example of wiki. https://wiki.multitheftauto.com/wiki/CreatePickup
-
and you posted in the wrong place
-
check if this type server side in the meta.xml
-
try function createDeathPickup ( totalammo, killer, killerweapon, bodypart ) --when a player dies local skin = getElementModel(source) if ( skin == 287 ) or ( skin == 121 ) and ( seat == 0 ) then local x, y, z = getElementPosition ( source ) --get the position of the person who died and define it as x, y and z local currentweapon = getPedWeapon ( source ) --get the current weapon of the dead person createPickup ( x, y, z, 2, currentweapon, 10000, totalammo ) else outputChatBox ( "*Você não pode entrar neste veículo.", player, 255, 00, 00) --info in chatbox end end addEventHandler ( "onPlayerWasted", getRootElement(), createDeathPickup ) --add an event handler for onPlayerWasted
-
worked for me when car change,color too when you enter a vehicle, the color is equal to your team. That's what you want?
-
make sure the server side in the meta.xml
-
setVehicleDamageProof( theVehicle, damageProof ) -- theVehicle: The vehicle you wish to make damage proof. damageProof: true is damage proof, false is damageable. addEventHandler("onClientPlayerDamage", root, function () cancelEvent() end)