-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
Use the following functions: getPlayerAccount getAccountName aclGetGroup isObjectInACLGroup
-
Are you sure that none of your scripts is removing the data somehow? does it happen to the team from the player that left the server?
-
'source' is not defined at "payTheTicket" function.
-
You are setting the data to the team element and not the player?
-
You are binding the key to the same function that binds the key in the first place, it makes no sense.
-
How to access to the Admin on the script? HELP ME
Castillo replied to Furious^ONE!'s topic in Scripting
You're welcome. -
How to access to the Admin on the script? HELP ME
Castillo replied to Furious^ONE!'s topic in Scripting
What's the point on using string.format? you can simply do: "user.".. getAccountName ( getPlayerAccount ( player ) ) @RoRo76: Try this: local gate = createObject ( 10828, -1570.5, 1117.5, 16.10000038147, 0, 0, 91.988525390625 ) local state = false addCommandHandler ( "gate", function ( thePlayer ) if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Admin" ) ) then if ( not state ) then moveObject ( gate, 3000, -1570.5, 1117.5, 30.2, 0, 0, 0 ) else moveObject ( gate, 3000, -1570.5, 1117.5, 16.10000038147, 0, 0, 0 ) end state = ( not state ) end end ) -
How to access to the Admin on the script? HELP ME
Castillo replied to Furious^ONE!'s topic in Scripting
You must use the following functions: getPlayerAccount -- Gets the account element of a player. getAccountName -- Gets the name of an account element. aclGetGroup -- Gets the ACL group from it's name. isObjectInACLGroup -- Checks if an object is in the ACL group. -
marker5 = createMarker( 1288.17566, -1641.94141, 12.54688, "Cylinder", 1, 0, 0, 255, 200) pedi = createPed ( 285, 1288.17566, -1641.94141, 13.54688, 270) blipA = createBlip ( 1288.17566, -1641.94141, 13.54688, 58, 2, 255, 0,0, 255) function panel(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then local playerTeam = getPlayerTeam ( localPlayer ) if ( playerTeam ) then local oldTeamName = getTeamName ( playerTeam ) if ( oldTeamName ~= "SWAT" ) then panel = guiCreateWindow(443, 132, 416, 514, "S.W.A.T Job", false) guiWindowSetSizable(panel, false) aceptar = guiCreateButton(16, 282, 169, 72, "Accept", false, panel) cerrar = guiCreateButton(230, 282, 169, 72, "Close", false, panel) memo = guiCreateMemo(12, 26, 382, 238, "Welcome to the SWAT Job Accept this job if you are an SWAT\nIf you aren't a swat You cannot accept this Job.", false, panel) showCursor (true) addEventHandler ("onClientGUIClick", aceptar, aceptarr, false ) addEventHandler ("onClientGUIClick", cerrar, cerrarr, false ) guiMemoSetReadOnly(memo, true) end end end end addEventHandler("onClientMarkerHit", marker5, panel ) function aceptarr ( thePlayer ) triggerServerEvent ( "onGreeting", localPlayer) guiSetVisible ( panel, false ) showCursor(false) end function cerrarr ( hitElement ) guiSetVisible ( panel, false ) showCursor(false) end
-
El problema con los zip es si es un recurso con un archivo al que queres editar, por ejemplo, un archivo XML con datos y lo querias modificar desde el recurso, si esta en zip no podras hacerlo.
-
Y cual seria la linea 443 en ese pedazo de codigo?
-
Post what you tried.
-
Get the player team and see if it's SWAT or not. getPlayerTeam getTeamName
-
You must create the team once, then get it from it's name. createTeam ( "SWAT", 0, 0, 255 ) function aceptarr ( ) local theTeam = getTeamFromName ( "SWAT" ) if ( theTeam ) then setPlayerTeam ( source, theTeam ) setPlayerNametagColor ( source, 0, 0, 255 ) setElementModel ( source, 285 ) giveWeapon ( source, 31, 550 ) giveWeapon ( source, 23, 550 ) giveWeapon ( source, 3, 550 ) giveWeapon ( source, 29, 550 ) giveWeapon ( source, 46, 550 ) giveWeapon ( source, 41, 5000 ) end end addEvent( "onGreeting", true ) addEventHandler( "onGreeting", root, aceptarr )
-
Move the bindKey after the "sendClientMessage". P.S: You put "Press H" in the message, but the key is binded to "N".
-
What is the bind for?
-
Just so you know, I changed it to obtain the value from the column 2, I guess the value "col" was 1. You're welcome.
-
En lugar de que obtenga el dinero del jugador pones 10.
-
function loadHandler(button, state) if button == "left" and state == "up" then local row, col = guiGridListGetSelectedItem(glistLoadList) if ( row and col and row ~= -1 and col ~=-1 ) then local data = guiGridListGetItemData(glistLoadList, row, 2) local startx, starty, startz, endx, endy, endz, cash = unpack(data) triggerEvent("startLoad", localPlayer, startx, starty, startz, endx, endy, endz, cash) end end end function beginLoad(startx, starty, startz, endx, endy, endz, cash) createMarker(startx, starty, startz, "checkpoint", 5) createBlip(-102, -70, 5, 0, 2, 0, 0, 255) end addEvent("startLoad", false) addEventHandler("startLoad", localPlayer, beginLoad) Try it.
-
1: You must check if the wanted level of the player is below 2. function onPlayerDamage ( attacker ) if isPlayerInTeam ( source, "Police" ) then if ( getElementType ( attacker ) == "player" and getElementModel ( source ) == 280 ) and ( getPlayerWantedLevel ( attacker ) < 2 ) then setPlayerWantedLevel ( attacker, 2 ) end end end addEventHandler ( "onPlayerDamage", getRootElement(), onPlayerDamage ) 2: The first argument of "onPlayerWasted" is the total ammo, the second is the killer. function onPlayerWasted ( _, attacker ) if isPlayerInTeam ( source, "Police" ) then if ( getElementType ( attacker ) == "player" ) then if ( attacker ~= source ) then setPlayerWantedLevel ( attacker, getPlayerWantedLevel ( attacker ) + 1 ) end end end end addEventHandler ( "onPlayerWasted", getRootElement(), onPlayerWasted )
-
Show me the part where you set this data.
-
Cancel the onClientPedDamage event.
-
I killed a player and got reputation status "good1", then I killed another and my reputation status went back to "normal".