Jump to content

vanishSHC

Members
  • Posts

    19
  • Joined

  • Last visited

Everything posted by vanishSHC

  1. yeah, guess this post became more of a headsup for that particular resource.
  2. well after some trial and error i started and stopped each individual resource and fired one bullet at the driver (my friend whom is currently lanning with me) and we determined that it is the trials resource a Vehicle Stunt Animation posted on the community website. Just a note to anyone who runs into that error. I dont see why i have this script anyway. It's cool but... meeeh
  3. So driving around on my server today (vehicle does not matter) I noticed that when I get shot in the drivers seat the vehicle flys up in the air and spins out of control. Assuming this is a resource based issue... Has anyone ever heard of this? Any way to fix it? Any Idea what it could be for that matter?
  4. Okay so here is the updated code with SDK's suggestion... SetElementPosition would be a viable option as well and might incorporate it with other events rather than the initial spawn. I disabled P-spawn to program my own initial gui team selection screen, and to allow the script below to function, however. it doesnt function. --Teamless Weapons aka hobo local hoboWeapon = 30 local hoboAmmo = 2000 local hoboOtherWeapon = 24 local hoboOtherAmmo = 2000 --Police Weapons local copWeapon = 25 local copAmmo = 2000 local copOtherWeapon = 22 local copOtherAmmo = 2000 local copStick = 3 --Medical Weapons local medWeapon = 23 local medAmmo = 2000 local medOtherWeapon = 14 --Repo Weapons local repoWeapon = 32 local repoAmmo = 2000 local repoOtherWeapon = 5 --Spawn Grouping local hoboSpawnX = 2494 local hoboSpawnY = -1666 local hoboSpawnZ = 14 local hoboSpawnRotation = 0 local copSpawnX = 1554.05 local copSpawnY = -1791.14 local copSpawnZ = 13.3 local copSpawnRotation = 270 local medSpawnX = 2038.23 local medSpawnY = -1411.24 local medSpawnZ = 17.1 local medSpawnRotation = 0 local repoSpawnX = 1604.40 local repoSpawnY = -1791.14 local repoSpawnZ = 13.3 local repoSpawnRotation = 0 --join spawnhandler function joincops(source) setPlayerTeam" class="kw6">setPlayerTeam" class="kw6">setPlayerTeam (source, getTeamFromName("Police")) spawnPlayer (source, copSpawnX, copSpawnY, copSpawnZ, copSpawnRotation, 280) takeAllWeapons (source) giveWeapon(source, copWeapon, copAmmo) giveWeapon(source, copStick) giveWeapon(source, copOtherWeapon, copOtherAmmo) end addCommandHandler ("joinpolice",joincops) --deadspawnhandler function spawndeadcops(source) playerteam = getPlayerTeam" class="kw2">getPlayerTeam(source) if (playerteam == getTeamFromName("Police")) then takeAllWeapons (source) spawnPlayer (source, copSpawnX, copSpawnY, copSpawnZ, copSpawnRotation, 280) giveWeapon(source, copWeapon, copAmmo) giveWeapon(source, copStick) giveWeapon(source, copOtherWeapon, copOtherAmmo) end end addEventHandler ( "onClientPlayerWasted", getRootElement(), spawndeadcops ) --join spawnhandler function joindocs(source) setPlayerTeam" class="kw6">setPlayerTeam" class="kw6">setPlayerTeam (source, getTeamFromName("Medical")) spawnPlayer (source, medSpawnX, medSpawnY, medSpawnZ, medSpawnRotation, 275) takeAllWeapons (source) giveWeapon(source, medWeapon, medAmmo) giveWeapon(source, medOtherWeapon) end addCommandHandler ("joinmedical",joindocs) --deadspawnhandler function spawndeaddocs(source) playerteam = getPlayerTeam" class="kw2">getPlayerTeam(source) if (playerteam == getTeamFromName("Medical")) then takeAllWeapons (source) spawnPlayer (source, medSpawnX, medSpawnY, medSpawnZ, medSpawnRotation, 280) giveWeapon(source, medWeapon, medAmmo) giveWeapon(source, medOtherWeapon) end end addEventHandler ( "onClientPlayerWasted", getRootElement(), spawndeaddocs ) function joinreposs(source) setPlayerTeam" class="kw6">setPlayerTeam" class="kw6">setPlayerTeam (source, getTeamFromName("Vehicle Repossession")) spawnPlayer (source, repoSpawnX, repoSpawnY, repoSpawnZ, repoSpawnRotation, 50) takeAllWeapons (source) giveWeapon(source, repoWeapon, repoAmmo) giveWeapon(source, repoOtherWeapon) end addCommandHandler ("joinrepo",joinreposs) --deadspawnhandler function spawndeadreposs(source) playerteam = getPlayerTeam" class="kw2">getPlayerTeam(source) if (playerteam == getTeamFromName("Vehicle Repossession")) then takeAllWeapons (source) spawnPlayer (source, repoSpawnX, repoSpawnY, repoSpawnZ, repoSpawnRotation, 280) giveWeapon(source, repoWeapon, repoAmmo) giveWeapon(source, repoOtherWeapon) end end addEventHandler ( "onClientPlayerWasted", getRootElement(), spawndeadreposs ) function quitteam(source) setPlayerTeam" class="kw6">setPlayerTeam" class="kw6">setPlayerTeam (source, nil) setElementModel(source, 230) takeAllWeapons (source) giveWeapon(source, hoboWeapon, hoboAmmo) giveWeapon(source, hoboOtherWeapon, hoboOtherAmmo) spawnPlayer (source, hoboSpawnX, hoboSpawnY, hoboSpawnZ, hoboSpawnRotation, 230) giveWeapon(source, hoboWeapon, hoboAmmo) giveWeapon(source, hoboOtherWeapon, hoboOtherAmmo) end addCommandHandler ("quitteam",quitteam) function spawndeadhobo(source) playerteam = getPlayerTeam" class="kw2">getPlayerTeam(source) if (playerteam == getTeamFromName(nil)) then takeAllWeapons (source) spawnPlayer (source, hoboSpawnX, hoboSpawnY, hoboSpawnZ, hoboSpawnRotation, 280) giveWeapon(source, hoboWeapon, hoboAmmo) giveWeapon(source, hoboOtherWeapon) end end addEventHandler ( "onClientPlayerWasted", getRootElement(), spawndeadhobo ) Seems like the Dead Players do not spawn instead they revert to the initial play/freeroam spawn. If i can get this working i can incorporate it into a gui hopefully somehow But thats a different story. Anyone got any idea why this wouldnt work? No output errors in the console. Thanks for all your help!
  5. Hello, I have a script where I have 3 teams. 1. Police 2. Medical 3. Repo Now I am using p-spawn for the initial spawn, Teamless people are homeless and spawn in grove street However, I want to make it so that in my function for the join team i.e joinpolice it kills the player and spawns them elsewhere( i.e. police station) . Now that part is the easy part... the question is... when they die... i dont want them being sent to grove street. (because p-spawn has a function for that...) However, I dont really want to destroy the p-spawn script. So i was wondering if there was a easy way to attach an if then statement with getPlayerFromTeam or similar function to make it so if the police die they go right back to where i initially spawned them when they joined the team. If the player isnt on a team, p-spawn will kick in and send them to grove street. Here is my current code. First script, Server Sided, makes the team. the end: function createTeamsOnStart () createTeam ( "Police", 0, 0, 255 ) createTeam ( "Medical", 255, 0, 0 ) createTeam ( "Vehicle Repossession", 255, 255, 0 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart ) Second script, join command handlers takeaway weapons and then give specific weapons for that team and sets the skin and what not: --Teamless Weapons aka hobo local hoboWeapon = 30 local hoboAmmo = 2000 local hoboOtherWeapon = 24 local hoboOtherAmmo = 2000 --Police Weapons local copWeapon = 25 local copAmmo = 2000 local copOtherWeapon = 22 local copOtherAmmo = 2000 local copStick = 3 --Medical Weapons local medWeapon = 23 local medAmmo = 2000 local medOtherWeapon = 14 --Repo Weapons local repoWeapon = 32 local repoAmmo = 2000 local repoOtherWeapon = 5 --Add more vars function joincops(source) setPlayerTeam" class="kw6">setPlayerTeam" class="kw6">setPlayerTeam (source, getTeamFromName("Police")) setElementModel(source, 280) takeAllWeapons (source) giveWeapon(source, copWeapon, copAmmo) giveWeapon(source, copStick) giveWeapon(source, copOtherWeapon, copOtherAmmo) end addCommandHandler ("joinpolice",joincops) function joindocs(source) setPlayerTeam" class="kw6">setPlayerTeam (source, getTeamFromName("Medical")) setElementModel(source, 275) takeAllWeapons (source) giveWeapon(source, medWeapon, medAmmo) giveWeapon(source, medOtherWeapon) end addCommandHandler ("joinmedical",joindocs) function joinreposs(source) setPlayerTeam" class="kw6">setPlayerTeam" class="kw6">setPlayerTeam (source, getTeamFromName("Vehicle Repossession")) setElementModel(source, 50) takeAllWeapons (source) giveWeapon(source, repoWeapon, repoAmmo) giveWeapon(source, repoOtherWeapon) end addCommandHandler ("joinrepo",joinreposs) function quitteam(source) setPlayerTeam" class="kw6">setPlayerTeam (source, nil) setElementModel(source, 230) takeAllWeapons (source) giveWeapon(source, hoboWeapon, hoboAmmo) giveWeapon(source, hoboOtherWeapon, hoboOtherAmmo) end addCommandHandler ("quitteam",quitteam) I was just wondering if anyone knew how to go about this painlessly P.S. i didnt add the kill player and spawn points yet. P.S again: Don't know whats up with that kw6 shit being added so ignore it
  6. That would be it. However i recommend putting your code in HERE so you don't get chewed out However the little house icons are blips not markers from my knowledge Are you saying you want it on the minimap? If so look for a blip section in the code and check out the blip ID's on the wiki. Other than that, If you want the marker (the corona) to be that icon instead I think someone else would have to help you with that
  7. Ah i see that now, makes perfect sense. I did some moving around/added some things and it works like a charm! thanks alot for your help
  8. Thanks SDK for reworking my script Im just having one issue however... Server Sided File containing the location code is giving me an Error. Error:Missions\Mission2\.lua:3: attempt to index global 'location' (a nil value) local pizzablip, pizzamarker, house local locations = {} location[1] = { x = 2363.1, y = -1672, z = 13.3, blipicon = 32, reward = 100 } location[2] = { x = 2157.4, y = -1792, z = 13.3, blipicon = 32, reward = 250 } No blips are showing up, i also tried this client sided. So close yet far away heh. Not quite sure what to do
  9. Done. Sorry bout that Overlooked it
  10. Okay, I've realized since the beginning that you guys aren't here to code these scripts for me... And I'm not looking to post my entire code here seeing as the amount of people taking code and claiming it as their own nowadays but basically I have 2 functions that don't function as well as I hoped. The Deliver function and the House function. My Deliver Function: function deliver(thePlayer, matchingDimension) if isElementWithinMarker(thePlayer, pizzamarker) then -- if element is indeed in the marker and types /deliver givePlayerMoney(thePlayer, 100) --reward destroyElement (pizzablip) destroyElement (pizzamarker) return mission2(theVehicle,Seat,Jacked) else end end addCommandHandler("deliver", deliver) My House Function: function mission1(theVehicle,seat,jacked) if ( getElementModel ( theVehicle ) == 448 ) then -- if its a pizzaboy outputChatBox("You have entered a Pizza Delivery Vehicle, Deliver the Pizza to the Red House Blip on your MiniMap and type /deliver!", source,255,0,0) pizzablip = createBlip(2363.1,-1672.0, 13.5, 32, 2, 255, 0, 0) pizzamarker = createMarker(2363.1,-1672.0, 12.8, "cylinder", 2, 255, 0, 0) end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), mission1 ) function mission2(theVehicle,seat,jacked) outputChatBox("Okay! That went well, You're next delivery is up! Don't forget to use /deliver!", source,255,0,0) pizzablip = createBlip(2157.4, -1792.0 ,13.3, 32, 2, 255, 0, 0) pizzamarker = createMarker(2157.4, -1792.0 ,13.3,"cylinder", 2, 255, 0, 0) end Now my issues are that each individual house that I have programmed with the "pizzablip" and "pizzamarker" responds to the function above... After the blip is destroyed upon delivery it points to another function (each house location being its own function). 1. I don't want a linear pattern I want it to randomly select a new house after each delivery (It would seem stupid and repetitive to drive the same pizza route) (especially being an ex pizza driver IRL i would probably cry if the same people ordered pizza everyday in the same exact order lol) I have it set so that when you enter the vehicle it starts mission1. The reason why my code is written the way it was because it was more trial and error to get it working. 2. The /deliver function does not destroy the second house's blip/marker (I've tried to make it pizzablip2 rather than just pizzablip but that causes it to function more linear and i want it more randomized) I dont want to have to make /deliver1 /deliver2 /deliver 3 to get each individual house to point the next house. 3. The first house is completely fine, It works... /deliver destroys it and points me to the 2nd house. When i go to the second house It doesnt destroy it but awards the money. Obviously this is something to do with the pizzamarker and pizzablip portion of my code on the second mission. 4. I don't want the same amount of money per house granted! That would mean everyone is making 100 dollar orders!!! So, That being said. Could anyone possibly point me in the right direction as far as making this script function the way I stated above? Oh and, I won't be surprised if any of you tell me i need to rewrite this completely. Feel free to PM me about this as well.
  11. Ah thanks guys, got it workin now
  12. Ah well that sounds like it'll work. The goal is to just make a stationary smoking script but anyway.Im having an issue so far local xl,yl,zl = getPedBonePosition (ped, 25) function bluntequip () local blunt = createObject (1485, 0,0,0) attachElements ( blunt, getLocalPlayer(), xl, yl, zl + 1 ) end -- attach it to an event addCommandHandler ( "smokeblunt" , bluntequip ) I am perplexed as I vaguely know what I am doing at this point lol Obviously this code doesnt work, neither did my last attempt. I know im using the right parameters perhaps missing a couple things
  13. Ah, that saddens me. Oh well. I suppose I'll find an alternative thing to do with it til' weapons/peds are supported. Any idea when that will be released?
  14. Hello again. I'm having an issue trying to import a txd/dff over the brassknuckles model into my server. Instead of having brassknuckles I want to replace it with a cigar. Here is the code. Meta: <meta> <info author="n0ps" version="1.1" name="textures" type="misc" /> <script src="skins.lua" type="client" /> <file src="models/brassknuckles.txd"/> <file src="models/brassknuckles.dff"/> </meta> skin.lua: function onResourceStart() blunt = engineLoadTXD ( "models/brassknuckles.txd" ) engineImportTXD ( blunt, 331 ) dff = engineLoadDFF ( "models/brassknuckles.dff", 0 ) engineReplaceModel ( dff, 331 ) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onResourceStart) When I load it, I have no model at all for the brass knuckles. No console errors. I Believe its something to do with the engineLoadDFF line. However the wiki tells me I shouldnt use a number if im not replacing a vehicle texture. Any ideas?
  15. Thank you That worked perfectly!
  16. Okay, So I'd like to think im on the right track as far as making this sound work. I have a DJ booth set up outside of my bar with animated ped's around it dancing n smokin n drinkin... The one I am doing is currently located in LS at the beach. However, I cannot hear anything when i go to the given coordinates from any distance. It looks silly watching them dance to nothing. I am getting No debug Errors either from this resource. Should I attach it to the DJ booth? Or is it possible to do it how i am currently attempting? Meta Code: <meta> <info author="n0ps~>sHc" type="play2" name="sHc Auto" description="booth music" /> <script src="customsfx.lua" /> <file src="sounds/dub.mp3" /> </meta> Lua Code: function onResourceStart() local sound = playSound3D("sounds/dub.mp3", 584.48, -1884.20, 3.92, true) setSoundMinDistance ( sound, 0 ) setSoundMaxDistance ( sound, 15 ) setSoundVolume(sound, 1) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onResourceStart) Im thinking its something to do with the event handler. Anyway Help would be appreciated!
  17. HAHA wow i am blind! thank you dzek I guess it was just confusion seeing as I figured all this code would work (which now it does thanks to you giving me an eye exam). Syntax just threw me off Feel free to close
  18. Okay so... Heres my schpele, ive been programming LUA for a little bit now, pretty basic nothing too fancy... I am having a problem assigning players to a team (based off a command handler) I have three parts to my script. 1. Obviously the Meta 2. Team.lua On Resource start creates the team 3. Team2.lua - For Purpose of Assigning based off A command Team1LUA Source function createTeamsOnStart () teamHoods = createTeam ( "Hoods", 0, 255, 0 ) teamMedical = createTeam ( "Medical", 255, 0, 0 ) teamPolice = createTeam ( "Police", 0, 0, 255 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart ) ^works just how i wanted it to... Now for the erroneous script... Heres Team 2 Team2 LUA Source: function assignteamP setPlayerTeam (thePlayer, Police) if teamPolice = getPlayerTeam ( source ) -- get the player's team outputChatBox ( getPlayerName ( source ).."has joined the Police Force" ) else outputChatBox ( getPlayerName ( source ) .. " Was not successfully assigned to Police Force" ) end addCommandHandler ( "Team P", assignteamP ) function assignteamM setPlayerTeam (thePlayer, Medical) if teamMedical = getPlayerTeam ( source ) -- get the player's team outputChatBox ( getPlayerName ( source ).."has joined the sHc Doctors Coalition" ) else outputChatBox (getPlayerName ( source ) .. " Was not successfully assigned to sHc Doctors Coalition" ) end addCommandHandler ( "Team M", assignteamM ) function assignteamH (setPlayerTeam( thePlayer, Hoods) if teamHoods = getPlayerTeam ( source ) -- get the player's team outputChatBox (getPlayerName ( source ).."has joined the Hoodrats Team" ) else outputChatBox (getPlayerName ( source ) .. " Was not successfully assigned to Hoodrats Team" ) end addCommandHandler ("Team H", assignteamH ) function quitteam local theTeam = getPlayerTeam ( source ) if theTeam then setPlayerTeam ( source, nil ) -- remove the player from the current team end addCommandHandler ( "quitteam", quitteam) My Server is outputting that I have an error in team2lua line2 Teams\team2.lua:2: '('expected near 'setPlayerTeam' WARNING: Loading Script failed: Teams\Team2.lua:2: '(' expected near 'setPlayerTeam' start Resource "teams" started Perhaps i'm a bit daft and went about this the entirely wrong way... but i hope you can see what I am trying to do at least haha. Now this is just for an understanding on how to assign teams on server startup based off command handlers and shit like that. However, the real goal is to port this into GUI and not really use the commands (NOT what im trying to accomplish now though)... Thats a stretch when it doesnt quite work based off LUA Obviously I need to revamp my code. haha Any Takers? So... theres my issue heh. I would love for it to work.
×
×
  • Create New...