Jump to content

Bombix95

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by Bombix95

  1. Hi guys, i'm here asking your help. I need to spawn a projectile (id 19 the rocket) from an object position and rotation, i'll explain better: I have a vehicle, with an object attached to it that i rotate by input. Now this object has another object attached to it (a orange marker) that emulates a muzzle point, now what i'm trying to do is to spawn a rocket (when player presses the left mouse button) at the 'muzzle' location and rotation, like a Tank shell. I've already tried : ==> putting my player as the creator of the projectile, the result is that the rocket is spawned based on camera look rotation (u shoot where ur looking) ==> putting my vehicle as the creator of the projectile, the result is that the rocket is spawned based on the vehicle forward look (u shoot straight forward) if anyone can lead me in the right direction I'd be grateful Thanks in advance Bye
  2. Hi guys, i have an annoing problem with my GM. Basically this is my script, is Server-Side addEventHandler("onResourceStart", resourceRoot, function() teamAttackers = createTeam ( "Attackers", 255, 0, 0 ) teamDefenders = createTeam ( "Defenders", 0, 128, 255) setTeamFriendlyFire(teamAttackers, false) setTeamFriendlyFire(teamDefenders, false) for i,player in ipairs(getElementsByType("player")) do SpawnPlayer(player) end end ) function AutoAssign() local AttT = getTeamFromName("Attackers") local DefT = getTeamFromName("Defenders") local AttackersCount = countPlayersInTeam(AttT) local DefendersCount = countPlayersInTeam(DefT) if AttackersCount == DefendersCount then setPlayerTeam(source, teamAttackers) elseif AttackersCount > DefendersCount then setPlayerTeam(source, teamDefenders) elseif AttackersCount < DefendersCount then setPlayerTeam(source, teamAttackers) end SpawnPlayer(source) end addEventHandler ( "onPlayerJoin", getRootElement(), AutoAssign) function headshotKill ( attacker, attackerweapon, bodypart, loss ) if bodypart == 9 then setElementHealth(source, getElementHealth(source)-(loss*2)) elseif bodypart == 3 then setElementHealth(source, getElementHealth(source)-loss) elseif bodypart == 4 or bodypart == 5 or bodypart == 6 or bodypart == 7 or bodypart == 8 then setElementHealth(source, getElementHealth(source)-(loss/2)) end end addEventHandler ( "onPlayerDamage", getRootElement(), headshotKill ) function SpawnPlayer (player) local pTeam = getPlayerTeam(player) if pTeam == teamAttackers then spawnPlayer(player, -5.0,0.0,5.0,90.0, 0) setElementModel(player, classSkins[math.random(1, #classSkins)]) elseif pTeam == teamDefenders then spawnPlayer(player, 5.0,0.0,5.0,90.0, 0) setElementModel(player, classSkins[math.random(1, #classSkins)]) else spawnPlayer(player, 5.0,0.0,5.0,90.0, 0) setElementModel(player, classSkins[math.random(1, #classSkins)]) end takeAllWeapons(player) if getElementModel(player) == 284 then giveWeapon (player, 34, 30, true) giveWeapon (player, 24, 60, false) elseif getElementModel(player) == 285 then giveWeapon (player, 27, 60, true) giveWeapon (player, 24, 60, false) elseif getElementModel(player) == 287 then giveWeapon (player, 31, 240, true) giveWeapon (player, 24, 60, false) end fadeCamera(player, true) setCameraTarget(player, player) showChat(player, true) end addEventHandler("onPlayerWasted", root, function() setTimer(SpawnPlayer, 5000, 1, source) end ) the problem is that when i join my own server, when i have to spawn it does nothing, but istead i have a black screen that stays there 4ever, and i don't know what's wrong with the script I'll put below my meta.xml if it can help you see some problems with it <meta> <info author="SniperWolf" name="Onslaught" description="Onslaught mod by SniperWolf" type="gamemode" /> <script src="onslaught_c.lua" type="client"/> <script src="onslaught_s.lua" type="server"/> <script src="weapons_models.lua" type="client"/> <script src="weapons_properties.lua" type="server"/> </meta> I've deleted all the file src that are for mods like guns ecc... I hope you guys can help me out Thanks Edit: in the meta.xml i've changed <script src="onslaught_s.lua" type="client"/> to <script src="onslaught_s.lua" type="server"/> i've also solved couple errors in the script that pops up right now, but the problem is still there EDIT 2: guys i've solved it, there were errors in my server script, i've solved them and now it works like a charm I've updated the script so if someone needs help, he can look at this script for further ideas. Thanks for now. Bye
  3. thank u guys, both of u helped me a lot. now...let's get to work
  4. Colshape, I will look into the wiki to see how i can implement it. Thanks a lot xXMadeXx, you helped me a lot with this info. I'll be back soon with some results, positive if possible . Bye
  5. Hi guys, i'm here for an obvious problem I have this idea in my mind and I want to spare it with all of you. I want to build an Active Protection Shield (APS) for a specific class on MTA and i was thinking about doing an object, a sphere in this case and make a COL file and it must behave as following: - the player that's using the APS must be able to shoot from inside to the outside enemies, so he/she can kill'em; - other enemies can't shoot to the player that's using the APS, well they can but their bullets must be stopped by the shield; - all players can walk, run, jump through the shield as it must ignore collisions with everything except for bullets. Now the model is already done, but i dont know how to ignore shoot collision for the player using the APS and activate shoot collision for enemies outside it. For better explanation i put an image below. I hope someone can help me and thanks in advance
×
×
  • Create New...