Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. -- client side: function drawMessage ( ) local screenWidth, screenHeight = guiGetScreenSize ( ) dxDrawText ( "YOU ARE NOW FROZEN", screenWidth / 2, screenHeight / 2 ) end addEvent ( "setMessageVisible", true ) addEventHandler ( "setMessageVisible", root, function ( state ) removeEventHandler ( "onClientRender", getRootElement (), drawMessage ) if ( state ) then addEventHandler ( "onClientRender", getRootElement (), drawMessage ) end end ) -- server side: addEventHandler ( "onMarkerHit", createMarker ( 1791.537, 656.511, 17.626, 'cylinder', 2.0, 255, 0, 0, 150 ), function ( hitElement, matchingDimension ) if ( getElementType ( hitElement ) ~= "player" ) then return end local vehicle = getPedOccupiedVehicle ( hitElement ) if ( vehicle ) then setElementFrozen ( vehicle, true ) triggerClientEvent ( hitElement, "setMessageVisible", hitElement, true ) setTimer ( function ( thePlayer, vehicle ) triggerClientEvent ( thePlayer, "setMessageVisible", thePlayer, false ) setElementFrozen ( vehicle, false ) end ,5000, 1, hitElement, vehicle ) end end )
  2. Castillo

    Join Failed

    That's a server side event, you must trigger to client side with triggerClientEvent.
  3. I'm not sure, maybe try removing low lod when the element streams in?
  4. Castillo

    Join Failed

    Because there's no such event: "onClientPlayerLogin".
  5. He has no idea about what he's talking about, he's just trying to increase his post count.
  6. Copy it again, now it works ( tested ).
  7. Castillo

    Ayuda MySQL

    dbConnect dbQuery dbExec dbFree
  8. Castillo

    Ayuda MySQL

    Porque usas las funciones esas? usa las nuevas del MTA que son mas eficientes.
  9. You must have copied it wrong, it has to work.
  10. Where does it appear?
  11. function Spin_Func ( thePlayer, cmd, amount ) local winchance = math.random ( 1, 3 ) local spintimer = getElementData ( thePlayer, "spintimer" ) local money = getPlayerMoney ( thePlayer ) local amount = tonumber ( amount ) or 0 if ( amount < 1 ) then outputChatBox ( "Invalid amount.", thePlayer, 255, 0, 0 ) return end if ( spintimer == false ) then if ( money >= amount ) then if ( winchance == 1 or winnchance == 3 ) then outputChatBox ( "#ffffff"..getPlayerName ( thePlayer ) .." spinned for ".. amount .." and lost.", root, 0, 0, 0, true ) takePlayerMoney ( thePlayer, amount ) setElementData ( thePlayer, "spintimer", true ) setTimer ( function ( ) setElementData ( thePlayer, "spintimer", false ) end ,30000, 1 ) elseif ( winchance == 2 ) then outputChatBox ( "#ffffff".. getPlayerName ( thePlayer ) .." spinned for ".. amount .."$ and won ".. ( amount * 2 ) .."$.", root, 0, 0, 0, true ) givePlayerMoney ( thePlayer, amount ) setElementData ( thePlayer, "spintimer", true ) setTimer ( function ( ) setElementData ( thePlayer, "spintimer", false ) end ,30000, 1 ) end else outputChatBox ( "You don't have enough money!", thePlayer, 255, 0, 0 ) end else outputChatBox ( "You can spin only all 30 Seconds.", thePlayer, 255, 0, 0 ) end end addCommandHandler ( "spin", Spin_Func )
  12. Check if the amount is higher than 0. if ( amount > 0 ) then return outputChatBox ( "Invalid amount.", thePlayer, 255, 0, 0 ) end
  13. I'm not sure, but I think that you can't replace clothes model, just textures.
  14. Oh dear... why do you even post without knowing anything about it? engineSetModelLODDistance uses a model, not an element.
  15. No, it doesn't, you are triggering that event just when script starts, using the button element as "theElement" and sending the window element, explain me how does it make sense.
  16. Maybe the font is invalid, try another one.
  17. No, you have to make it yourself, for obvious reasons, there isn't events for everything and some of them just don't have the required parameters.
  18. I'm not really sure, but maybe this one: engineSetModelLODDistance *CLIENT SIDE ONLY*
  19. Maybe because you aren't thinking at all, it's not a hard script, and on the wiki, there are examples about triggering.
  20. That makes totally no sense, "onClientRender" has no parameters.
  21. That doesn't really make much sense, "onClientRender" has no parameters.
×
×
  • Create New...