
Dice
Members-
Posts
103 -
Joined
-
Last visited
Everything posted by Dice
-
ok I will test this, thanks a lot.
-
yes it's an arena type thing. but I think onPlayerSpawn would be better use of cpu and ram instead of setting a timer everytime a person dies.
-
addEventHandler( "onPlayerWasted", getRootElement(), function( totalammo, killer, killerWeapon, bodypart ) if isElementWithinColShape ( source, arena ) then local detection = isElementWithinColShape ( source, arena ) local detectionKiller = isElementWithinColShape ( killer, arena ) if detection then if close == 1 then local dx, dy, dz = unpack(randspawn[math.random(#randspawn)]) setTimer ( setElementPosition, 5000, 1, source, dx, dy, dz ) setTimer ( setElementHealth, 5000, 1, killer, 200 ) setTimer ( setElementRotation, 5000, 1, source, 0, 0, 180 ) else setTimer ( setElementPosition, 5000, 1, source, 577.92224121094, -2621.6677246094, 1378.0678710938 ) setTimer ( setElementHealth, 5000, 1, killer, 200 ) setTimer ( setElementRotation, 5000, 1, source, 0, 0, 180 ) end end end end ) What happens here is, if a player get's killed then fill the killers HP to 200 because it is 200. But timer is unreliable, can I embed onPlayerSpawn ? into this? and when I do and try to use the variable killer in it it says it is a nil value. How can I do it this way instead of timers.
-
Never mind, It is not working anyone else?
-
Well it didn't work =\ when they both kill each other something causes them not to spawn
-
(don't you know what happens when you die in Grand Theft Auto San Andreas?) i just said like in gta..... The issue is not the camera the issue is the player never spawns. yes I know spawnPlayer isn't in here but it is in another script. They just stay dead for ever even setCameraTarget won't work all that will do is set the camera around the dead body. anyways this is only happening when the play dies at the same time. but I think i have fixed it, i still need to test it out with someone. If it doesn't work I will come back or think something else.
-
No the camera isn't the problem. The issue was that they stayed in that state after the source dies when they killed each other at the same time. The answer is your BTW : idon't know why I did that. thanks for pointing that out. I think that is the issue for now.
-
Yeah but the thing is they remain dead, so even if i do that they will just be on the ground dead, with the ability to move the camera around.
-
addEventHandler( "onPlayerWasted", getRootElement(), function( totalammo, killer, killerWeapon, bodypart ) if isElementWithinColShape ( source, arena ) then local detection = isElementWithinColShape ( source, arena ) local detectionKiller = isElementWithinColShape ( killer, arena ) if detection then if close == 1 then local dx, dy, dz = unpack(randspawn[math.random(#randspawn)]) setTimer( setElementPosition, 4550, 1, source, dx, dy, dz ) setTimer ( setElementHealth, 1000, 6, source, 200 ) else setTimer( setElementPosition, 4550, 1, source, 577.92224121094, -2621.6677246094, 1378.0678710938 ) setTimer ( setElementRotation, 4550, 1, source, 0, 0, 180 ) end if detectionKiller then if getElementHealth ( killer ) < 200 and getElementHealth ( killer ) > 1 then setElementHealth ( killer, 200 ) elseif isPedDead ( killer ) then local dx, dy, dz = unpack(randspawn[math.random(#randspawn)]) setTimer( setElementPosition, 4550, 1, killer, dx, dy, dz ) end end end end end ) There is a bug where when someone kills each other their screen is stuck moving up ( which is part of gta when someone dies ) but I just want to prevent that. basically where you see this line elseif isPedDead ( killer ) notice how I didn't set the health there, because I think it has something to do when it sets the health when they are already dead. but rememeber it only happenes when someone kills each other at the same time. do i add elseif isPedDead ( source ) and isPedDead ( killer ) ?
-
function changeDirPod1 () moveObject ( pod1, 10000, 1952.0166015625, 1419.140625, 73, 0, 0, 0 ) setTimer ( function() moveObject ( pod1, 10000, 565.40, -2657, 1378.40, 0, 0, 0 ) end, 15000, 1 ) end how come I keep falling out of pod 1 when it gets to line 5, the pod just poofs, but I can ride it just fine in the second line.
-
#Pai_[N], it's not working =| what should I do?
-
That won't work because source is the marker
-
the content in the outputchatbox
-
vatoMarker = createMarker ( 393.60001, -2059.69995, 9.736, "cylinder", 1, 255, 255, 0, 18 ) addEventHandler ( "onMarkerHit", vatoMarker, function ( hitElement ) outputChatBox ( "testest.", hitElement, 255, 215, 0, true ) end ) why isn't this working? no errors just out puts nothing!
-
ok works thanks, but the problem I was orginally having is let's say a players clantag is RN6 the if someone has the name RN or something, they will be able to pass, I need it to have the whole thing RN6 not just RN or N6
-
Hi. How are you? if not string.find(getPlayerName ( getLocalPlayer() ), "[ClanTag]", 1 ) Curious on how to make it more narrow, with this line if someone has the name [Cl it will work. How can i make it so you literally have to have your name as [ClanTag]
-
Yes... I know........that is why i said i will put it in a variabelw and use istimer to check it if it created to prevent that lag
-
I can use isTimer to prevent that lag, but your code works thanks for the help =)
-
Would that be safe? because everytime a person walks in it will set a timer? Nevermind, I had to put the timer in a variable, everything is good now.
-
function triggerBlow( thePlayer, matchingDimension ) if thePlayer then if isElementWithinColShape ( thePlayer, dragarr ) then triggerClientEvent ( root ,"killIntruder", thePlayer ) end end end addEventHandler ( "onColShapeHit", root, triggerBlow ) setTimer ( triggerBlow, 1000, 0 ) Why doesn't this check every second? by the way the client event just creates a projectile, what I want to do is , while that person is in that colshape trigger the client event. As of now all it is doing is shooting one missile, but I need to fire as long as I am in there.
-
function update ( old, new ) if ( eventName == "onClientPlayerJoin" ) then guiGridListSetItemText ( playerLista, guiGridListAddRow ( playerLista), columnPlayers, getPlayerName ( source ), false, false ) elseif ( eventName == "onClientPlayerQuit" ) then for row = 0, guiGridListGetRowCount ( playerLista) do if ( guiGridListGetItemText ( playerLista, row, columnPlayers) == getPlayerName ( source ) ) then guiGridListRemoveRow ( playerLista, row ) break end end elseif ( eventName == "onClientPlayerChangeNick" ) then for row = 0, guiGridListGetRowCount ( playerLista) do if ( guiGridListGetItemText ( playerLista, row, columnPlayers) == old ) then guiGridListSetItemText ( playerLista, row, columnPlayers, new, false, false ) break end end end end addEventHandler ( "onClientPlayerJoin", root, update ) addEventHandler ( "onClientPlayerQuit", root, update ) addEventHandler ( "onClientPlayerChangeNick", root, update ) Try now I replaced all the variables with yours.
-
local accountname = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user." ..accountname, aclGetGroup("Admin")) or isObjectInACLGroup("user." ..accountname, aclGetGroup("SuperModerator")) then Do something..... This is just a snippet from a thing i am working on. I am wondering why the DO SOMETHING doesn't get triggered for the supermoderator when an admin get's to that function first. This code happenes whenever a person presses 7, so let's say I am admin and mike is a supermod, if i press 7 first then he does, it will not work for any supermod only admins. I also tried elseif but it does the same thing. The only way i did it was makeing to if statements for the 2 things. But i feel that is unprofessional how can i do it more efficiently.
-
Same function? what do you mean? that doesn't answer my questions if it is okay to have 2