-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
What do you mean? P.S: Maybe try to explain what are you trying to do?
-
Copy it again, I fixed a error.
-
local timers = {} addEventHandler("onResourceStart",resourceRoot, function() for i, player in ipairs(getElementsByType ( "player" )) do timers[player] = setTimer(expcalculate, 20000, 0, player) end end) addEventHandler("onPlayerJoin",root, function () timers[source] = setTimer(expcalculate, 20000, 0, source) end) addEventHandler("onPlayerQuit",root, function () if isTimer(timers[source]) then killTimer(timers[source]) end end) function expcalculate(player) if (not player and isTimer(timers[player])) then killTimer(timers[player]) timers[player] = nil end if (not getElementData(player, "EXP")) then setElementData(player, "EXP", 0) end setElementData(player, "EXP",tonumber(getElementData(player, "EXP"))+1) end
-
function enterVehicle ( theVehicle, seat, jacked) if ( policeVehicles[getElementModel ( theVehicle )] ) and (policeSkins[getElementModel ( source )] ) then setTimer(setElementData,5000,1,source, "MONEY",tonumber(getElementData(source, "MONEY"))+180) else removePedFromVehicle ( source ) -- force the player out of the vehicle outputChatBox ( "Tu ne gaisrininkas!", source ) -- end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), enterVehicle ) -- Not sure if it'll work.
-
What exactly doesn't work from the resource?
-
Isn't Qwerty's post what you're looking for? P.S: Don't double post.
-
Please don't double post. Do they spawn after 5 seconds or not? if not, maybe the script has an error.
-
-- server side: function toggleGodMode(thePlayer) local account = getPlayerAccount(thePlayer) if (not account or isGuestAccount(account)) then return end local accountName = getAccountName(account) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then if getElementData(thePlayer,"invincible") then setElementData(thePlayer,"invincible",false) outputChatBox("God Mode is now Disabled.",thePlayer,0,255,0) else setElementData(thePlayer,"invincible",true) outputChatBox("God Mode is now Enabled.",thePlayer,0,255,0) end end end addCommandHandler("godmode",toggleGodMode) -- client side: addEventHandler ( "onClientPlayerDamage",root, function () if getElementData(source,"invincible") then cancelEvent() end end) addEventHandler("onClientPlayerStealthKill",localPlayer, function (targetPlayer) if getElementData(targetPlayer,"invincible") then cancelEvent() end end)
-
Uhm, my bad, I always forget that it's 1010 .
-
I think this one: https://community.multitheftauto.com/index.php?p= ... ils&id=768 has rocket's protection.
-
I guess you want to count the players, if so, use this: local team = getTeamFromName("Aliens") local players = countPlayersInTeam(team) dxDrawText ( "Team:", 175, screenHeight - 98, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.02, "pricedown" ) dxDrawText ( "Team:".. tostring(players) .."", 175, screenHeight - 100, screenWidth, screenHeight, tocolor ( 255, 0, 0, 255 ), 1, "pricedown" )
-
addEventHandler("onPlayerJoin",root, function () bindKey(source,"1","down",nitro) end) addEventHandler("onResourceStart",resourceRoot, function () for index, player in ipairs(getElementsByType("player")) do bindKey(player,"1","down",nitro) end end) function nitro ( thePlayer ) if ( isPedInVehicle ( thePlayer ) ) then local id = 1010 local theVehicle = getPedOccupiedVehicle ( thePlayer ) local success = addVehicleUpgrade ( theVehicle, id ) if ( success ) then outputConsole ( getVehicleUpgradeSlotName ( id ) .. " dodane.", thePlayer ) else outputConsole ( "Nieudana próba dodania nitro.", thePlayer ) end else outputConsole ( "Musisz być w pojeździe !", thePlayer ) end end addCommandHandler ( "nitro", nitro )
-
setElementFrozen -- To froze the ped. I would set a element data to the ped, then check it onClientPedDamage and cancel it.
-
function weapondealer1() weapondealer1 = createPed ( 28, 1604.3000488281, -1721.0999755859, 6.3000001907349 ) setTimer(setPedAnimation, 1000, 1, weapondealer1, "DEALER", "DEALER_IDLE" ) end addEventHandler ("onResourceStart", resourceRoot, weapondealer1)
-
arezu, it's not possible to attach a weapon to a vehicle, but yes a vehicle. P.S: The RC doesn't has as much firepower as the minigun, does it?
-
You can attach the object of the minigun, but you can't make it shoot like a real weapon.
-
function myCommand (thePlayer, commandName, arg1, arg2) -- We add a function with two arguments: arg1, arg2. outputChatBox("Argument 1 text: ".. tostring(arg1), thePlayer) -- We output the first argument text. outputChatBox("Argument 2 text: ".. tostring(arg2), thePlayer) -- We output the second argument text. end -- We end the function. addCommandHandler("test",myCommand) -- We add the command handler "test" attached to "myCommand" function. Then you do like this: /test hello world and it should output "hello", "world".
-
setElementData -- To set the vehicle owner. getElementData -- To get the vehicle owner. getPlayerAccount -- To get the player who tries to enter account. getAccountName -- To get the account name. onVehicleStartEnter -- The event. I may have missed something.
-
This is the syntax of outputMessage: outputMessage ( message, visibleTo, r, g, b, font )
-
In the killmessages resource you can specify the font.
-
Is not about that, that's just the library that manages the texts, what you must change is on the "killmessages" script.
-
The white color problem isn't caused by that warning in the script. function deleteAllPlayerBlips(player) if (not player) then return end local elements = getAttachedElements(player) if (elements) then for i, element in ipairs(elements) do if (element and getElementType(element) == "blip") then destroyElement(element) end end end end
-
You can change the font with dxText:font.
-
Te envie un PM Seba, espero tu respuesta.
