EngMohamedLish
Members-
Posts
44 -
Joined
-
Last visited
Everything posted by EngMohamedLish
-
as i told you read the wiki page sourceElement: The element that is the source of the event. I said, i read it through the wiki, but i didn't get what it means, I need more good explanation, could you explain it more, if possible?
-
You can find every thing on the wiki page about triggerClientEvent. triggerClientEvent (sendTo, theNameOfTheEvent,sourceElement, arg...) sendTo: The event will be sent to all players that are children of the specified element. By default this is the root element, and hence the event is sent to all players. If you specify a single player it will just be sent to that player. This argument can also be a table of player elements. COOL, what about the sourceElement? what is that? I didn't get it, when i read it.
-
Before using it, could you explain me it ? What difference happened?
-
SERVER addEventHandler ("onPlayerWasted", root, function() triggerClientEvent ("showButton", source) end CLIENT addEvent("showButton", true) addEventHandler ("showButton", root, function() guiSetVisible (spawn, true) showCursor (true) end
-
I made it myself ! And works fine, thanks for your guide, anyways, about the script, will the gui appear to all players, when someone dies ? It happened before it be solved, will it happen again? and if no, why? and how to specify a gui to open for players whose the event happened to them.
-
Alright, it works , But i didn't try it with another play, to see if it will appear to everyone, when someone dies, do you know if it'll appear or not? And another thing, is it possible to make the camera look at the player, from the top side, the up side? like "setCameraTarget, but camera target just look to player from the back, i need it to look from up side, is it possible?
-
Actually, It made no sense, still the same problem, but now the button doesn't even disappear... It was working correctly about the part of "if not" anyways, do you have a solution? And you know? When anyone die, the gui be shown to everyone... How to fix that, as well?
-
Actually, It made no sense, still the same problem, but now the button doesn't even disappear... It was working correctly about the part of "if not" anyways, do you have a solution?
-
When i click on the button, the player don't spawn, here. Could you help? No bugs found, on debugscript 3 Client: Server:
-
Alright, thanks. And actually, i see something that's not going to be easy, to be made. I tried to save the player position, and when he joins he spawns there. but doesn't work: no errors as well addEventHandler ("onPlayerQuit", root, function () if isGuestAccount(source) then return end x, y, z = getElementPosition(source) acc = getPlayerAccount(source) setAccountData (acc, "x.s", x) setAccountData (acc, "y.s", y) setAccountData (acc, "z.s", z) end) addEventHandler ("onPlayerLogin", root, function(_, account) ax = getAccountData (account, "x.s") ay = getAccountData (account, "x.s") az = getAccountData (account, "x.s") spawnPlayer(source, ax, ay, az) end) Actually, solved it Thanks for your help, anyways !
-
Alright, thanks. And actually, i see something that's not going to be easy, to be made. I tried to save the player position, and when he joins he spawns there. but doesn't work: no errors as well addEventHandler ("onPlayerQuit", root, function () if isGuestAccount(source) then return end x, y, z = getElementPosition(source) acc = getPlayerAccount(source) setAccountData (acc, "x.s", x) setAccountData (acc, "y.s", y) setAccountData (acc, "z.s", z) end) addEventHandler ("onPlayerLogin", root, function(_, account) ax = getAccountData (account, "x.s") ay = getAccountData (account, "x.s") az = getAccountData (account, "x.s") spawnPlayer(source, ax, ay, az) end)
-
OHH! so we pass "thePreviousAccount" by "_," Right?! I basically explained everything that Walid didn't. Anyway, Yes, we are using '_' because we do not need to pass thePreviousAccount. However, that is only for this case. Don't just think that parameter is not needed at all, because it can be useful from time to time. Only underscore if you do not require a parameter that is before one you want to use. You can also rename the parameters, as they only rely on chronological order. For example, I could call thePreviousAccount 'TPA' if I wanted to. It would work the same way. But, the next one would be theCurrentAccount, I can call it whatever I want. Thank you very much, I understood everything. Whatever, I just made an example myself, but i didn't get any bug through /debugscript 3, whatever, It doesn't work. Could you check it, and tell me what's the problem with it?
-
OHH! so we pass "thePreviousAccount" by "_," Right?!
-
Alright, Understood, but why do you place _, while don't you do function (theCurrentAccount) instead of (_, theCurrentAccount) Also, I do not understand what: thePreviousAccount: The account the player was logged into before thePreviousAccount mention to what? ... an account that played logged Into before? I didn't get it? could you tell me more ?
-
Alright, I totally understand the script, although I don't understand this part, right here: function (_, theCurrentAccount) Could you explain it to me? about (_, theCurrentAccount) ? is theCurrentAccount is a function? Or just a name can be changed? and what is the next argument in that function (_, 'here')
-
Alright, I tried to make an example myself, but it doesn't work, could you check it?
-
Hello guys, I would like to know how to save things i have in my server, like... Every script i make, its affects be saved when a player logout or quit. Like: Save player skin when he logout or quit, so when he come back, he find his skin didn't disappear Money as well, weapons, stats and everything? Also, I need to know the best way, and the easiest.
-
omg What stupid Am i !! LOL, i forgot to fade camera and set its target , Thank you man
-
I have a problem here, i made this script to spawn players when they join to the specified "x, y, z" and set 500 cash for NEW players, only. But, it doesn't work, and no error in debugscript 3, Can someone help, guys?
