Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    Players

    You are trying to compare "v" which is a player element to a number.
  2. Castillo

    Help pls

    To get the data of the selected player you must use getPlayerFromName. function setplayerinf ( ) local row, col = guiGridListGetSelectedItem ( GUIEditor_Grid[1] ) if ( row and col and row ~= -1 and col ~= -1 ) then local playerName = guiGridListGetItemText ( GUIEditor_Grid[1], row, 1 ) local player = getPlayerFromName ( playerName ) if ( player ) then local name = getPlayerName( player ) local team = getPlayerTeam( player ) local role = getElementData( player, "Role" ) local gang = getElementData ( player, "gang" ) local wl = getPlayerWantedLevel ( player ) guiSetText ( GUIEditor_Label[5], "WantedLevel:"..wl ) guiSetText ( GUIEditor_Label[1], "Name:"..name ) guiSetText ( GUIEditor_Label[2], "Team:"..team ) guiSetText ( GUIEditor_Label[3], "Role:"..role ) guiSetText ( GUIEditor_Label[6], "Gang:"..gang ) end end end addEventHandler ( "onClientGUIclick", GUIEditor_Button[1], setplayerinf, false ) The wanted level part won't work, because getPlayerWantedLevel returns the local player wanted level if you use it client side, you can't get a remote player's wanted level.
  3. You are using the event "onPlayerQuit"? if so, it should work for lossing connection or quitting by "quit" or "/quit".
  4. What doesn't work exactly? do you get any script error? use /debugscript 3.
  5. Castillo

    Group

    All these functions can be made with scripting.
  6. Well, you must get the players server side, get their wanted level, insert them on a table, then send it to the client side and add to grid list.
  7. Should work, I destroyed a vehicle with just a few shoots. Remember that you must use the M4.
  8. Castillo

    Jail.

    Make it all in one. function wanted1 ( attacker, attackerweapon ) local money = math.random ( 100, 500 ) local time = math.random ( 5000, 15000 ) local theSkin = getElementModel ( attacker ) local WL = getPlayerWantedLevel ( source ) if ( attackerweapon == 3 ) and ( theSkin == 280 ) and ( WL > 0 ) then exports [ "guimessages" ] : outputServer ( source, "You are jailed by ".. getPlayerName ( attacker ) .."." , 25, 25, 255 ) exports [ "guimessages" ] : outputServer ( attacker, "You have arrest ".. getPlayerName ( source ) .."." , 25, 25, 255 ) givePlayerMoney ( attacker, money ) addPlayerArrests ( attacker ) setElementPosition ( source, 0, 0, 0 ) toggleAllControls ( source, false ) setTimer ( function ( thePlayer ) if ( isElement ( thePlayer ) ) then toggleAllControls ( thePlayer, true ) setElementPosition ( thePlayer, 1546.51, -1675.71, 13.5 ) setPlayerWantedLevel ( thePlayer, 0 ) end end ,time, 1, source ) end end addEventHandler ( "onPlayerDamage", getRootElement(), wanted1 ) function addPlayerArrests ( attacker ) local account = getPlayerAccount ( attacker ) if isGuestAccount ( account ) then return end local arrests = getAccountData ( account, "Arrests" ) if ( not arrests ) then setAccountData ( account, "Arrests", 0 ) end setAccountData ( account, "Arrests", tonumber ( arrests ) + 1 ) setElementData ( attacker, "Arrests", tonumber ( arrests ) + 1 ) end addEventHandler ( "onPlayerLogin", root, function ( ) local account = getPlayerAccount ( source ) if isGuestAccount ( account ) then return end local arrests = getAccountData ( account, "Arrests" ) or 0 setElementData ( source, "Arrests", arrests ) end )
  9. Castillo

    Jail.

    function wanted1 ( attacker, attackerweapon ) local money = math.random ( 100, 500 ) local time = math.random ( 5000, 15000 ) local theSkin = getElementModel ( attacker ) local WL = getPlayerWantedLevel ( source ) if ( attackerweapon == 3 ) and ( theSkin == 280 ) and ( WL > 0 ) then exports [ "guimessages" ] : outputServer ( source, "You are jailed by ".. getPlayerName ( attacker ) .."." , 25, 25, 255 ) exports [ "guimessages" ] : outputServer ( attacker, "You have arrest ".. getPlayerName ( source ) .."." , 25, 25, 255 ) givePlayerMoney ( attacker, money ) local playeraccount = getPlayerAccount ( attacker ) local arrestnumber = tonumber ( getAccountData ( playeraccount, "Arrests" ) ) or 0 setAccountData ( playeraccount, "Arrests", arrestnumber + 1 ) setElementPosition ( source, 0, 0, 0 ) toggleAllControls ( source, false ) setTimer ( function ( thePlayer ) if ( isElement ( thePlayer ) ) then toggleAllControls ( thePlayer, true ) setElementPosition ( thePlayer, 1546.51, -1675.71, 13.5 ) setPlayerWantedLevel ( thePlayer, 0 ) end end ,time, 1, source ) end end addEventHandler ( "onPlayerDamage", getRootElement(), wanted1 ) Try it.
  10. It works here, you must put it as client side on meta.xml.
  11. You surely defined the script as client side on meta.xml, but it's server side.
  12. addEventHandler("onClientPlayerWeaponFire", root, function (weapon, _, _, _, _, _, hitElement) if (weapon == 31) and (getElementType(hitElement) == "vehicle") then local health = getElementHealth(hitElement) setElementHealth(hitElement, health - 100) end end ) Try it.
  13. Will it give heath for car ? I need to make that when i shot to car with that gun, it makes car HP lower. I tryed this script now, dont work : ( and tryed with - 100 It won't work because of what I said, go check the wiki to see the arguments.
  14. Con un timer o onClientRender, y: setElementRotation
  15. It's really simple, you must add after "giveWeapon" the function to take the money, e.g: function givesilenced ( ) giveWeapon ( client, 23, 51, true ) takePlayerMoney ( client, 500 ) end addEvent("givesilenced",true) addEventHandler("givesilenced",getRootElement(),givesilenced)
  16. Second argument of: "onClientPlayerWeaponFire" isn't the hitElement.
  17. Castillo

    Jail.

    Do you get any error?
  18. You must get the list server side.
  19. Does it appear on meta.xml? are you sure that these are the real vehicle names?
  20. You can either use a timer to change a variable which will be later used for width at dxDrawRectangle.
  21. Castillo

    ERROR

    @Metall: That doesn't make any sense, that's a script error, nothing to do with resource or file name. @boro: It could be a compiled script ( if I'm right, they don't show the name of the resource/file that causes the error ).
×
×
  • Create New...