-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
-- 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 )
-
That's a server side event, you must trigger to client side with triggerClientEvent.
-
I'm not sure, maybe try removing low lod when the element streams in?
-
Because there's no such event: "onClientPlayerLogin".
-
You're welcome.
-
You're welcome.
-
He has no idea about what he's talking about, he's just trying to increase his post count.
-
Copy it again, now it works ( tested ).
-
dbConnect dbQuery dbExec dbFree
-
Porque usas las funciones esas? usa las nuevas del MTA que son mas eficientes.
-
You must have copied it wrong, it has to work.
-
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 )
-
Check if the amount is higher than 0. if ( amount > 0 ) then return outputChatBox ( "Invalid amount.", thePlayer, 255, 0, 0 ) end
-
I'm not sure, but I think that you can't replace clothes model, just textures.
-
Oh dear... why do you even post without knowing anything about it? engineSetModelLODDistance uses a model, not an element.
-
Why do you need to know that?
-
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.
-
You did it client side?
-
Maybe the font is invalid, try another one.
-
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.
-
I'm not really sure, but maybe this one: engineSetModelLODDistance *CLIENT SIDE ONLY*
-
Maybe because you aren't thinking at all, it's not a hard script, and on the wiki, there are examples about triggering.
-
That makes totally no sense, "onClientRender" has no parameters.
-
That doesn't really make much sense, "onClientRender" has no parameters.
