Jump to content

Wumbaloo

Members
  • Posts

    292
  • Joined

  • Last visited

Everything posted by Wumbaloo

  1. 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
  2. It's a server sided client, I forgot to say it
  3. 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)
  4. Thanks, it's the html color code ? (http://html-color-codes.info/)
  5. I know, but if I want to put "HP" in red and the other in green, how can I do?
  6. Thanks! It work! And another question, can I set different color in one outputChatBox?
  7. Hi! I have a mystery error in the console, here's the error: "script.lua:5: attempt to concatenate local 'sourcePlayer' (a userdata value) but no error in my code I think.. function setHP(sourcePlayer, command, targetPlayerName, value) targetPlayer = getPlayerFromName (targetPlayerName) setElementHealth (targetPlayer, value) outputChatBox("Vous avez mis " .. value .. " HP à " .. targetPlayerName, sourcePlayer) outputChatBox("L'Admin: " .. sourcePlayer " vous à mis votre HP à " .. value .. ".", targetPlayer) end addCommandHandler("setHP", setHP) addCommandHandler("sethp", setHP) Can you help me? Thanks!
  8. Thanks, I have a question: How can I turn on/off a command? Like "/airbrake" to activate and /airbrake to desactivate, I think I can do this with a boolean value (true/false) but I don't know how exactly.
  9. Hi! I have a problem, this code won't work function respawnDeadPlayer() setPedAnimation(source, CRACK, crckdeth1, 9000, true) outputChatBox("Vous êtes mort, vous allez respawn..") fadeCamera(source, false, 7) setTimer(respawnPlayerAfterDied, 10000, 1) end addEventHandler("onPlayerWasted", getRootElement(), respawnDeadPlayer) function respawnPlayerAfterDied() local p = source spawnPlayer(p, 1173.197265625, -1323.5419921875, 15.395062446594) fadeCamera(p, true, 5) outputChatBox("Vous avez respawn, bon jeu!") end It's a server side script, the console return me: "script.lua:11: Bad argument spawnplayer [expected player at argument 1, got nill]" same for 12. I tried with "player", "source" but it don't work The function respawnDeadPlayer work except the line 2, it doesn't return error in the console. I have a question: How can I turn on/off a command? Like "/airbrake" to activate and /airbrake to desactivate, I think I can do this with a boolean value (true/false) but I don't know how exactly. Sorry for my bad english, i hope you understand that and you can help me
  10. Here's the full code function mainFunction() cameraSwitch() end function setCameraOnPlayerJoin() local x = 1544.0400390625 local y = -1649.0029296875 local z = 28.402114868164 spawnPlayer(source, x, y , z) setCameraTarget(source, source) setCameraMatrix(source, 1476.697265625, -1637.4736328125, 40.525096893311 , 1544.0400390625, -1649.0029296875, 28.402114868164, 0, 50) fadeCamera(source, true, 5) outputChatBox("Bienvenue sur le serveur de test!", source) mainFunction() end addEventHandler("onPlayerJoin", getRootElement(), setCameraOnPlayerJoin) function createVehicleForPlayer(thePlayer, commandName, vehicleModel) local x,y,z = getElementPosition(thePlayer) x = x + 5 local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z) if (createdVehicle == false) then outputChatBox("Erreur lors de la création du véhicule") end end addCommandHandler("veh", createVehicleForPlayer) function cameraSwitch(player) setTimer ( function(player) local x, y, z = getElementPosition(player) outputChatBox("Message à délais de 5 secondes.") outputChatBox("Un changement de caméra doit vous permettre de pouvoir jouer convenablement") setCameraMatrix(player, x, y, z) setCameraTarget(player) end, 5000, 1, player ) end
  11. It's a server sided script It's the same warnings guys
  12. Hi! I'm french, learning lua and try to script in lua. I'm stuck for almost 5 hours on this problem: I make a script to setCamera on the center of L.S but when I want to change the camera to the player, I have some errors, it's my code: function cameraSwitch(player) setTimer ( function(player) local x, y, z = getElementPosition( player ) outputChatBox("Message à délais de 5 secondes.") outputChatBox("Un changement de caméra doit vous permettre de pouvoir jouer convenablement") setCameraPosition(player, x, y, z) setCameraTarget(player) end, 5000, 1 ) end And the MTAServer.exe said that: I tried with "thePlayer" but it didn't work Can you help me ? Thanks, I will give all of the code if you want
×
×
  • Create New...