Jump to content

WhoAmI

Members
  • Posts

    1,248
  • Joined

  • Last visited

Everything posted by WhoAmI

  1. WhoAmI

    mysql question

    To inserting/updating things use dbExec.
  2. WhoAmI

    Help Me

    onPlayerChat event.
  3. In zapisEq function change client to source.
  4. You have to set team by using setPlayerTeam function inside this resource.
  5. WhoAmI

    Vote manager.

    Look inside script and look for addCommandHandler.
  6. Well, in my opinion onClientRender and getTickCount would be way better.
  7. WhoAmI

    [Bribe]

    There are few ways to do it. You just need some mathematic stuff to set image's position depends on wanted level.
  8. 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 )
  9. In loginPlayer function, before 8 line put outputChatbox (username .. password ) to check if values are triggered correctly
  10. Show me callServerFunction.
  11. When you are calling this function?
  12. Use [url=https://wiki.multitheftauto.com/wiki/DxCreateFont]https://wiki.multitheftauto.com/wiki/DxCreateFont[/url]
  13. change local pX, pY, pZ = getElementPosition ( player ) to local pX, pY, pZ = getElementPosition ( localPlayer )
  14. 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 )
  15. 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.
  16. setElementModel ( localPlayer, tonumber ( skin ) ) I'm not sure, but i think, that you would only see this skin, no other players.
  17. 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. )
  18. WhoAmI

    Small problem

    Well, you have to make your own healing function and check if the player's wanted level is more than 2 ( >= 2 ), then setElementHealth.
  19. Add parameter to loginCallback function ('player'). And then call this function giving player. loginCallback ( player, qh ) and then dbQuery ( loginCallback, source, ... )
  20. WhoAmI

    Help!

    addCommandHandler ( "setposition", function ( player ) setElementPosition ( player, 3003.69995, 844.90002, 40.1 ) end ) /setposition
  21. addEventHandler ( "onVehicleEnter", root, function ( player ) local team = getTeamName ( getPlayerTeam ( player ) ) if ( team == "WhiteTeam" or team == "BlackTeam" ) then destroyElement ( source ) end end )
  22. exampleTable = { stringKey = "Value 1", secondString = "Value 2" } or table.insert
  23. Check exported functions in ID_System in meta.xml.
×
×
  • Create New...