Jump to content

No load my resource illegal charaters


Dimos7

Recommended Posts

<meta> 
    <info gamemodes="race" type="map" name="[shooter]OneLove Dimos - Darkdays is coming up" author="OneLove ft Dimos" version="1.0.0"></info> 
    <map src="Shooter-OneLove-Dimos-Darkdays-coming-up.map" dimension="0"></map> 
    <script src="client.lua" type="client"/> 
    <files src="files/music.mp3"/> 
    <script src="music.lua" type ="client"/> 
    <settings> 
        <setting name="#skins" value='[ "random" ]'></setting> 
        <setting name="#maxplayers" value="[ 128 ]"></setting> 
        <setting name="#useLODs" value="[ false ]"></setting> 
        <setting name="#gamespeed" value="[ 1 ]"></setting> 
        <setting name="#ghostmode" value='[ "false" ]'></setting> 
        <setting name="#time" value="0:0"></setting> 
        <setting name="#vehicleweapons" value='[ "true" ]'></setting> 
        <setting name="#minplayers" value="[ 0 ]"></setting> 
        <setting name="#weather" value="[ 7 ]"></setting> 
        <setting name="#gravity" value="[ 0.0080000003799796104 ]"></setting> 
        <setting name="#waveheight" value="[ 0 ]"></setting> 
        <setting name="#respawntime" value="[ 5 ]"></setting> 
        <setting name="#locked_time" value="[ true ]"></setting> 
        <setting name="#duration" value="[ 600 ]"></setting> 
        <setting name="#respawn" value='[ "none" ]'></setting> 
    </settings> 
</meta> 

Client side

cLP = getLocalPlayer() 
screenWidth, screenHeight = guiGetScreenSize() 
  
function cRStest() 
    setTimer(resourcesCheck, 10000, 1) 
end 
addEventHandler("onClientResourceStart", getRootElement(), cRStest) 
  
function resourcesCheck() 
    if check=="done" then return 
    else 
        setRadioChannel(0) 
        setTimer(cbinds, 1000, 1) 
        textToggle=0 
        check="done" 
    end 
end 
  
function cRS() 
    if check=="done" then return 
    else 
        setRadioChannel(0) 
        setTimer(cbinds, 3333, 1) 
        textToggle=0 
        check="done" 
    end 
end 
addEventHandler("onClientPlayerSpawn", getLocalPlayer(), cRS) 
  
function markers(player) 
    if isPedInVehicle(player) then 
        local vehicle = getPedOccupiedVehicle(player) 
        fixVehicle(vehicle) 
    end 
end 
addEventHandler("onClientMarkerHit", getResourceRootElement(getThisResource()), markers) 
  
function cbinds() 
    local keys1 = getBoundKeys("vehicle_fire") 
    local keys2 = getBoundKeys("vehicle_secondary_fire") 
    if keys1 then 
        for keyName, state in pairs(keys1) do 
            bindKey(keyName, "down", cdoshoot) 
        end 
        bindKey("F", "down", cdoshoot) 
        cbindsText = "- Press F or the button you use to fire to shoot rockets!\n- You can shoot once every 3 seconds.\n- Good luck and have fun!" 
    end 
    if keys2 then 
        for keyName, state in pairs(keys2) do 
            bindKey(keyName, "down", cdoshoot) 
        end 
    end 
    if (not keys1) and (not keys2) then 
        bindKey("F", "down", cdoshoot) 
        bindKey("lctrl", "down", cdoshoot) 
        bindKey("rctrl", "down", cdoshoot) 
        cbindsText = "- Press F or CTRL to shoot rockets!\n- You can shoot once every 3 seconds." 
    end 
    theVehicle = getPedOccupiedVehicle(cLP) 
    allowShoots() 
    bindKey("Z", "down", toggleText) 
    outputChatBox("#56ff44Press #db8181Z #56ff44to show or hide the instructions!", 255, 255, 255, true) 
end 
  
function toggleText() 
    if textToggle==0 then 
        addEventHandler("onClientRender", getRootElement(), bindsText) 
        textToggle=1 
    elseif textToggle==1 then 
        removeEventHandler("onClientRender", getRootElement(), bindsText) 
        textToggle=0 
    end 
end 
  
function allowShoots() 
    bindTrigger = 1 
end 
  
function cdoshoot() 
    if bindTrigger == 1 then 
        if not isPlayerDead(cLP) then 
            bindTrigger = 0 
            local x,y,z = getElementPosition(theVehicle) 
            local rX,rY,rZ = getVehicleRotation(theVehicle) 
            local x = x+4*math.cos(math.rad(rZ+90)) 
            local y = y+4*math.sin(math.rad(rZ+90)) 
            createProjectile(theVehicle, 19, x, y, z, 1.0, nil) 
            setTimer(allowShoots, 3000, 1) 
        end 
    end 
end 
  
function bindsText() 
    dxDrawText(cbindsText, screenWidth/15, screenHeight/2.5, screenWidth, screenHeight, tocolor(0, 149, 254, 255), 0.75, "bankgothic") 
end 
  

αfunction startMusic() 
    setRadioChannel(0) 
    song = playSound("files/music.mp3",true) 
    outputChatBox("Toggle music on/off using M") 
end 
  
function makeRadioStayOff() 
    setRadioChannel(0) 
    cancelEvent() 
end 
  
function toggleSong() 
    if not songOff then 
        setSoundVolume(song,0) 
        songOff = true 
        removeEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) 
    else 
        setSoundVolume(song,1) 
        songOff = false 
        setRadioChannel(0) 
        addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) 
    end 
end 
  
addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),startMusic) 
addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) 
addEventHandler("onClientPlayerVehicleEnter",getRootElement(),makeRadioStayOff) 
addCommandHandler("mkmap1_racetheme",toggleSong) 
bindKey("m","down","mkmap1_racetheme") 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...