Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. posis is a table, you are using it like a element... posis = {{362.502, 150.813, 1025.78, 1, 3}, {353.758, 193.991, 1019.98, 1, 3}, {351.345, 164.059, 1019.98, 1, 3}} function setDimensions() for i,v in pairs(posis) do local marker = createMarker(v[1], v[2], v[3], "cylinder", 2, 255, 0, 0, 255) setElementDimension (marker , v[4] ) setElementInterior (marker , v[5]) end end addEventHandler( "onResourceStart", getResourceRootElement(getThisResource()), setDimensions ) Try that.
  2. Castillo

    Money Drop

    DON'T DOUBLE POST, EVEN WORST FOR SOMETHING LIKE THAT. What are you trying to achieve?
  3. Castillo

    Redirect

    Well, I have a better option, go and ask to the server owner to add it to the acl, why wouldn't he agree?
  4. Castillo

    Money Drop

    Strange, I tested it and worked fine o_O. P.S: There's a "onPickupUse" event for "moneyPickupHit".
  5. Are you willing to pay to the scripter for his/her services?
  6. Castillo

    No Markers?

    You forgot the attachedTo argument in the event handler, use this: addEventHandler( "onResourceStart", getResourceRootElement(getThisResource()), setDim )
  7. What I understand is that is triggering everything * player count? so ex: 5 players, triggers 5 times the same thing.
  8. Castillo

    No Markers?

    "addEventHandler( "onResourceStart", setDim )"? That's wrong, you forgot something there. I suggest you to go read about event handlers again.
  9. Could you post the script which get's bugged?
  10. Castillo

    Redirect

    I don't understand what do you mean... you are executing this script via runcode or...?
  11. Castillo

    Redirect

    What? it should work if the admin group has the right to use that function o_O.
  12. Castillo

    Redirect

    As I said in my first post (if I remember well), you must add the resource to the admin group in acl.xml.
  13. Haha, my bad, I'd read "addEvent" as "addEventHandler" .
  14. I'd put a function, else it wouldn't work. P.S: Is better to have one function to handle your event handlers than a lot of them (my opinion).
  15. Castillo

    Money Drop

    function createMoney(player) local x, y, z = getElementPosition(player); local x1, y1, x2, y2; x1 = (x-2)+(math.random()*4); y1 = (y-2)+(math.random()*4); x2 = (x-2)+(math.random()*4); y2 = (y-2)+(math.random()*4); local moneyAmmount = getPlayerMoney(player); moneyAmmount = math.floor(moneyAmmount/2); takePlayerMoney(player, moneyAmmount); moneyAmmount = math.floor(moneyAmmount/2); setElementData(createPickup(x1, y1, z, 3, 1212), "ammount", moneyAmmount); setElementData(createPickup(x2, y2, z, 3, 1212), "ammount", moneyAmmount); end function moneyPickupHit(player) local money = getElementData(source, "ammount"); if money then givePlayerMoney(player, money); destroyElement(source); end end function playerJustGotDied(ammo, attacker, weapon, bodypart) if (isElement(attacker)) then createMoney(source) end end addEventHandler("onPickupUse", getRootElement(), moneyPickupHit); addEventHandler("onPlayerWasted", getRootElement(), playerJustGotDied); I didn't fully made this script, it was in the forums and I just searched for it for you and fixed some bugs.
  16. Castillo

    Roleplay

    Why don't you make it? is better to make something by ourselfs than using someone's work.
  17. Well, I would say he's insulting in russian.
  18. Castillo

    Problems

    Mind posting your whole script...?
  19. Castillo

    Problems

    That event is to REMOVE an event, not to add it.
  20. I don't know what is miser, but well, as you may know, we're busy here. P.S: We don't like to help someone who doesn't want to learn.
  21. Castillo

    Shadow

    Well, I ever created another text with alpha 155, and with color 0, 0, 0 (black), and changed the position X to +3 and Y to +2 (that's how I'd it).
  22. For all this, you need scripting knowledge, you must learn or pay to someone to do it for you.
  23. Jasd1, I don't understand what are you trying to say..... he has everything in order, and "local clicked ={"left","right"ETC.}" would be a table, not a variable. Dark, try adding debug outputs to your script, that'll help you to find out where's the error.
  24. I would do something like this: Team_Selection_1 = {} function onPlayerResourceStart( ) Team_Selection_1[1] = guiCreateButton(326,534,196,88,"Attack",false) guiSetFont(Team_Selection_1[1],"sa-header") Team_Selection_1[2] = guiCreateButton(199,90,5,5,"",false,Team_Selection_1[1]) Team_Selection_1[3] = guiCreateButton(562,534,196,88,"Defence",false) guiSetFont(Team_Selection_1[3],"sa-header") Team_Selection_1[4] = guiCreateButton(199,90,5,5,"",false,Team_Selection_1[3]) guiSetVisible( Team_Selection_1, true ) showCursor(true) end addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource( ) ), onPlayerResourceStart ) function onPlayerClickGUI(button) if (button == "left") then if (source == Team_Selection_1[1]) then ouputChatBox( "You clicked Attack" ) elseif (source == Team_Selection_1[3]) then ouputChatBox( "You clicked Defence" ) end end end addEventHandler ( "onClientGUIClick", root, onPlayerClickGUI )
  25. Castillo

    Problems

    Many ppl got this error, maybe is a bug, not sure, use this: setTimer(function () removeEventHandler("onClientRender",root,Function) end , 13000, 0) Try with that.
×
×
  • Create New...