Jump to content

EngMohamedLish

Members
  • Posts

    44
  • Joined

  • Last visited

Everything posted by EngMohamedLish

  1. Actually, fixed it, Thanks for your time, tapl
  2. Here's the function. It is in the same script, which is ID_system, I think it may help?
  3. You are totally Right ! Thanks for your help, man. But, here's something: target = exports.ID_System:getPlayerFromPartialName(user2) This part, doesn't work, as when i write a player name, it returns to the same 'else' which i showed, before. But, when i write a player ID, it works fine.
  4. You are totally Right ! Thanks for your help, man.
  5. Still nothing.. I believe, it won't do change, as 'source' is the handler of the command, and local will work, as the script's still in the same function, yup? Anyways, help please ! addCommandHandler ("revive", function(user, cmd, user2) if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( user ) ), aclGetGroup ( "Admin" ) ) then if cmd and user2 then local ID = tonumber(user2) if ID then local target = exports.ID_System:getPlayerFromID(ID) else local target = exports.ID_System:getPlayerFromPartialName(user2) end if target then if isPedDead(target) then local x, y, z = getElementPosition (target) spawnPlayer(target, x, y, z) else outputChatBox("This player is still alive", user) end else outputChatBox ("There's no online player with this name.", user) end else outputChatBox ("[syntax] /revive [iD/Partial Name]", user) end end end)
  6. Here, In this script i have something wrong, i don't understand. This script is for reviving players, after their death, when i try to /revive [player name or even id] It returns to that "else" else outputChatBox ("There's no online player with this name.", source) However, the player's available..... What's wrong here? server:
  7. I'll try it, but could you explain me this for index, res in ipairs(getResources()) do Just gimme a link leads me to wiki, to read about "for...do", if possible.
  8. I know them both already..... As i said, i need to check for starting resources in general, not a speciefied resource... Do you understand? Lemme make an example if a resource is starting then Not a specefied resource... because , i need to do an action, when every resource starts....
  9. I need to know, how to check if there are starting resources, If you didn't get it. I mean something like, checks if a resource is starting, i can do an event. I don't mean a specefied resource, I talk about, if "any" resource is starting.
  10. Aha Made it man! Thanks a lot for this way ! Appreciate it.
  11. isPedDead() But, how will it check if the player was dead, after he quit and join again? I mean, If a player dies, and quit, then joins again. How can i check if he was dead, before he quit? this "isPedDead' won't be enough? anything? Anyone help, please?
  12. I am totally confused... tried it, doesn't work. I am confused....
  13. isPedDead() But, how will it check if the player was dead, after he quit and join again? I mean, If a player dies, and quit, then joins again. How can i check if he was dead, before he quit? this "isPedDead' won't be enough?
  14. Tried it, this time no error, but still no sound: addEventHandler("onClientMouseEnter", guiRoot, function(aX, aY) if source == spawn then local sound = playSound("sounds/Enter.mp3") if sound then setSoundVolume(sound, 1.0) end end end) Anything?
  15. I would like to check if the player was dead, before he quit from the server. What functions used for that?
  16. Tried it, this time no error, but still no sound: addEventHandler("onClientMouseEnter", guiRoot, function(aX, aY) if source == spawn then local sound = playSound("sounds/Enter.mp3") if sound then setSoundVolume(sound, 1.0) end end end)
  17. Nice, it needed to change player2 with target, Thanks solved Appreciate it.
  18. Problem isn't about a timer, it is about a bug: Bad argument @ 'setCameraTarget' [Expected element at argument , got string 'super' That's what i get, when i use the command.
  19. Bad 'sound/player' pointer @ 'setSoundVolume'(1)
  20. Yup, it works, but there's still a bug, I have setCameraMatrix already made, how can i stop it, when player be revived? I tried " setCameraTarget(player2, player2) but doesn't work.
  21. addEventHandler ("onClientMouseEnter", root, function(aX, aY) if spawn then -- checks if the mouse is on the button called *spawn* sound = playSound("sounds/Enter.mp3") setSoundVolume(sound, 1.0) end end) I tried putting sound, when player approach their mouth on the button, but it didn't work, no bugs, sound added in meta.xml, as well.
  22. Here in this script, there's a problem i don't understand: addCommandHandler ("revive", function(player, cmd, player2) target = getPlayerFromName(player2) if target then if isElementDead(target) then local x, y, z = getElementPosition(target) spawnPlayer(target, x, y, z) outputChatBox ("You've Revived"..target, player, 0, 255, 0, false) outputChatBox (getPlayerFromName(player).."revived you", target, 0, 255, 0, false) else outputChatBox("syntax: /revive player name", player) end end end) I made this script to revive dead people i get this error: Bad Argument @ 'getPlayerFromName [Expected string at argument 1, got nil] How it's nil? I don't understand, how can i make it so...
  23. Thanks ! And, what a smart function you use !
  24. Aha, Thank you man It is looking more professional idea, than the one i made ! I just don't understand something here, It is my first time to see "toJSON" and fromJSON" what is that, actually? Could you explain it, for me ? THANKS ! ! !
×
×
  • Create New...