Maurize Posted August 12, 2010 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
dzek (varez) Posted August 12, 2010 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 ^^
Maurize Posted August 12, 2010 Author 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 ??
dzek (varez) Posted August 12, 2010 Posted August 12, 2010 https://wiki.multitheftauto.com/wiki/Client_Scrip ... Ped_events
Maurize Posted August 12, 2010 Author 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)
dzek (varez) Posted August 12, 2010 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?
Maurize Posted August 12, 2010 Author 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..
dzek (varez) Posted August 12, 2010 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 ] )
Maurize Posted August 12, 2010 Author 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,...
dzek (varez) Posted August 12, 2010 Posted August 12, 2010 explosions can't be hidden as far as i remember.. maybe somebody else knows it..
Maurize Posted August 12, 2010 Author Posted August 12, 2010 i knew a guy how finished this..he used the power of the camera xDD
dzek (varez) Posted August 12, 2010 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..
dzek (varez) Posted August 13, 2010 Posted August 13, 2010 will be weird when standing on something high
Maurize Posted August 13, 2010 Author 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..
50p Posted August 13, 2010 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.
Maurize Posted August 13, 2010 Author Posted August 13, 2010 doesnt matter.. works perfectly.. use tiny explosion and pz+10..
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