Jump to content

Price.

Members
  • Posts

    244
  • Joined

  • Last visited

Everything posted by Price.

  1. Price.

    Output problem

    Thanks, its working perfectly now!
  2. Price.

    Output problem

    when I get outside the col shape it refuses to get me inside again using that command
  3. Price.

    Output problem

    alright now I'm trying a last thing but idk what's wrong lel, I'm trying to do if he got to the island using /staffland command then he can no longer use it inside the COLshape of the land, I made the checks and all but I can still teleport when I'm inside function staffcommand (player, command) local account = getPlayerAccount(player) local x, y, z = getElementPosition(player) if account and not isGuestAccount(account) then local accName = getAccountName(account) if not (isPedInVehicle(player) and getPedOccupiedVehicle (player)) then if ( isObjectInACLGroup ("user."..accName, aclGetGroup ("Admin"))) then if player and isElement(player) and (getElementType(player) == "player") then setElementPosition ( player, 3749.9094238281, -194.06666564941, 5.3276481628418 ) end else outputChatBox("Only staff can use this command.", player, 255, 0, 0) end end if player and isElement(player) and (getElementType(player) == "player") then if isPedInVehicle(player) and getPedOccupiedVehicle (player) then outputChatBox("You cannot use this command inside a vehicle.", player, 255, 0, 0, true) end end end end if player and isElement(player) and (getElementType(player) == "player") then local account = getPlayerAccount(player) local x, y, z = getElementPosition(player) if account and not isGuestAccount(account) then local accName = getAccountName(account) local detection = isElementWithinColShape ( player, islandCOL ) if ( isObjectInACLGroup ("user."..accName, aclGetGroup ("Admin"))) then local detection = detection and getElementDimension( player ) == getElementDimension( islandCOL ) if isElementWithinColShape ( player, islandCOL ) == true then removeCommandHandler ( "staffland" ) outputChatBox("You are already in the staff island.", player, 255, 0, 0, true) end end end end addCommandHandler("staffland", staffcommand) any help?
  4. so I'm making a simple command but I guess I complicated it the way I made it, Im making a check if the player is an admin and if he is a player then he setPos to certain location, if he is not then output "you cannot use this command ", and if he is in a vehicle return false with output outputs are all mixed sometimes and I can't get all to work at the right situation function staffcommand (player, command) local account = getPlayerAccount(player) local x, y, z = getElementPosition(player) if account and not isGuestAccount(account) then local accName = getAccountName(account) if ( isObjectInACLGroup ("user."..accName, aclGetGroup ("Admin"))) then if player and isElement(player) and (getElementType(player) == "player") then setElementPosition ( player, 3749.9094238281, -194.06666564941, 5.3276481628418 ) end else outputChatBox("Only staff can use this command.", player, 255, 0, 0) end end if player and isElement(player) and (getElementType(player) == "player") then if (isPedInVehicle(player) and getPedOccupiedVehicle (player)) then return outputChatBox("You cannot use this command inside a vehicle.", player, 255, 0, 0, true) end end end addCommandHandler("staffland", staffcommand)
  5. i've tried doing as you've gave in the link but i reversed accounts, added setaccountdata first and get it later and reversed events, now i know how i could save time with acc data, thanks walid!
  6. still can't figure out how to save the time so when he enters again the timer continues where it left off
  7. is it possible to save using getPlayerAccount? bec its already there and I think I saved a time before using it instead of accountdata
  8. getElement data doesn't save if he logs out of the server and logs in too, I honestly don't like to use element data, isn't there a way around to save it using account, same style you used?
  9. I want it to be saved so when the player keeps getting out and inside the col shape it continues from where it left off so the player doesn't abuse going out and it
  10. when I enter the col shape, I pretty much think it doesn't let the timer go on from where it left off when I entered first time, I entered a lot and every time I go out and go on several times, I don't die so I pretty much think the timer doesnt save where it left off
  11. Now I can't fire with any gun at all, but when I enter LV i can ExplosiveID = { [16] = true, [17] = true, [18] = true, [39] = true, [40] = true, } local hillAreaLS = createColRectangle ( -905.5929, -2933.0986, 4000, 3500 ) local hillAreaSF = createColRectangle( -2994.09448,-1378.01746,2000,4900) local hillAreaLV = createColRectangle (-905.5929,602.33,4000,2500) function hill_EnterLS ( thePlayer, matchingDimension ) outputChatBox( "You have entered Los Santos", thePlayer, 255, 255, 0 ) local slot = getPedWeaponSlot ( thePlayer ) if (getElementType(thePlayer) == "player") and ( slot == -- s8) --> then toggleControl(thePlayer, "fire", false) else toggleControl(thePlayer, "fire", true) -- setPedWeaponSlot ( thePlayer, 0 ) end end addEventHandler ( "onColShapeHit", hillAreaLS, hill_EnterLS ) function hill_EnterSF ( thePlayer, matchingDimension ) outputChatBox( "You have entered San Fierro", thePlayer, 255, 255, 0 ) local slot = getPedWeaponSlot ( thePlayer ) if (getElementType(thePlayer) == "player") and ( slot == -- s8) --> then setPedWeaponSlot ( thePlayer, 0 ) end end addEventHandler ( "onColShapeHit", hillAreaSF, hill_EnterSF ) function hill_EnterLV ( thePlayer, matchingDimension) local slot = getPedWeaponSlot ( thePlayer ) if (getElementType(thePlayer) == "player") and ( slot == 8 ) then toggleControl ( thePlayer, "fire", true ) outputChatBox("You have entered Las Venturas", thePlayer, 255, 255, 0) end end addEventHandler ( "onColShapeHit", hillAreaLV, hill_EnterLV ) bannedIds = {16,17,18,39,40} addEventHandler ( 'onPlayerWeaponSwitch', getRootElement ( ), function ( previousWeaponID, currentWeaponID) for i, thePlayer in ipairs(getElementsByType("player")) do local city = getElementZoneName(thePlayer, true) if city == "Las Venturas" then local slot = getPedWeaponSlot(thePlayer) for _,id in ipairs(bannedIds) do if slot == id then toggleControl(source, "fire", false) else toggleControl(source, "fire", true) end end end end end ) @Tails, Uhm Its not a problem to make it force switch to fists, I will still be able to switch to grenades then, Its about preventing switching to grenades / Disable firing them
  12. hmm, works but the main purpose still not working, I can switch back to nades regularly
  13. Changing true in the getZoneName won't help, I tried that already I just forgot to paste it I tried your code @Tails but uhm, the outputchatbox works and all and if I'm holding a grenade it switches to fist but I still can switch back to grenades regularly PS: I Switched to source variable instead of thePlayer bec it gives errors
  14. well I'm trying to disable explosives in both SF and LS and make them allowed in LV, so I made it when you try to switch to slot that has throwables it switches back to fist, I made that using COL shape but then I'm able to switch back to grenades, I made a separate functions but then I can't enable it in LV, I used toggle control but sometimes I can't shoot with shotguns nor in LV too HELP? SERVER SIDE : ExplosiveID = { [16] = true, [17] = true, [18] = true, [39] = true, [40] = true, } local hillAreaLS = createColRectangle ( -905.5929, -2933.0986, 4000, 3500 ) local hillAreaSF = createColRectangle( -2994.09448,-1378.01746,2000,4900) local hillAreaLV = createColRectangle (-905.5929,602.33,4000,2500) function hill_EnterLS ( thePlayer, matchingDimension ) local slot = getPedWeaponSlot ( thePlayer ) if (getElementType(thePlayer) == "player") and ( slot == -- s8) --> then outputChatBox( "You have entered Los Santos", thePlayer, 255, 255, 0 ) setPedWeaponSlot ( thePlayer, 0 ) end end addEventHandler ( "onColShapeHit", hillAreaLS, hill_EnterLS ) function hill_EnterSF ( thePlayer, matchingDimension ) local slot = getPedWeaponSlot ( thePlayer ) if (getElementType(thePlayer) == "player") and ( slot == -- s8) --> then outputChatBox( "You have entered San Fierro", thePlayer, 255, 255, 0 ) setPedWeaponSlot ( thePlayer, 0 ) end end addEventHandler ( "onColShapeHit", hillAreaSF, hill_EnterSF ) function hill_EnterLV ( thePlayer, matchingDimension) local slot = getPedWeaponSlot ( thePlayer ) if (getElementType(thePlayer) == "player") and ( slot == -- s8) --> then toggleControl ( source, "fire", true ) outputChatBox("You have entered Las Venturas", thePlayer, 255, 255, 0) end end addEventHandler ( "onColShapeHit", hillAreaLV, hill_EnterLV ) addEventHandler ( 'onPlayerWeaponSwitch', getRootElement ( ), function ( previousWeaponID, currentWeaponID) local slot = getPedWeaponSlot ( source ) local x, y, z = getElementPosition(source) local zone = getZoneName ( x, y, z ) if ( ExplosiveID[currentWeaponID] ) then setPedWeaponSlot ( source, 0 ) toggleControl ( source, "fire", false ) else toggleControl ( source, "fire", true ) end end ) There are no errors nor debugs
  15. addEventHandler("onWeaponFire", root, function( ) for _, p in ipairs ( getElementsByType ( "player" ) ) do local tear = getPedWeapon(p) if (tear == 17) then setTimer( destroyElement(tear),3000,1) end end )
  16. @GTX, he can... [lua] theTeam = getPlayerTeam ( p) if getTeamName( theTeam ) == "Team1" or getTeamName( theTeam ) == "Team2" or getTeamName( theTeam ) == "Team3" then [lua]
  17. because the output you just written, you did not specify to whom this message should be delivered function Hola() for _, p in ipairs ( getElementsByType ( "player" ) ) do if getPlayerTeam(p) == getTeamFromName("Delta Team") then exports.Servercommands:dropMessage("*Never Mind this...", p, 9,93,19) end end end addEvent("lol",true) addEventHandler('lol', getRootElement(), Hola) try this, better organised
  18. Price.

    Pickup?

    pick = createPickup (x, y, z, theType, 0, amount, model ) function pickup() for _, p in ipairs ( getElementsByType ( "player" ) ) do if getPlayerTeam(p) == getTeamFromName("Alpha Team") then setElementHealth(p, 100) else cancelEvent() end end addEventHandler("onPickupHit", getRootElement(), pickup)
  19. something like this function BikeCycle() setPlayerStat ( source, 229, 999 ) setPlayerStat ( source, 230, 999 ) end addEventHandler ( "onPlayerJoin", getRootElement(), BikeCycle)
  20. you have to start the script with a "function name ()" also command handler doesn't need a "getRootElement()" only the command and the function's name it goes like this function teamTest () local playerTeam = getPlayerTeam ( source ) local team = getTeamFromName ( "Criminal" ) setPlayerTeam ( source, team ) end addCommandHandler("criminal", teamTest )
  21. Price.

    [Help] Coding

    you can compile it https://luac.multitheftauto.com/ make sure you have a backup of the compiled script.
  22. should I add this with a command handler? also about element law banned.. I see no one else but the (bad_officer) as this is the element where it checks the banned ppl, and didn't do anything last time
×
×
  • Create New...