Jump to content

Hero192

Members
  • Posts

    512
  • Joined

  • Last visited

Everything posted by Hero192

  1. Hey guys, i think it's my time to start with MySQL, 1)What's the functions i need to knows? 2)If i created a Table where it gonna be saved, at a website? or at a folder/file? 3)Which one is good in saving datas, Mysql or Sqlite? what's the different between them. 4)Please if you know any good tutorial about Mysql post it, mysql not sqlite I hope someone of you know thess things and can give me some informations about these Questions. ~Thanks in advance.
  2. I'll send you the full code via pm
  3. Yes it's the full code,i don't know how to handle this synax error thats why im asking
  4. I tried that but it doesn't working at all, ERROR: Loading script failed : unexpected symbol near ' --Line 3 addEventHandler ( "onPlayerTeamChange", root, function ( oldTeam,newTeam ) local team = getTeamFromName ( "Criminal" ) if oldTeam == team then setElementVisibleTo( criminalBlip, source, nil ) elseif newTeam == team then setElementVisibleTo( criminalBlip, source, true ) end end) local lastPlayerTeam = {} setTimer(function () local players = getElementsByType("player") for i=1,#players do local player = players[i] local playerTeam = getPlayerTeam(player) or false -- make sure it always returns false, if it returns nil. if playerTeam then local lastTeam = lastPlayerTeam[player] or false -- make sure it always returns false, if it returns nil. if playerTeam ~= lastTeam then triggerEvent("onPlayerTeamChange",player,isElement(lastTeam) and lastTeam or false,playerTeam) lastPlayerTeam[player] = playerTeam end else local lastTeam = lastPlayerTeam[player] if lastTeam then triggerEvent("onPlayerTeamChange",player,isElement(lastTeam) and lastTeam or false,nil) lastPlayerTeam[player] = nil end end end end end,1000,0) addEventHandler("onPlayerQuit",root, function () if lastPlayerTeam[source] then lastPlayerTeam[source] = nil end end)
  5. Something like that can be usefull ? addEventHandler ( "onPlayerTeamChange", root, function ( oldTeam,newTeam ) local team = getTeamFromName ( "Criminal" ) if oldTeam == team then setElementVisibleTo( criminalBlip, source, nil ) elseif newTeam == team then setElementVisibleTo( criminalBlip, source, true ) end end) local lastPlayerTeam = {} setTimer(function () local players = getElementsByType("player") for i=1,#players do local player = players[i] local playerTeam = getPlayerTeam(player) or false -- make sure it always returns false, if it returns nil. if playerTeam then local lastTeam = lastPlayerTeam[player] or false -- make sure it always returns false, if it returns nil. if playerTeam ~= lastTeam then triggerEvent("onPlayerTeamChange",player,isElement(lastTeam) and lastTeam or false,playerTeam) lastPlayerTeam[player] = playerTeam end else local lastTeam = lastPlayerTeam[player] if lastTeam then triggerEvent("onPlayerTeamChange",player,isElement(lastTeam) and lastTeam or false,nil) lastPlayerTeam[player] = nil end end end end,1000,0) addEventHandler("onPlayerQuit",root, function () if lastPlayerTeam[source] then lastPlayerTeam[source] = nil end end)
  6. So, please tell me which events should i use and replace them with the infinity timer?
  7. local Vehicle = createVehicle(522,1825.94, -872.12, 63,0,0,0) local criminalBlip = createBlipAttachedTo ( Vehicle, 51 ) setTimer(function () setElementVisibleTo(criminalBlip, root, false) for k, player in ipairs (getElementsByType("player")) do if ( getTeamName ( getPlayerTeam (player) ) == "Criminal" ) then setElementVisibleTo(criminalBlip, player, true) end end end, 1000, 0) setTimer(function () for k, player in ipairs (getElementsByType("player")) do if ( getTeamName ( getPlayerTeam (player) ) ~= "Criminal" ) then setElementVisibleTo(criminalBlip, player, false) end end end, 1000, 0)
  8. Hey guys, i tried this way to make the blip visible only for criminals it works fine ,but it gives WARNINGs, please anyone can help? i want to remove this warning from the code WARNING:Bad argument @ 'setElementVisibleTo' [Expected element at argument 1, got nil] local Vehicle = createVehicle(522,1825.94, -872.12, 63,0,0,0) local criminalBlip = createBlipAttachedTo ( Vehicle, 51 ) setTimer(function () setElementVisibleTo(criminalBlip, root, false) for k, player in ipairs (getElementsByType("player")) do if ( getTeamName ( getPlayerTeam (player) ) == "Criminal" ) then setElementVisibleTo(criminalBlip, player, true) end end end, 1000, 0) setTimer(function () for k, player in ipairs (getElementsByType("player")) do if ( getTeamName ( getPlayerTeam (player) ) ~= "Criminal" ) then setElementVisibleTo(criminalBlip, player, false) end end end, 1000, 0)
  9. Hey again, i still have the same problem about the blip visiblity, i want it shows only for criminal team . I want when i go to ped to change the team if i changed the team to police i want this blip be invisible ,my code doesn't works like i want ,it just works if i restarted the script ,i want it be refreshed. Anyone can give me his hand on this please,i m stuck here.. Thanks in advance. setElementVisibleTo(criminalBlip, root, false) for i, player in ipairs ( getPlayersInTeam ( getTeamFromName ( "Criminal" ) ) ) do outputChatBox("Go pickup it",player,255,0,20) setElementVisibleTo(criminalBlip, player, true) end
  10. Doesn't works , i think there's no event named onPlayerTeamChange, anyone??
  11. Can you explain to me because i didn't get this way, i have to edit it? or put it directly to server side remplaced with what i wrote before? and thank alot for your time
  12. Please try to give me a hand i still need help
  13. Doesn't works, please help me in a good way when player change the team the blip be invisible for no criminals and visible for criminals
  14. Yes i was changing the team just with the default admin panel not with a PED Jobs, i know there's no function for chaning the team but i thought i was wrong, anyway so im not wrong?
  15. It's a part of the script .. Already i did events..etc don't worry my problem is ,i want let blip be visible only for criminals even if i changed the team
  16. No matter if i put the full code or no, but my problem is in this part.
  17. Hey guys, i tried this way to let the blip visible only for criminal team but it works only one time i mean only if i restarted the script, so when i change the team it doesn't works, about errors there's no error. I hope someone can give me a hand thanks in advance~ setElementVisibleTo(criminalBlip, root, false) for i, player in ipairs ( getPlayersInTeam ( getTeamFromName ( "Criminal" ) ) ) do setElementVisibleTo(criminalBlip, player, true) end
  18. My Question is how to make a less distance for a vehicle ,For example When a Bike hit another "Element" object,ped..etc do not get out of it easly, normal MTA vehicle distance , if a bike hited an element with 10/15 KM/H he'll get out of his bike
  19. Hero192

    Ped distance

    I know this function but how to set the distance for it
  20. Hero192

    Ped distance

    Hey guys, i want to know how to set a ped distance for example you can't click on the PED if you went too far like ~30metres. addEventHandler ( 'onClientClick', root, function ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if ( clickedElement ) and ( getElementType ( clickedElement ) == 'ped' ) then if ( not getPlayerTeam (localPlayer) or getTeamName ( getPlayerTeam (localPlayer) ) ~= 'Criminal' ) then sendMessage(" You must be criminal.",255,0,0) return end for i=1, #deliverys do if ( clickedElement == deliverys[i] ) then setElementData(deliverys[i], "del", true) if getElementData(deliverys[i],"del") then if ( guiGetVisible ( Window ) == false ) then guiSetVisible ( Window,true ) end end end end end end)
  21. Hero192

    I need help

    exactly, thanks man you're the best
×
×
  • Create New...