Wumbaloo Posted July 22, 2015 Share Posted July 22, 2015 Hey, I tried to confirm a command like 2 functions, but it don't work, can you help me? I want to confirm the animation, and if it's confirmed, then do the Kissing animation. I don't do the function to get the nearbiest of the target player. function confirmKiss(sourcePlayer, targetPlayerName, command, confirm) targetPlayer = getPlayerName(targetPlayerName) if confirm == "/confirm" then setPedAnimation(sourcePlayer, "KISSING", "Grlfrd_Kiss_02") setPedAnimation(targetPlayer, "KISSING", "Playa_Kiss_02") else outputChatBox("Un de vous deux n'a pas confirmé!", targetPlayer, 255, 0, 0) outputChatBox("Un de vous deux n'a pas confirmé!", sourcePlayer, 255, 0, 0) end end addCommandHandler("confirmK", confirmKiss) function kissPlayer(sourcePlayer, command, targetPlayerName) targetPlayer = getPlayerName(targetPlayerName) outputChatBox(getPlayerName(targetPlayer) .. " veut vous embrasser, tapez /confirmK pour accepter.", sourcePlayer) confirmKiss() end addCommandHandler("kiss", kissPlayer) Link to comment
Wumbaloo Posted July 23, 2015 Author Share Posted July 23, 2015 It's a server sided client, I forgot to say it Link to comment
LabiVila Posted July 23, 2015 Share Posted July 23, 2015 Can you explain a bit better? So how do you want it to work? Because that code isn't so easy to understand. If you write /kiss targetPlayer then targetPlayer has to /confirmK right? And if he does /confirmK then animations happen? Link to comment
Dealman Posted July 23, 2015 Share Posted July 23, 2015 What is this line if confirm == "/confirm" then Supposed to do? As far as I can tell confirm would return nil(always check your debug! It should be the first thing you start before you start scripting). For that statement to pass, you would need to write the command like this; /confirmK PlayerNameHere /confirm And that doesn't make a whole lot of sense, does it? Link to comment
Wumbaloo Posted July 23, 2015 Author Share Posted July 23, 2015 It's supposed to work like that: Player 1 want to kiss or to handshake Player 2, he write: "/kiss Player2" Player 2 get a message: "You received a proposition to kiss him: " .. Player1 .. "Write: /confirm to do it" Player 2 write /confirm and then, if the Players are near, do the animation, if not, cancel like he don't want to /confirm The line is to confirm Link to comment
Wumbaloo Posted July 23, 2015 Author Share Posted July 23, 2015 UP? Sorry for my english, i'm French. Link to comment
LabiVila Posted July 23, 2015 Share Posted July 23, 2015 function asking (source, cmd, target) local target = getPlayerFromName (target) outputChatBox ("* "..getPlayerName (source).." has asked you for a kiss, /confirm or /ignore it.", target, 255, 255, 255) addCommandHandler ("confirm", function (player) if (player == target) then outputChatBox ("* "..getPlayerName (target).." has accepted your kissing offer.", source, 255, 255, 255) --do animations here end end ) end addCommandHandler ("kiss", asking) just replace animations and fix any possible bug Link to comment
LaCosTa Posted July 23, 2015 Share Posted July 23, 2015 Make sure you use getDistanceBetweenPoints3D so you can know if the other player is next to him . Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now