-
Posts
1,248 -
Joined
-
Last visited
Everything posted by WhoAmI
-
To inserting/updating things use dbExec.
-
In zapisEq function change client to source.
-
You have to set team by using setPlayerTeam function inside this resource.
-
Look inside script and look for addCommandHandler.
-
Well, in my opinion onClientRender and getTickCount would be way better.
-
There are few ways to do it. You just need some mathematic stuff to set image's position depends on wanted level.
-
Are you crazy? You are looping table 30-60 times per second. Isn't it better to create 'onPlayerTeamChange' event, and then setting data. Event will looks like _setPlayerTeam = setPlayerTeam addEvent ( "onPlayerTeamChange", true ) function setPlayerTeam ( player, team ) if not team or not player then return false end local oldTeam = getPlayerTeam ( player ) triggerEvent ( "onPlayerTeamChange", player, oldTeam, team ) return _setPlayerTeam ( player, team ) end and the usage addEventHandler ( "onPlayerTeamChange", root, function ( oldTeam, currentTeam ) --todo, Source is the Player who changed team end )
-
In loginPlayer function, before 8 line put outputChatbox (username .. password ) to check if values are triggered correctly
-
Show me callServerFunction.
-
When you are calling this function?
-
Use [url=https://wiki.multitheftauto.com/wiki/DxCreateFont]https://wiki.multitheftauto.com/wiki/DxCreateFont[/url]
-
change local pX, pY, pZ = getElementPosition ( player ) to local pX, pY, pZ = getElementPosition ( localPlayer )
-
local ped = createPed (21, 2000.6636962891, 1538.318359375, 13.5859375) addEventHandler ( "onClientRender", root, function ( ) local pX, pY, pZ = getElementPosition ( player ) local pedX, pedY, pedZ = getElementPosition ( ped ) local distance = getDistanceBetweenPoints3D ( pX, pY, pZ, pedX, pedY, pedZ ) if ( distance <= 12 ) then local x, y = getScreenFromWorldPosition ( pedX, pedY, pedZ ) if ( x and y ) then dxDrawText( "Criminal", x, y, _, _, tocolor( 255, 255, 255, 2555 ), 2, "default", "center", "center" ) end end end )
-
local pedX, pedY, pedZ = 0, 0, 0 local maxDistance = 12 -- the distance showing 3dtext addEventHandler ( "onClientRender", root, function ( ) local pX, pY, pZ = getElementPosition ( localPlayer ) local distance = getDistanceBetweenPoints3D ( pX, pY, pZ, pedX, pedY, pedZ ) if ( distance <= maxDistance ) then local x, y = getScreenFromWorldPosition ( pedX, pedY, pedZ ) if ( x and y ) then dxDrawText( "text", x, y, _, _, tocolor( 255, 255, 255, 2555 ), 2, "default", "center", "center" ) end end end ) It should work, but I'm not sure, couse I was writing it kinda fast.
-
setElementModel ( localPlayer, tonumber ( skin ) ) I'm not sure, but i think, that you would only see this skin, no other players.
-
addEvent ( "onPlayerPickUpRacePickup", true ) addEventHandler ( "onPlayerPickUpRacePickup", getRootElement(), function ( pickupID, pickupType, vehicleModel ) if ( pickupType == "vehiclechange" ) then loadVehicleColor ( source ) outputChatBox ( "loadVehicleColor for ".. tostring ( getPlayerName ( source ) ) ) end end Check this out. )
-
Well, you have to make your own healing function and check if the player's wanted level is more than 2 ( >= 2 ), then setElementHealth.
-
Add parameter to loginCallback function ('player'). And then call this function giving player. loginCallback ( player, qh ) and then dbQuery ( loginCallback, source, ... )
-
addEventHandler ( "onVehicleEnter", root, function ( player ) local team = getTeamName ( getPlayerTeam ( player ) ) if ( team == "WhiteTeam" or team == "BlackTeam" ) then destroyElement ( source ) end end )
-
Zły addEventHandler? Błąd z GUI
WhoAmI replied to mommytellme's topic in Pomoc ze skryptami i programowaniem w Lua
exports.nazwa_skryptu:funkcja ( parametry ) -
exampleTable = { stringKey = "Value 1", secondString = "Value 2" } or table.insert
-
Check exported functions in ID_System in meta.xml.
