Jump to content

Overkillz

Members
  • Posts

    545
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Overkillz

  1. Try this local respawnTime = 1000*60 addEventHandler("onPlayerWasted", getRootElement(), function() local theVehicle = getPedOccupiedVehicle(source) if theVehicle then removePedFromVehicle(source) setTimer(respawnPlayer,respawnTime,1,source,true) -- Here the player will respawn with a vehicle if he was in one return --Here we abort the function | The function that comes below won't be executed. end setTimer(respawnPlayer,respawnTime,1,source,false) -- Here the player will resapwn WITHOUT a vehicle end) function respawnPlayer(thePlayer,inVehicle) local x,y,z = 0,0,5 -- SET THE CORDINATES YOU WANT if inVehicle then spawnPlayer(thePlayer, x,y,z+5) -- We move the player a bit up to prevent collision with the vehicle local theVehicle = createVehicle(411,x,y,z) warpPedIntoVehicle(thePlayer,theVehicle) return --Here we abort the function | The function that comes below won't be executed. end spawnPlayer(thePlayer, x,y,z+3) --Here we don't move the player 5 points up (Just try) end Im not sure if this is what you want. As far as I understand, you want that: When a player dies, if he was in a vehicle then respawn it in a vehicle, otherwise not. Im using a similar system with it, however, to prevent the creation of a new vehicle im storing them into a table and when the player respawn (In the case that he was a vehicle, restore the vheicle by fixing it ...etc) Regards.
  2. Alright, thanks mate. The same way is applicable to triggerEvent ? triggerEvent("onDestroyCurrentMap",arenaSrv.players,arg)
  3. Sorry for bumping this topic again, but ... I have just been trying to use the table to trigger instead looping the table that containts the player. So, I have just face off with some issues like Previously I used to do the trigger like everyone (It works perfectly) for i,player in ipairs(arenaSrv.players) do triggerClientEvent(player,"onDestroyCurrentMap",player) end So I decided to test to use the table (It drops me the warning previously mentioned), triggerClientEvent(arenaSrv.players,"onDestroyCurrentMap",arenaSrv.players) but looks like there is a problem with the 3rd argument. I tried to read carefully the definition at the wiki but I can't get it at all. Might the right way to do it is the following one? triggerClientEvent("onDestroyCurrentMap",root,arenaSrv.players) However, Im worried that the event is triggered wrongly.. Thanks for reading.
  4. I got it, thanks so much. I wasn't aware that trigger allows to use tables as argument instead players. I will take care about using root. Looks like is not a good choice if im dealing with different rooms which practical need to send few datas. Thanks newly
  5. Probably you need to deal with -- Some variables / arrays in order to stream it for the rest of players setTimer() -- or getTickCount() To check while the player is driving getControlState() -- Try to search a better function for client-side In case you want to block, stop the vehicle or whatever setVehicleLocked() setElementFrozen() setControlState() -- To block the acceleration of any vehicle.
  6. Hello dear community, Im having a question about which one is the best way to do a trigger (From server to client) Well, my problem is that Im dealing with different rooms for players. Obyously for each room I have stored the players in different arrays depending of the room. When the player joins into a room I set them a data with the roomID So, imagine, I want to create a deathlist that draw the player who has just dead in the same room as me. Here goes my question, whats the best way to do it. #1 - Make a loop with the array that contents the list of players in the room and do the trigger to each one. (Something like this) for i,k in pairs(room) do trigger ... end #2 - Make a trigger to all the players using root and later in the clientside check if the room player data is the same as mine one. Im not sure when you make a trigger to root players it does a loop to all the players or it just uses an efficent method. Thanks for reading, I hope you can bring me a hand. Regards.
  7. You need to deal with arrays.
  8. Well, you need to deal with onPlayerChat() cancelEvent() Read carefully the arguments of onPlayerChat to disabled /me command. Regards.
  9. mmm... What about to deal with LOD functions ? setLowLODElement() Remember that there are more LOD functions. I have never worked with them but might they help you. Regards.
  10. Im not sure about it, but might you need to deal with setTrain.... functions. For example setTrainDirection() Just try to find inside the wiki "setTrain..." and it will brings you some options. Be aware that they are not disabled or were remplaced by a better option. Regards.
  11. Dont forget to use isCursorShowing() to prevent errors while rendering.
  12. I know, I've already tried with some videos which doesn't containt any music, however, convertmp3.io detects that the video containts some music. I recommend you to find another converter that bring you the content in JSON or direct link ...etc Regards.
  13. First of all, instead working at serverside, I recommend you to work at serverside with practically the same function. onClientPedDamage() setElementHealth() Respecting you main question, might the best option is to deal with dimensions to prevent a high amount of players in the same dimension. This also might brings you a better performance (Might not visible) About the code, I didn't test it. IT IS CLIENTSIDE -- FOR HEAD SHOT ARENA function cancelPedDamage (attacker,weapon,bodypart) cancelEvent() -- cancel any damage done to peds if source == local player then if ( bodypart == 9 and attacker and attacker ~= source ) then setElementHealth(source,0) end end end addEventHandler ( "onClientPedDamage", getRootElement(), cancelPedDamage ) -- FOR ONE SHOT ARENA function cancelPedDamage (attacker,weapon,bodypart) cancelEvent() -- cancel any damage done to peds if source == local player then setElementHealth(source,0) end end addEventHandler ( "onClientPedDamage", getRootElement(), cancelPedDamage ) Also, try to deal with player state with elementData. This is to prevent an already dead ped of being shot again.
  14. My youtube player script has stopped working too due to convertompe.io has changed their services. They don't convert videos containing music. Videos containing music can not be downloaded How did I solve this ? I tried to deal with a free api from GitHub, however, this has a limitation, like 50-100 songs per day unless you deal with a proxy to bypass that limit but might it becomes more complicated. Best regards.
  15. Might you are running another scripts that practically does something like this ?
  16. 16091976AntiStealScriptbyShimu01022009ReadingSecretCode Stop using my scripts without my permission. Was a mistake to upload an uncopiled' version with the ''security code some years ago. However, Im glad that I didnt know a lot of stuffs about scripting and I made a dirty code that for beginners might is confuse. Topic reported and regards.
  17. First of all, this is the wrong section to ask in Portuguese. About your question. I recommend you to deal with setElementData() getElementData() Why ? You will have to deal with vehicle streammed Might vehicle chainging model. Is a good way that avoid you to work with several triggers, tables ...etc Regards.
  18. Might you are dealing with the elements wrongly. Why is there a loop if there is not anyone in a team ? The loop just check if there is an alive player. Previously the variables local homeTeamPoint = false local enemyTeamPoint = false are set with false. If the loop detects an alive player "MIGHT (As I commented in the code)" the point is for the team.
  19. Be aware about addEventHandler("onResourceStart", getRootElement(), pointsauto) It is going to add a point everytime a script is started. While changing the map it starts some scripts and might gives you troubles. You can use onClientPlayerWasted or something like that.
  20. Well, Im dealing with your code and I need to say that is a bit dirty but I made few changes to let you know where you was wrong. Also, I need to say that onClientResourceStart isnt a good event to check the player alives in team. I decided to remove the function isPedDead since you are dealing with a race gamemode as far as I can see. Well, to finish this I don't recomend you to deal with homeName as team varaible and later use team[1] or team[2] function pointsauto() local homeTeamPoint = false local enemyTeamPoint = false -- LOOP FOR HOME TEAM local playersHomeTeam = getPlayersInTeam(homeName) --Assuming that homeName varaible is the team already created previously for id, player in pairs(playersHomeTeam) do if getElementData(player, "state") == "alive" then homeTeamPoint = true -- Here we say that there are alive players in home team and "MIGHT" the point foes for them break -- Here we stop the loop because there is already a player alive --setElementData(team[2], "points", 0) + 1 end end -- LOOP FOR ENEMY TEAM local playersEnemyTeam = getPlayersInTeam(enemyName) --Assuming that enemyName varaible is the team already created previously for id, player in pairs(playersEnemyTeam) do if getElementData(player, "state") == "alive" then enemyTeamPoint = true -- Here we say that there are alive players in home team and "MIGHT" the point foes for them break -- Here we stop the loop because there is already a player alive --setElementData(team[2], "points", 0) + 1 end end if homeTeamPoint ~= enemyTeamPoint then if homeTeamPoint then -- setElementData .... elseif enemyTeamPoint then -- setElementData .... end end end addEventHandler("onResourceStart", getRootElement(), pointsauto)
  21. Overkillz

    Animate

    local yourtick = getTickCount() local alpha = 0 function yourFunctionRendering() local progresstick = getTickCount() - yourtick local progress = progresstick/500 if progress >= 1 then progress = 1 end alpha = interpolateBetween(0,0,0,1,0,0,progress,"Linear") --NOW YOUR FUNCTION guiSetAlpha ( yourWindow, alpha ) end addEventHandler("onClientRender",root,yourFunctionRendering) Something like this. Remember that eachtime you need to update the animation you have to restart 'yourtick' And deal with the condition to fadeout. I've just give you an example of fadein without the condition. Regards.
  22. you can add a variable that check if is allowed to use the command. if theVariable then ... And that variable could be switched by a specific group like admin or whatever
  23. Overkillz

    help

    Could you just tell me why not ? I have never used this, but you can try. triggerEvent("trig", resourceRoot) addEvent("trig", true) function trig() ... removeEventHandler("trig", resourceRoot, trig) end addEventHandler("trig", resourceRoot, trig)
×
×
  • Create New...