Jump to content

Got a little problem! Nearly Solved!


Maurize

Recommended Posts

Posted (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! xD

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 by Guest
Posted
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 ^^

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

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 o.O

Isnt there something like:

OnButtonDown or something ??

Posted

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

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)

Posted

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?

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

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..

Posted

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 ] )

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

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,...

Posted

explosions can't be hidden as far as i remember.. maybe somebody else knows it..

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

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..

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

will be weird when standing on something high

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...