Jump to content

Lordy

Members
  • Posts

    290
  • Joined

  • Last visited

Everything posted by Lordy

  1. IIRC server only outputs errors. Debugscript outputs also warnings and info. While info messages can be omitted, warnings also mean that some part of your code is not working.
  2. Account system has nothing to do with nicks. If a client has logged in, then it's client account will be returned. Storing things based on nicks is generally a bad idea anyway
  3. The dangling source. It's evil. Don't use it other than in events. It's EVILLLL!!! Also you do local currentPedId = -1 currentPedId = currentPedId + 1 So currentPedID will be 0. I don't think that there is pedId[0], the first one "pedId = { 105...." is pedId[1]
  4. It's not sql related. A hint this time would sound like this: You can only join(concatenate) strings and you can only store strings in SQL. Moreover, getPlayerFromNick returns a player element. Since this is not the first time this mistake for you (string - element confuzzlement) you should read wiki about the entity/element system and lua wiki about userdata. ALWAYS if you have an error, try to debug it yourself. If you just keep coming back here with obvious mistakes, you will start getting less and less help. Also you can join #mta.scripting at gtanet irc if you have already tried to solve a bug but failed numerous times. /me thinks of writing a debugging tutorial (better than the wiki one, since noone follows that one anyway, just come here) Ah also, please take a look at debugging tutorial at wiki.
  5. I wonder if manchion actually means mansion
  6. Where did you extract the editor resource? EDIT: Actually, look around before hitting the New Topic button please https://forum.multitheftauto.com/viewtop ... 90&t=24361
  7. Way better to read it now. if ( getElementHealth(healingPlayer) > 99 ) then Now,this line tells that if the player health is over 99, then continue with the things until else or end. So if he has less than 99 then it will trigger the else part. I believe you want it this way: if getElementHealth(healingPlayer) < 100 then EDIT: Also, getPlayerOccupiedVehicle (for nightlys getPedOccupiedVehicle) returns an element not a string, so getPlayerOccupiedVehicle(thePlayer) == "Ambulance" always returns false
  8. Oh god, please crap on that guy. Please read the thread, he already has had help and he got it working. And your suggestion would not have fixed it.
  9. I already told you, please indent your code. Makes it much more readable, especially if you are into lot's of ifs
  10. Ofcourse bad argument there. Source is a nil value there. It is only defined for events, but you are using a command handler. And I can't understand anyway, why you put source there. It has to be a vehicle eleemnt. Go read wiki about getVehicleOccupant
  11. Well since they can change their nick at their settings window too, it wouldn't be too wise I think. You can deny them from chatting and doing other things, but from changing nick - I'd say quite useless
  12. I'l' take a look at this, but just a hint, indenting helps a lot EDIT: I found something at the line you yourself weren't sure about. Wiki tells, that getPlayerTeam returns: "Returns a team element representing the team the player is on, false if the player is not part of a team. " But you are comparing team element to a string, no wonder that it always returns false. So you'd have to either use "if ( getTeamName(medicTeam) == "Medic" ) then" or "if medicTeam == getTeamFromName("Medic")" I didn't look at the rest of the code. One useful thing in wiki is the debugging tutorial - it shows how to debug with outputChatBox even if debugscript doesn't show anything EDIT2: Pfft slothman was faster than my edit
  13. Why do you define another table, if arg is defined too (arg == {...} )
  14. What is a nil value? Do you have client or server side? (just making sure)
  15. bool addEventHandler ( string eventName, element attachedTo, function handlerFunction, [bool getPropagated = true] ) There is. And I already told you that vivalavido didn't give you a correct example. You also might want to read this article: http://development.mtasa.com/index.php?title=Event
  16. Hmm you didn't get the hint then Here is another one: READ WIKI FFS! "onMarkerHit" is CLEARLY marked as serverside event, but you are using client side syntax for createMarker (READ WIKI TO SEE THAT). So you are either having a clientside marker with serverside event or serverside event called on a nil value, since for serverside, your createMarker syntax is wrong. And it all could be achieved by just LOOKING AT WIKI.
  17. Oh you are correct, I didn't think of that before, but you INDEED have managed to make a mistake in only those two lines. Now since you didn't give me any relevant information I can't help more than saying that you got a problem with client/server side syntax. Since you didn't tell me if it's server or client side, can't help you anymore. (Actually I could, but to make you debug your code yourself, I'll give you just a hint.) HINT: onMarkerHit works just as it's supposed to. Triggers a serverside event for serverside markers. EDIT: @vivalavido Actually he CAN attach the event handler to root element, so I didn't whine about that
  18. You know that we'd need to see openbox function and all other relevant things too. And a bit information what doesn't work etc.
  19. incorrect. You'd have to use table.concat({...}, " ") or table.concat(arg, " ")
  20. Nothing stops you from getting the bone position and attach it there (with clientside onclientrender setelementposition even)
  21. As you already noticed, it happens with hay. Conclusion: Hay is uses much cpu and there is nothing we can do about it/help you. It just DOES use so much cpu and that's it. If you don't like that, don't use hay.
  22. I can. You can always just attach some little gui stars to people. Much like nametags are attached atm. You could even make the design of stars similar to the nametag, so they look as one. And you can remove the stars at HUD, place them elsewhere, millions of possibilities. EDIT: Just a mockup. Btw, quite easily scriptable
  23. You can use just trig to calculate x-y positions and then just set z, can't you? OB would be the distance and the corner would be the degrees you want. If you attach to player, I think they are relative values so the player faces upwards in y direction. (Like being in 0,0,0, rotation 0). And there you have a nice triangle. [attachment=0]trig.png[/attachment] x_offs = math.sin(math.rad(corner)) * OB y_offs = math.cos(math.rad(corner)) * OB z_offs = somerandomnumber attachElement(theElement, theAttachToElement, x_offs, y_offs, z_offs, x_rot_offs, y_rot_offs, z_rot_offs) That isn't so hard Note however that math.sin and math.cos operate in radians iirc so you have to convert them before using (with math.rad)
×
×
  • Create New...