Jump to content

WhoAmI

Members
  • Posts

    1,248
  • Joined

  • Last visited

Everything posted by WhoAmI

  1. policeVehicles = { [598]=true, [596]=true, [597]=true, [599]=true } policeSkins = { [280]=true, [281]=true, [282]=true, [283]=true, [284]=true, [285]=true, [286]=true } function enterVehicle ( player, seat ) if ( policeVehicles[getElementModel ( source )] ) and ( not policeSkins[getElementModel ( player )] ) then if not isObjectInACLGroup ( "user."..getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( "Police" ) ) then outputChatBox ( "Only policeman can enter police cars!", player ) cancelEvent ( ) end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle )
  2. server --------------------------- --(c) by MazzMan/Maxim --------------------------- setFarClipDistance(2000) setCloudsEnabled(false) function createMissel(cx, cy, cz, x, y, z, time, ammoType) if(ammoType)then if(ammoType ~= "small")then missel = createObject(1636, cx, cy, cz-0.2) moveObject(missel, time, x, y, z) end if(time >= 50)then triggerClientEvent("onClientCreateEffect", getRootElement(), cx, cy, cz, x, y, z, ammoType, time) setTimer(function() if(ammoType == "small")then createExplosion(x, y, z, 12, client) elseif(ammoType == "middle")then createExplosion(x, y, z, 2, client) else createExplosion(x, y, z, 10, client) end if(ammoType ~= "small")then destroyElement(missel) end end, time, 1) else if(ammoType ~= "small")then destroyElement(missel) end end else return false end end addEvent("onAc130Shoot", true) addEventHandler("onAc130Shoot", getRootElement(), createMissel) function createAc130(thePlayer, cmd) local x,y,z = getElementPosition(thePlayer) ac130 = createVehicle(592, x+10,y,z+2) setElementData(ac130, "ac130", true) gun = createObject(2985, 0, 0, 0) attachElements(gun, ac130, -2, 0, 0, 0, 180, 0) setElementData(ac130, "gun", gun) end addCommandHandler("ac130", createAc130) addEventHandler ( "onVehicleEnter", root, function ( player, seat ) if ( getElementModel ( source ) == 592 ) then setElementData ( source, "ac130", true ) gun = createObject ( 2985, 0, 0, 0 ) attachElements ( gun, source, -2, 0, 0, 0, 180, 0 ) setElementData ( source, "gun", gun ) triggerServerEvent ( player, "fromserver:enter", source, player, seat ) end end ) addEvent("getPlayerSeat", true) addEventHandler("getPlayerSeat", getRootElement(), function (thePlayer) local seat = getPedOccupiedVehicleSeat(thePlayer) setElementData(thePlayer, "seat", seat) end) client http://pastebin.com/hLZKgUhg
  3. Yea, try to do same steps like in computer having windows OS.
  4. function createAc130(thePlayer) local model = getElementModel(source) if model == 592 then -- Andromada gun = createObject(2985, 0, 0, 0) attachElements(gun, source, -2, 0, 0, 0, 180, 0) setElementData(source, "ac130", true) setElementData(source, "gun", gun) end end addEventHandler("onVehicleEnter",root,createAc130)
  5. WhoAmI

    No negative money

    It won't work. addEventHandler ("onClientResourceStart", resourceRoot, function () setTimer (function () local money = getPlayerMoney () if (money < 0) then setPlayerMoney (0) end end, 10000,0) end) I prefer you to do this s-side like that addEventHandler ("onResourceStart", resourceRoot, function () setTimer (function () for _, player in pairs ( getElementsByType ( "player" ) ) do local money = getPlayerMoney (player) if (money < 0) then setPlayerMoney (player, 0) end end end, 10000,0) end)
  6. WhoAmI

    Marker script

    local x, y, z = 0, 0, 5 -- text position local text = "test" -- text addEventHandler ( "onClientRender", root, function ( ) local x, y = getScreenFromWorldPosition ( x, y, z ); dxDrawText ( text, x + 1, y + 1, x + 1, y + 1, tocolor ( 0, 0, 0, 255 ) ) dxDrawText ( text, x, y, x, y, tocolor ( 255, 255, 255, 255 ) ) end );
  7. Type /debugscript 3 in the chatbox and look for any errors/warnings.
  8. WhoAmI

    Marker script

    It's "cylinder" not "Cylinder".
  9. What's the problem?
  10. Show me your why how you cancel it.
  11. setTimer(function() local h, m = getTime() if h == 21 and m == 0 then -- tod end end, 1000, 1 )
  12. If onPlayerCommand event doesn't work, there isn't any solution, I guess.
  13. So do it. You have to read some GameQ libraries. There are some examples. You have to try yourself and don't cry on public forum, thanks.
  14. It's not HTML, it's PHP. HTML is used only for designing.
  15. Maybe replace it to random string? http://lua-users.org/wiki/RandomStrings
  16. Use @Walid code but change addEventHandler("OnVehicleEnter", createAc130) to this addEventHandler("onVehicleEnter", root, createAc130)
  17. local dosyfa = "$500" syfik = string.gsub ( dosyfa, "%$", "", 1 ) givePlayerMoney ( client, tonumber ( syfik ) ) Works 100%.
  18. Well, where do you insert it? Show me whole function. Items are saved into player's account or vehicle's data?
  19. What it outputs on chatbox?
  20. Something like that. I'm not good at handling.
  21. local dosyfa = "$500" syfik = string.len ( dosyfa, 1, #dosyfa ) outputChatBox ( syfik ) givePlayerMoney(client, tonumber(syfik))
×
×
  • Create New...