Jump to content

Citizen

Moderators
  • Posts

    1,803
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by Citizen

  1. Man it's a fucking joke right ?? I just fixed that problem in your previous post where you were asking how to get the player who killed the guy who used /hitme Using element data is good enough and as you can see faster than using a table ... I gave you the fixed code but you didn't took it just because I didn't reply to your initial question :facepalm: From Help !! What do you have to say about that ? (Wasting time of members by asking to fix a problem someone already did in one of your hundreds topics).
  2. Citizen

    Help !! :)

    Ok fine. I'm okay. So for your initial question, solstice gave you the answer: function ondie ( totalAmmo, theKiller ) theKiller will just be the player who killed another one. So if the dead player had a blip in his element data "hitBlip" then it means he did the /hitme command and was waiting for himself to die. I also just realised that you need another element data to know the moneyAmount the player wrote using /hitme to then get it in the ondie function and give him to the killer.
  3. Ofc lol, im making an entire gamemode, and suddenly login stops working, its like i would obiously have done that -.- So much hate coming from some members these days This guy just tried to help you out with little informations you gave us. That kind of reply is totally disrespectful. "No, I already checked my meta, everything is fine." This is the kind of reply you (guys asking for help) have to post. Wishing you luck to find out the solution. Regards, Citizen
  4. Citizen

    Help !! :)

    Just don't forget you are here because you need help and to learn from others. I fixed this nasty code and add a lot of comments (how to cancel a function, how to use elseif properly, how to use an element data instead of a global variable on the server side and other good practices like verifying what you get before performing an action on it). But the only reaction you get is: "Learn to read you idiot !" (yeah it sounds pretty much the same). If you don't want to listen about other advices, then alright ! do whatever you want, but you will stay a long time on this forum asking for help again and again because your script doesn't work when you get more that 1 player (Because that was exactly one of the problem of your script, if two players would use /hitme ammountHere at the same time, then code won't work for the first one who would use it). I'll say it one more time: You are here because you need help and advices from others, not to yell on the first one who won't give you what exactly you wanted to get. Hope you will understand my point of view and also that you won't go far in this community if you are acting like you just did with me. Best regards, Citizen
  5. Citizen

    Help !! :)

    Fixed your nasty code. You're welcome.
  6. Haha yeah, I tried like the img tag, it didn't work in the preview, but I was hoping for it to work when I'll submit but it didn't
  7. He wants to do this: Yeah, I would first try with shaders (but I'm a perfect noobs with shaders) because I think it's possible. Otherwise I would use an invisible ped to do it. He will just press the forward button and freeze the car element. But if you use a ped, then the car owner will probably do the carjack animation (even if you destroy the ped in the event onPlayerVehicleEnter, idk give it a try) Also, if another crazy driver hit the car (which is frozen) the car won't go anywhere, so it's not really realistic.
  8. Citizen

    Help !! :)

    Hi, check all my comments ! function hitme ( thePlayer, commandName, moneyAmount ) if not moneyAmount or not tonumber(moneyAmmount) then --if he just wrote /hitme or if moneyAmount isn't a number. outputChatBox( "SYNTAX: /hitme ", thePlayer, 255, 0, 0 ) -- Show him how the cmd syntax return --This is how you stop the execution of a function, and not cancelEvent() as u did ... end moneyAmount = tonumber( moneyAmount ) -- transform the text (i.e: "50000") into a number (i.e: 50000). It's not becoming a global here ! local playermoney = getPlayerMoney ( thePlayer ) if playermoney < tonumber(moneyAmount) then outputChatBox ( "You don't have enough money to make hit", thePlayer, 255, 0, 0 ) else if moneyAmount >= 500000 then --I added a = otherwise the max would be $499.999 outputChatBox ( "Maximum hit amount is $500000", thePlayer, 255, 0, 0 ) elseif moneyAmount <= 50000 then --I added a = otherwise the min would be $50.001 outputChatBox ( "Minimum hit amount is $50000", thePlayer, 255, 0, 0 ) elseif getElementData ( thePlayer, "hitBlip" ) then --if the player has a value in the element data "hitBlip", then he already used /hitme and didn't die yet outputChatBox ( "You are already a hit", thePlayer, 255, 0, 0 ) else local playername = getPlayerName ( thePlayer ) local hitBlip = createBlipAttachedTo ( thePlayer, 26 ) --never do such global on serverside !! use a setElementData on the player instead ! setElementData ( thePlayer, "hitBlip", hitBlip ) --here is the setElementData to store the player's blip setPlayerNametagColor ( thePlayer, 0, 0, 0 ) takePlayerMoney ( thePlayer, moneyAmount ) outputChatBox ( "You have placed a $" .. moneyAmount .. " hit on yourself", thePlayer, 255, 235, 0 ) outputChatBox ( "A hit has been placed on " .. playername .. " For $" .. moneyAmount .. ".", root, 255, 235, 0 ) end end end addCommandHandler ("hitme", hitme) function ondie () local hitBlip = getElementData ( source, "hitBlip" ) -- here is the setElementData to get the player's blip we stored if hitBlip and isElement( hitBlip ) then -- make sure the player who died did the /hitme cmd removeElementData( source, 'hitBlip' ) -- to make sure he can do /hitme again (I know you already done it) destroyElement ( hitBlip ) end end addEventHandler ( "onPlayerWasted", getRootElement(), ondie )
  9. Also, the variable "player" isn't defined. It is on my screen By the way he is using localPlayer and then uses a new temp variable to store getLocalPlayer() and uses that new variable (player) instead of localPlayer. Also some one asked you about errors but you didn't reply ... So please do. 3 possible reasons: 1 - The event isn't created (use addEvent like Controlled said). 2 - There is an error somewhere in this file so it is not loaded. 3 - The event onPlayerLevelUP is never triggered.
  10. Bah merci du compliment, ça fait plaisir. En effet je fais de mon mieux pour expliquer avec des mots simples tout en essayant de vous faire imaginer un schéma (quand c'est nécessaire). On voit bien que tu es motivé, donc je ne me fais aucun souci pour toi. Néanmoins, pour le setAccountData, je ne suis vraiment pas sur le fait que les données soit stockées dans le fichier internal.db. Vu que t'as l'air d'avoir bien compris les set/get ElementData, il faut se dire que les set/get AccountData c'est exactement pareil mais que ça doit obligatoirement s’exécuter sur un compte et que en plus, ça ne se détruit pas lorsque le joueur quitte le serveur ou si le serveur redémarre. Mais évidemment ces fonctions demandent plus de ressource (CPU) que les set/get ElementData. Laisse nous savoir si tu as un problème avec ta sauvegarde de position ou si tu as réussi
  11. Citizen

    Radar Blips

    Well, your whole code isn't needed but I would like to see how you are calculating the x and y for the dxDrawImageSection Also, what is the size of the radar map image ? 3000x3000 ? 6000x6000 ? Thanks
  12. The wiki tutorial wasn't good enough ?! https://wiki.multitheftauto.com/wiki/Sc ... ing_script
  13. Citizen

    Tables

    rootTable = { object1 = { }, object2 = { }, object3 = { } } -- go get the object1 table: local table1 = rootTable.object1
  14. You are right and wrong at the same time. You are right about using client instead of source but the reason for doing that isn't right. Source will always be the element you were waiting for, it won't randomly be another player element. But a not nice player can modify his client (the mta's source code) to fake/replace the source argument. So the hacker can says to the server: "Hey, I'm playing this guy (which can be an admin)" and if the server uses source then he will think that he received that event from that guy (the admin). So source can not be trusted instead of client (resolved by the server itself so it can be trusted).
  15. Just add an else to that if: if not isElement( carshow ) then carshow = createVehicle( carput,544.74103, -1298.83533, 32.54056 ) end To: if not isElement( carshow ) then carshow = createVehicle( carput, 544.74103, -1298.83533, 32.54056 ) else setElementModel( carshow, carput ) --change the model of the vehicle end
  16. What doest "auto-b" means ? what should it do and what are the errors using /debugscript 3 (need to be logged as admin) ? We just can't help you if you aren't giving us all the informations we could need.
  17. Citizen

    CJ clothes

    yeah sure, there is a lot of free ids you can use with mta engine function (I mean engineLoadDff / Txd / Col): http://gtaforums.com/topic/488464-free- ... anandreas/
  18. As I can see, for the camera problem, jesseunit will help you. But for the problem of the car, you have to do a tonumber on carget in the createVehicle function. It's weird that the addEventHandler is still added and working.
  19. Citizen

    Chatbox

    Oh ok, so you don't want to create a whole new chatbox, thought you wanted to do that. You actually just want to add some stuff/fucntion between the chatbox input field and the display in the chatbox.
  20. Citizen

    loop

    The Lua loops ? http://lua.gts-stolberg.de/en/schleifen.php Mainly used to repeat a task with different args that can be defined with the index (current loop number). Also used to iterate over a table.
  21. Citizen

    Chatbox

    put a function that will show a new edit field for example. and when the guy press enter, get the text of this edit, output the text in the chat and hide the edit. I'm guessing it's what you wanted to do ? If not, then explain us exactly what you really want to do Btw, you will have to rewrite the command feature. When you find a / as a first character, then send everyting in executeCommandHandler
  22. Citizen

    Chatbox

    We can ! But not with unBindKey actually. You need to use toggleControl and the control name for the chatbox is "chatbox": https://wiki.multitheftauto.com/wiki/Co ... d_commands So just toggle that control to false and the player won't be able to show the chat input field.
  23. There is no reason for the car to be out of the stream range because I guess he is using a marker to show up a gui. Doing it client side, make it easier since you can have multiple player using it at the same time. (ofc you can do it too in server-side but you will need to handle that possibility)
  24. No it won't, element datas are really powerfull. By the way, if you want to store the current play time of the player, I would use only one setElementData that will store the result of getTickCount(). Then when you want to know how many seconds the player is in: local tick = getTickCount() local joinTick = getElementData(thePlayer, "joinTick") or 0 local secondsIn = (tick - joinTick) / 1000 Do as you would like.
×
×
  • Create New...