bravo351 Posted May 9, 2010 Share Posted May 9, 2010 I am plum out of revision ideas on this one, guys... any help would be greatly appreciated. I'm adding missile functionality to the Rustler using projectile 19 (non-heatseeking rocket), and limiting the ammo to 4 shots, one per function per onVehicleEnter (I hope, the counter involved and all that are far from my mind at this phase). For some reason, I can't get this damned clientside script to parse no matter what I change. This is what I have so far for beta... function rustlerMissile1 (player) theRustler = getPedOccupiedVehicle (player) if (theRustler) then local x, y, z = getElementPosition (theRustler) local rx, ry, rz = getElementRotation (theRustler) if getElementID(theRustler) ~= 476 then return else createProjectile (getLocalPlayer(), 19, x-2, y, z-4, 1.0, nil, rx, ry, rz) outputChatBox ( "* " .. getPlayerName(player) .. ", fox-1.", player, 255, 0, 0 ) end end end addCommandHandler ("fox1", rustlerMissile1) function rustlerMissile2 (player) theRustler = getPedOccupiedVehicle (player) if (theRustler) then local x, y, z = getElementPosition (theRustler) local rx, ry, rz = getElementRotation (theRustler) if getElementID(theRustler) ~= 476 then return else createProjectile (getLocalPlayer(), 19, x+2, y, z-4, 1.0, nil, rx, ry, rz) outputChatBox ( "* " .. getPlayerName(player) .. ", fox-2.", player, 255, 0, 0 ) end end end addCommandHandler ("fox2", rustlerMissile2) function rustlerMissile3 (player) theRustler = getPedOccupiedVehicle (player) if (theRustler) then local x, y, z = getElementPosition (theRustler) local rx, ry, rz = getElementRotation (theRustler) if getElementID(theRustler) ~= 476 then return else createProjectile (getLocalPlayer(), 19, x-5, y, z-4, 1.0, nil, rx, ry, rz) outputChatBox ( "* " .. getPlayerName(player) .. ", fox-3.", player, 255, 0, 0 ) end end end addCommandHandler ("fox3", rustlerMissile3) function rustlerMissile4 (player) theRustler = getPedOccupiedVehicle (player) if (theRustler) then local x, y, z = getElementPosition (theRustler) local rx, ry, rz = getElementRotation (theRustler) if getElementID(theRustler) ~= 476 then return else createProjectile (getLocalPlayer(), 19, x+5, y, z-4, 1.0, nil, rx, ry, rz) outputChatBox ( "* " .. getPlayerName(player) .. ", fox-4.", player, 255, 0, 0 ) end end end addCommandHandler ("fox4", rustlerMissile4) Any ideas? I get no errors in console, no outputs to the chatbox, no missile, nothing. Resource is recognized, refreshed each time, console confirms all that. Link to comment
dzek (varez) Posted May 9, 2010 Share Posted May 9, 2010 put some outputDebugString every few lines (after new function, "if", etc) and try to find your bug Link to comment
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