Jump to content

3eBpA

Members
  • Posts

    38
  • Joined

  • Last visited

Everything posted by 3eBpA

  1. 3eBpA

    Copying vehicle

    oh, ok, I'll try to do something =\
  2. Hello guys, I've got a question, can I copy tank for 2 or 3 different copyes, I mean, how can I create a copy of tank with same characteristics but with another model ? =\
  3. also, is it enough RAM 512 mb and CPU 750 mhz plus HDD 25gb for 100 - 200 slots server ?
  4. hello guys, do u know any good and cheap server hosting or VPS's ? For mta server, over 50 - 100 slots
  5. So use onClientPlayerWeaponFire event instead. But, there is another important note: and you are using the weaponID 3 so according to this list: Weapon ids list it is a melee weapon, so it won't work. So what can we do now ?? We can try to find another event, and I found this event: onClientPlayerDamage and it gives us an important parameter: Great ! We can do it with this event: function Stun( attacker ) outputChatBox("Took damage !") local policeTeam = getTeamFromName("police") if getPlayerTeam(attacker) == policeTeam and getPlayerTeam(source) ~= policeTeam and getElementModel(attacker) == 3 then outputChatbox("Frozen !") setElementFrozen(source, true) end end addEventHandler("onClientPlayerDamage", localPlayer, Stun) Tell me if it works. Regards, Citizen yep, works, thanks man
  6. So use onClientPlayerWeaponFire event instead. But, there is another important note: and you are using the weaponID 3 so according to this list: Weapon ids list it is a melee weapon, so it won't work. So what can we do now ?? We can try to find another event, and I found this event: onClientPlayerDamage and it gives us an important parameter: Great ! We can do it with this event: function Stun( attacker ) outputChatBox("Took damage !") local policeTeam = getTeamFromName("police") if getPlayerTeam(attacker) == policeTeam and getPlayerTeam(source) ~= policeTeam and getElementModel(attacker) == 3 then outputChatbox("Frozen !") setElementFrozen(source, true) end end addEventHandler("onClientPlayerDamage", localPlayer, Stun) Tell me if it works. Regards, Citizen thanks, I'm gonna try this tomorrow
  7. thank you man, your really save me from sleepless nights
  8. I've changed OnClientWeaponFire to onClientWeaponFire, I think the problem is in teams =\
  9. well, why my code doesn't work then ? : O function Stun(attacker) if getPlayerTeam(attacker) == police and getPlayerTeam(source) ~= police and getElementModel(attacker) == 3 setElementFrozen(source) end end addEventHandler("OnClientWeaponFire", getRootElement(), Stun) it should stun guy with weaponID 3 if his team != police but it doesn't works, maybe because team creation is written in server.lua ?
  10. Hello guys, I have got a question, how can I use a server script variables or functions to client script, for example, teams, I've got teams on my server and I need to use them on client, how can I do that ? =\
  11. well, can I use a function from the client ?
  12. no errors, when I'm going to the marker, there's no GUI window but looks like it should appear =\, when I'm hitting marker, there should be used the truckerGUI function, which is creating gui window and button
  13. triggerserverevent ? Ok, I'll try
  14. and also, I've tried, script don't works, even if I'm copypasting it from here
  15. oh, so I should create vehicle from server-side ? if yes, so, can u show me how to do that ?
  16. what do u mean with words "and these won't be usable" ? it's job's car spawner
  17. oh, thanks man, you're always helping me
  18. hmm, can u help noob like me with this code ? =\
  19. Всем привет, у меня тут возникла некая проблема, когда я ставлю type = "client" у меня маркеры из клиента не создаются, вот код marker1 = createMarker(872, -1208, 16, 'cylinder', 2.0, 255, 0, 0, 0) workmarker = createMarker(860, -1208, 16, 'cylinder', 2.0, 0, 255, 0 , 150); function MarkerHit( hitElement, matchingDimension ) local elementType = getElementType( hitElement ) if(getElementType(hitElement) == 'player') and getElementData(hitElement,"vehicle") == false and getElementData(hitElement,"trucker") == true then local x,y,z = getElementPosition(hitElement) createVehicle(403, x + 10, y, z, 0 , 0 , 180) setElementData(hitElement,"vehicle",true) elseif getElementData(hitElement,"vehicle") == true then outputChatBox("You have got already a vehicle or you're not a trucker"); end end function TruckerGUI() myWindow = guiCreateWindow ( 0.5, 0.5, 0.5, 0.4, "Trucker Job Menu", true ) btn1 = guiCreateButton(0.180, 0.180, 0.15, 0.20, "Hire", true, hireWindow); addEventHandler ( "onClientGUIClick", btn1, btn1_Click, false) end function btn1_Click(hitElement, btn1, matchingDimension) local element = getElementType(hitElement); if btn1 == "left" and (getElementType(hitElement) == 'player') and getElementData(hitElement,"trucker") == false and getElementData(hitElement,"vehicle") == false then setElementModel(hitElement, 206); setElementData(hitElement,"trucker",true); setPlayerTeam(hitElement, truckers); setMarkerColor(marker1, 255, 0, 0, 150); else end end addEventHandler("onMarkerHit", marker1, MarkerHit ) addEventHandler("onMarkerHit", workmarker, TruckerGUI)
  20. Ok, a new portion of questions and errors I'm trying to draw a GUI from client script and create markers on server side script (can't create marker from client), when I hit the marker I can't get my gui drawing =\ here, client side : function MarkerHit( hitElement, matchingDimension ) local elementType = getElementType( hitElement ) if(getElementType(hitElement) == 'player') and getElementData(hitElement,"vehicle") == false and getElementData(hitElement,"trucker") == true then local x,y,z = getElementPosition(hitElement) createVehicle(403, x + 10, y, z, 0 , 0 , 180) setElementData(hitElement,"vehicle",true) elseif getElementData(hitElement,"vehicle") == true then outputChatBox("You have got already a vehicle or you're not a trucker"); end end addEventHandler("onMarkerHit", marker1, MarkerHit ) function TruckerGUI() local myWindow = guiCreateWindow ( 0.5, 0.5, 0.5, 0.4, "Trucker Job Menu", true ) local b1X = 0.180; local b1Y = 0.180; local b1Width = 0.15; local b1Height = 0.20; btn1 = guiCreateButton(b1X, b1Y, b1Width, b1Height, "Hire", true, hireWindow); addEventHandler ( "onClientGUIClick", btn1, btn1_Click, false) end addEventHandler("onMarkerHit", workmarker, TruckerGUI) function btn1_Click(hitElement, btn1, matchingDimension) local element = getElementType(hitElement); if btn1 == "left" and (getElementType(hitElement) == 'player') and getElementData(hitElement,"trucker") == false and getElementData(hitElement,"vehicle") == false then setElementModel(hitElement, 206); setElementData(hitElement,"trucker",true); setPlayerTeam(hitElement, truckers); setMarkerColor(marker1, 255, 0, 0, 150); else end end and server script local truckers = createTeam("Truckers", 222, 153, 25); local unemployedteam = createTeam("Unnemployed", 0, 0, 0); marker1 = createMarker(872, -1208, 16, 'cylinder', 2.0, 255, 0, 0, 0) workmarker = createMarker(860, -1208, 16, 'cylinder', 2.0, 0, 255, 0 , 150);
  21. hmm, okay, thanks, if there'll be more questions, I'll write in this topic
  22. why does skin don't puts on the player ? function TakeJob(hitElement, matchingDimension, thePlayer) local element = getElementType(hitElement); if(getElementType(hitElement) == 'player') and getElementData(hitElement,"trucker") == false and getElementData(hitElement,"vehicle") == false then setPedSkin(source, 206); setElementData(hitElement,"trucker",true); setPlayerTeam(hitElement, truckers); setMarkerColor(marker1, 255, 0, 0, 150); outputChatBox("To end you job stand back on this marker and you will automatically end your job"); elseif getElementData(hitElement,"trucker") == true then outputChatBox("You have ended your job"); setPlayerTeam(hitElement, unemployedteam); setElementData(hitElement,"trucker",false); setMarkerColor(marker1, 255, 0, 0, 0); end end addEventHandler("onMarkerHit", workmarker, TakeJob); Replace it with: setElementModel(hitElement, 206); oh, yep, works, thanks but one question, why I can't change char skin here using setpedskin ? in another function I could use it
  23. why does skin don't puts on the player ? function TakeJob(hitElement, matchingDimension, thePlayer) local element = getElementType(hitElement); if(getElementType(hitElement) == 'player') and getElementData(hitElement,"trucker") == false and getElementData(hitElement,"vehicle") == false then setPedSkin(source, 206); setElementData(hitElement,"trucker",true); setPlayerTeam(hitElement, truckers); setMarkerColor(marker1, 255, 0, 0, 150); outputChatBox("To end you job stand back on this marker and you will automatically end your job"); elseif getElementData(hitElement,"trucker") == true then outputChatBox("You have ended your job"); setPlayerTeam(hitElement, unemployedteam); setElementData(hitElement,"trucker",false); setMarkerColor(marker1, 255, 0, 0, 0); end end addEventHandler("onMarkerHit", workmarker, TakeJob);
  24. well, I'm .Net programmer, who wants to learn Lua, so I'm not new to OOP =\ and I think, I'll create a gui window with "hire" and "exit" buttons
  25. yes, I have analyzed the situation and I'm thinking about creating a /exit command so I can exit trucker's team, this is a topic about commands, yes ? https://forum.multitheftauto.com/viewtopic.php?f=148&t=43227
×
×
  • Create New...