Jump to content

CamShake&count


Recommended Posts

Posted (edited)

1-

is there any code that shake the game cam ?

like the explosion's camShake ?

[ CreateExplosion ]

2-

i want code that count the numbers like

[1]

[2]

[3]

into a gui-label

also it's on race servers

Edited by Guest
Posted (edited)

1. You can do this via event onClientPlayerWeaponFire and

createExplosion 

or you can make this via function

setCameraMatrix 

2. For loop

  
for n = 1, 3 do 
 -- ... 
end 
  

Edited by Guest
Posted
function onClientPlayerWeaponFireFunc ( weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) 
    local pX, pY, pZ = getElementPosition ( localPlayer ) 
    createExplosion ( pX, pY, pZ, 6 ) 
end 
addEventHandler ( "onClientPlayerWeaponFire", localPlayer, onClientPlayerWeaponFireFunc ) 

Posted

Ok i give u an example ..

in the race servers ..

when the race start

isn't numbers show up into the display ?

like

[ 3 ] - [ 2 ] - [ 1 ]

go ...

Posted

1.

local text = guiCreateLabel() 

Use all arguments or write this in comments, otherwise he can understand it's normal.

2.

guiSetText(text,cont) 

count variable is number, but you should use string. ( See wiki ) So you need use tostring function.
guiSetText( text, tostring( cont ) ) 

Guest Guest4401
Posted (edited)
2.
guiSetText(text,cont) 

count variable is number, but you should use string. ( See wiki ) So you need use tostring function.
guiSetText( text, tostring( cont ) ) 

guiSetText automatically converts numerical value to string and displays it, so there's no need to do that actually.

9Cb9h.png

Edited by Guest4401
Guest Guest4401
Posted
I tested before and guiSetText return false.

Strange, it worked for me :shock:.

9Cb9h.png

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