Jump to content

Why this isn't working?


Feche1320

Recommended Posts

I have this little code using it like a resource:

  
addEvent("onPlayerPickupRacePickup", true) 
function test(pickupID, pickupType, vehicleModel) 
    outputChatBox(pickupID.. " "  ..pickupType.. " " ..vehicleModel) 
end 
addEventHandler("onPlayerPickupRacePickup", getRootElement(), test) 

But when I pick up a pickup, it doesn't get called.

Thanks

Link to comment

Yes, it is, but I found something wierd, it only works on this function (it's another script on different file):

  
addEvent("onPlayerPickUpRacePickup", true) 
    function onPlayerPickUpRacePickup(pickupID, pickupType, vehicleModel) 
        if pickupType == "vehiclechange" and vehicleModel == 425 and g_GotHunter[source] == 0 then 
            if string.find(g_MapInfo.name, "[DM]", 1, true) then 
                outputChatBox('' ..getPlayerName(source).. ' got the hunter! (+$500)') 
                givePlayerMoney(source, 500) 
                g_GotHunter[source] = 1 
                toggleControl ( source, "vehicle_secondary_fire", false ) 
                if gm == 0 then 
                    outputChatBox("#FF0000Disabling Ghostmode in 10 seconds...", getRootElement(), 255, 255, 255, true) 
                    setTimer(gmoff, 10000, 1) 
                    gm = 1 
                end 
            end 
        end 
    end 
addEventHandler("onPlayerPickUpRacePickup", getRootElement(), onPlayerPickUpRacePickup) 

I also disabled that ussing '--[[ ]]--' and the other one still wasn't working, really wierd.

Link to comment

Oh lol, thank you so much!

Another little question, how can I delete a file but from a resource?

I have a command in a resource that deletes player toptimes and a archive contaning the player ghost car, but the ghost car archive is in another resource, and if I use this:

fileDelete("race_ghost/ghosts/" ..getMapName().. ".ghost") 

It will be like doing:

fileDelete("race_toptimes/race_ghost/ghosts/" ..getMapName().. ".ghost") 

Anything else?

Thanks

EDIT:

No no no no no,nevermind, I forgot to add :

EDIT2:

Ah, no, got an error:

ERROR: race_toptimes\toptimes_server.lua:406: fileDelete failed; ModifyOtherObjects in ACL denied resource race_toptimes to access race_ghost 

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...