-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
You are trying to compare "v" which is a player element to a number.
-
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.
-
You are using the event "onPlayerQuit"? if so, it should work for lossing connection or quitting by "quit" or "/quit".
-
What doesn't work exactly? do you get any script error? use /debugscript 3.
-
All these functions can be made with scripting.
-
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.
-
Should work, I destroyed a vehicle with just a few shoots. Remember that you must use the M4.
-
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 )
-
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.
-
It works here, you must put it as client side on meta.xml.
-
You surely defined the script as client side on meta.xml, but it's server side.
-
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.
-
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.
-
Con un timer o onClientRender, y: setElementRotation
-
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)
-
Second argument of: "onClientPlayerWeaponFire" isn't the hitElement.
-
You must get the list server side.
-
There's no way as far as I know.
-
Does it appear on meta.xml? are you sure that these are the real vehicle names?
-
You can either use a timer to change a variable which will be later used for width at dxDrawRectangle.