Maurize Posted August 12, 2010 Share Posted August 12, 2010 (edited) So. I try to create an explosion when the player shoots.. I don´t know what i must add here.. i think i forgot it And yes i know its kinda copy of mta sa wiki cause this script isn´t much longer.. This script should let the shooting look like real. The screen must shake! function explosionOnShoot ( ) if *DONO WHAT I SHOULD WRITE HERE* then local pX, pY, pZ = getElementPosition ( source ) createExplosion ( pX, pY, pZ, 6, source ) end addEventHandler ( "onPlayerShoot", getRootElement(), explosionOnShoot ) Edited August 12, 2010 by Guest Link to comment
dzek (varez) Posted August 12, 2010 Share Posted August 12, 2010 i think i forgot it i think you never knew.. you just copied example from wiki, and wanna make something for you? again.. this is helping forum, not forum for creating requsts.. if you *really* forgot -> https://wiki.multitheftauto.com/ -> I'm pretty sure you will easly remember ^^ Link to comment
Maurize Posted August 12, 2010 Author Share Posted August 12, 2010 this is the point. i can´t find the right thing on Mta sa wiki. I need something like OnPlayerFire .. otherwise I must create a whole new event Isnt there something like: OnButtonDown or something ?? Link to comment
dzek (varez) Posted August 12, 2010 Share Posted August 12, 2010 https://wiki.multitheftauto.com/wiki/Client_Scrip ... Ped_events Link to comment
Maurize Posted August 12, 2010 Author Share Posted August 12, 2010 noo.. even doesnt work .. look: function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip) local pX, pY, pZ = getElementPosition ( source ) if (weapon == 22) then createExplosion(pX, pY, pZ, 6, source) end end addEventHandler("onClientPlayerWeaponFire", getLocalPlayer(), onClientPlayerWeaponFireFunc) Link to comment
dzek (varez) Posted August 12, 2010 Share Posted August 12, 2010 do not bump threads in few minutes (to all thinking it was whole hour - he edited) edit: why do you want to create explosion ON PLAYER? not on the hit position? and why you are creating this explosion only for local player? Link to comment
Maurize Posted August 12, 2010 Author Share Posted August 12, 2010 I want that the whole screen rumbles when player shoots with a gun. In real the recoil would let the body of a human shake, so his eyes shake even. Only the player which shoots the weapon should see the rumble. .. thats what i try to get.. Link to comment
dzek (varez) Posted August 12, 2010 Share Posted August 12, 2010 and you are creating an explosion to achive it? btw: you are using server syntax on client side.. client syntax is: bool createExplosion ( float x, float y, float z, int type [, bool makeSound = true, float camShake = -1.0, bool damaging = true ] ) Link to comment
Maurize Posted August 12, 2010 Author Share Posted August 12, 2010 oh my holy shit.. it works.. You are the best maan! ( Only forgot to set it in meta to client ^^) BUT Now i always see this explosion.. can i make it invisible?? somethig like : getElement .. setVisibile ( 0,... Link to comment
dzek (varez) Posted August 12, 2010 Share Posted August 12, 2010 explosions can't be hidden as far as i remember.. maybe somebody else knows it.. Link to comment
Maurize Posted August 12, 2010 Author Share Posted August 12, 2010 i knew a guy how finished this..he used the power of the camera xDD Link to comment
dzek (varez) Posted August 12, 2010 Share Posted August 12, 2010 setting camera matrix makes impossible to use mouse to rotate screen, and its making arrow keys (wsad) to rotate camera .. for very short effect - its ok.. Link to comment
darkdreamingdan Posted August 13, 2010 Share Posted August 13, 2010 Maybe just create it underground Link to comment
dzek (varez) Posted August 13, 2010 Share Posted August 13, 2010 will be weird when standing on something high Link to comment
Maurize Posted August 13, 2010 Author Share Posted August 13, 2010 Do it exactly +10 over the player .. players won´t be able to move the mouse exactly to this point so they won´t see it.. Link to comment
50p Posted August 13, 2010 Share Posted August 13, 2010 I think there was a type of explosion that was invisible... Maybe it was in SAMP era and it could have been a bug. Link to comment
Maurize Posted August 13, 2010 Author Share Posted August 13, 2010 doesnt matter.. works perfectly.. use tiny explosion and pz+10.. 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