Feche1320 Posted December 29, 2010 Posted December 29, 2010 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 www.host-ar.com.ar
Aibo Posted December 29, 2010 Posted December 29, 2010 vehicleModel can be nil (or false), if pickupType is not vehiclechange. nil/boolean concatenation will cause error ?
Feche1320 Posted December 29, 2010 Author Posted December 29, 2010 Nope, I only used a Hunter pickup, and debugscript didn't give me any error. www.host-ar.com.ar
Feche1320 Posted December 29, 2010 Author Posted December 29, 2010 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. www.host-ar.com.ar
Aibo Posted December 29, 2010 Posted December 29, 2010 your event name: "onPlayerPickupRacePickup" correct event name: "onPlayerPickUpRacePickup" spot the difference :3 ?
Feche1320 Posted December 29, 2010 Author Posted December 29, 2010 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 www.host-ar.com.ar
Castillo Posted December 30, 2010 Posted December 30, 2010 try adding the resource to group admin in acl.xml San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now