-
Posts
382 -
Joined
-
Last visited
Everything posted by yMassai
-
someone could help me? I could using the SetTime?
-
First add the ACL script allowing only the use ADM and after add the addCommandHandler in script
-
setPlayerWantedLevel(pla,1) as we know this command give a star to player, would put a time of 60 seconds to disappear this star?
-
sckatchof you are creating a server rpg? I really appreciate a rpg server, maybe I can be useful on the server.
-
this example would not be specific to a skin? for example, a command that adicionace the skin and the team. if we are talking about the player would enter the FBI / FBI and automatically add the Skin 286 e and the FBI Team.
-
you could add to the script commands to get the Team and a skin?
-
I'm trying to learn from these examples. but it is not working does not help much.
-
I know I have to do but the way I thought it was not work.
-
local skin = {[275] = true} --Medic function healFlowers (attacker, attackerweapon, bodypart, loss) theHealth = getElementHealth (source) if not skin[getElementModel(attacker)] then return end --checks attackers skin if ( theHealth > 95 ) then --checks clients health if (getPlayerMoney(attacker) < 200) then --checks attacker money setPlayerMoney (attacker, 0) else takePlayerMoney (attacker, 200) --takes attackers money for DMing to earn more outputChatBox("Hospital: Don't DM to get more money. Your pay has been lowered.",attacker,0,255,255) --info in chatbox end else if (attackerweapon == 14) and (loss > 1) and ( theHealth < 95 ) then setElementHealth ( source, theHealth+17 ) --sets clients health+17 givePlayerMoney (attacker, 1.7*theHealth) --pays the medic -- you can change the 1.7 to another number or the whole equation to make a different payout end end end addEventHandler ("onPlayerDamage", getRootElement(), healFlowers ) This script is a doctor, he can give life to the players with a flower. one could replace the flower and put to life with a spray?
-
how I could do this? I had never seen anything about setPlayerWantedLevel
-
i tried to fix and do the same problem, castillo could show the error?
-
g_base_col = createColCuboid ( 97.3376, 1800.0384, -32.0937, 250, 280, 120 ) g_root = getRootElement () --rocketOne = createMarker ( -2931.5136, 454.4492, 17.3671, "corona", 9.5, 255, 0, 0, 150 ) --test marker --rocketTwo = createMarker ( -2931.5932, 487.1994, 17.3671, "corona", 9.5, 255, 0, 0, 150 ) --test marker function hit ( pla, dim ) if getElementType ( pla ) == "player" then local vehicle = getPlayerOccupiedVehicle ( pla ) if vehicle or not vehicle then local skin = getPlayerSkin ( pla ) if ( skin == 287 or skin == 286 ) then setElementData ( pla, "inRestrictedArea", "true" ) triggerClientEvent ( pla, "destroyTrepassor", g_root, pla ) outputChatBox ( "***Restricted Area***", pla, 255, 0, 0 ) outputChatBox ( "* "..getClientName(pla).." has entered Restricted Area!", g_root, 255, 0, 0 ) end end end end function policeStationHit ( thePlayer ) setPlayerWantedLevel ( thePlayer , 1 ) addEventHandler ( "onColShapeHit", policeStation, policeStationHit ) addEventHandler ( "onColShapeHit", g_base_col, hit ) maybe this?
-
g_base_col = createColCuboid ( 97.3376, 1800.0384, -32.0937, 250, 280, 120 ) g_root = getRootElement () --rocketOne = createMarker ( -2931.5136, 454.4492, 17.3671, "corona", 9.5, 255, 0, 0, 150 ) --test marker --rocketTwo = createMarker ( -2931.5932, 487.1994, 17.3671, "corona", 9.5, 255, 0, 0, 150 ) --test marker function hit ( pla, dim ) if getElementType ( pla ) == "player" then local vehicle = getPlayerOccupiedVehicle ( pla ) if vehicle or not vehicle then local skin = getPlayerSkin ( pla ) if skin =={ [287] then ; [286] then ; } setElementData ( pla, "inRestrictedArea", "true" ) triggerClientEvent ( pla, "destroyTrepassor", g_root, pla ) outputChatBox ( "***Restricted Area***", pla, 255, 0, 0 ) outputChatBox ( "* "..getClientName(pla).." has entered Restricted Area!", g_root, 255, 0, 0 ) end end end end addEventHandler ( "onColShapeHit", g_base_col, hit ) This script shows when someone enters the military base. This script tells the player that he occupies the place is restricted. Can put for when a player enter the restricted area without skin 287 without taking a star?
-
WARNING: test\test_s.lua:10: Bad argument @ 'addEventHandler' [Expected element at argument 2, got nil] WARNING: test\test_s.lua:11: Bad argument @ 'addEventHandler' [Expected function at argument 3, got nil] show in console
-
local policeCars = { } -- We create a table. --Create Stuff function testCreateTrainStuff ( ) test_marker_request = createMarker( 1543.98962, -1670.46398, 12.55753, "cylinder", 1.5, 255, 0, 0, 170) createBlip ( 1543.98962, -1670.46398, 13.55753, 41) ped = createPed (280,1543.98962,-1670.46398,13.55753, 90) setElementFrozen ( ped, true ) end addEventHandler ( "onClientPedDamage", ped, cancelEvent ) addEventHandler ( "onResourceStart", resourceRoot, testCreateTestStuff ) addEventHandler ( 'onMarkerHit', root, function ( uElement ) if source == myMarker then local uTeam = getPlayerTeam ( uElement ) if uTeam and getTeamName( uTeam ) == 'Policia' and getElementModel ( player ) == 280 then outputChatBox 'TODO' end end end ) --Create Vehicle function testCreateTest ( ) if ( isElement ( policeCars[ source ] ) ) then -- We check if the player already has a car spawned. destroyElement ( policeCars[ source ] ) -- If so, we destroy it. end policeCars[ source ] = createVehicle ( 596, 1535.05615, -1675.60766, 12.96008 ) -- We create the vehicle stored in 'policeCars' table. outputChatBox ("Você virou Policial", source, 255, 0, 0 ) end addEvent ( "testCreateTest", true ) addEventHandler ( "testCreateTest", root, testCreateTest ) --Test Gui function testCreateTestGUI ( hitElement ) if ( source == test_marker_request ) then triggerClientEvent ( hitElement, "testCreateTestGUI", hitElement ) end end addEventHandler ( "onMarkerHit", root, testCreateTestGUI ) would look like this for example? or I put in the wrong place?
-
could you post a snippet with getPlayerTeam and getElementModel. I would like to see an example.
-
yes but I would like to know the development of controls.
-
you could tell me how do I get for a team and a skin in this sript?
-
I'm learning but I'm kind of slow and need to understand well.
-
when having to add a group, appears in chat Gang error: An error has occurred.! appears on the console: ERROR: @gang_utils.lua.bak:27: Database query failed: no such column: gang_name ERROR: @gang_utils.lua.bak:3: Database query failed: no such column: table gangs 5 columns but 4 values were supplied.
-
someone could help fix the bug of the car? This script creates more of a car, could you create only one to each player? could be introduced to get the skin 280 and the Police team?
-
error: unzipped\test\test_s.lua:24 attempt to call a boolean value
-
script error: test\test_s.lua:10: ambiguous syntax (function call x new statement) near '(' warning: loading script failid: test\test_s:10: ambiguous syntax (function call x new statement) near '(' that appears in the console window