-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
function XXX () outputChatBox( "You have successfully choosed".. tostring(getElementModel(source)), source) end addEventHandler ( "onPlayerSpawn", getRootElement(), XXX ) Put it as server side.
-
Diall95 is the same user as in SAUR server, maybe he's the real one.
-
Please, speak only English on this forum, use the "Spanish" section to speak in your language.
-
Hunter, that's because that's how event handlers work, onPlayerVehicleEnter has only 3 arguments, theVehicle, seat, jacked.
-
Not sure, but maybe remove tostring()?
-
local rElement = getRootElement() function respawnVehicles(player, cmd, seconds) if tonumber(seconds) then if not hasObjectPermissionTo(player, "function.banPlayer") then outputChatBox("This command is only executeable for administrators", player, 255, 0, 0, false) return end outputChatBox("** All unoccupied vehicles will be respawned in " .. seconds .. " seconds **", rElement, 220, 220, 0, false) setTimer(function (player) local vehicles = getElementsByType ( "vehicle" ) outputChatBox("** All unoccupied vehicles respawned **", rElement, 220, 220, 0, false) outputDebugString(getPlayerName(player) .. " respawned vehicles.") for k, vehicle in ipairs ( vehicles ) do if isEmpty( vehicle ) then respawnVehicle ( vehicle ) end end end, seconds * 1000, 1, player) else outputChatBox("Syntax: /respawn ", player, 220, 220, 0, false) end end addCommandHandler("respawn",respawnVehicles) function isEmpty( vehicle ) local passengers = getVehicleMaxPassengers( vehicle ) if type( passengers ) == 'number' then for seat = 0, passengers do if getVehicleOccupant( vehicle, seat ) then return false end end end return true end Works (tested).
-
First, you didn't script it, you downloaded it from the MTA community, is not cool to steal other's credits. Second, to change the position you must edit these variables: c_XOffset = 10 c_YOffset = 10
-
You're welcome.
-
Well, you must set all the other web resources to false then? "resource.admin" access="false">
-
In SAUR we only have some skin mods and some shaders, do you think that can cause this?
-
You're welcome.
-
That's the best way I know, is when the countdown starts (everyone has a vehicle for then).
-
addEvent("onRaceStateChanging",true) addEventHandler("onRaceStateChanging",root, function (new, old) if (new == "GridCountdown") then for i,v in pairs(getElementsByType("player")) do if isPedInVehicle(v) then local account = getPlayerAccount(v) if not account or isGuestAccount(account) then return end local color1 = getAccountData ( account, "color1" ) local color2 = getAccountData ( account, "color2" ) local color3 = getAccountData ( account, "color3" ) local color4 = getAccountData ( account, "color4" ) local color5 = getAccountData ( account, "color5" ) local color6 = getAccountData ( account, "color6" ) local playerVehicle = getPedOccupiedVehicle(v) setVehicleColor ( playerVehicle, color1, color2, color3, color4, color5, color6) end end end end) Try that.
-
You can save each upgrade in a different account data name.
-
getVehicleUpgrades returns a table, if I'm right, you can't save a table in account data.
-
Must be because getLocalPlayer() is only CLIENT SIDE and onPlayerWasted is a server side event. Oh and btw, the first argument of onPlayerWasted is the totalAmmo, the second is the killer.
-
Wrong, FatalTerror, 'source' is the player event of onPlayerLogin. addEventHandler("onPlayerLogin", getRootElement(), function() executeCommandHandler(source, "debugscript", 3) end)
-
You must create a new ACL name, example: "InRPC"> "general.http" access="true"> "resource.resourcebrowser" access="false"> "resource.webstats" access="false"> "resource.webmap" access="false"> "resource.webadmin" access="false"> "resource.scoreboard" access="false"> "resource.runcode" access="false"> "resource.resourcemanager" access="false"> "resource.mapmanager" access="false"> "resource.admin" access="false"> "resource.elementbrowser" access="false"> "resource.webpanel" access="true"> Webpanel in my case is a kind of dashboard that show's the player stats, and a web chat too, rename it to your resource. After this, added this line: "InRPC"> To the default ACL group.
-
You are using two arguments to who output the message. addEventHandler("onPlayerWasted", getRootElement(), function(ammo, killer, weapon, bodypart) if source then if (bodypart == 4) then outputChatBox("#Outch ! " ..getPlayerName(killer).. " has shot in your ass !", source, 255, 255, 0, true) elseif (bodypart == 9)then outputChatBox("#OWNED ! "..getPlayerName(killer).." has shot in your head !", source, 255, 255, 0, true) else outputChatBox(getPlayerName(killer).."# has kill you ! Now Kill him Noob-_-'", source, 255, 255, 0, true) end end end) addEventHandler("onPlayerWasted", getRootElement(), function(ammo, killer, weapon, bodypart) if killer then local stars = getPlayerWantedLevel(killer) setPlayerWantedLevel(killer, stars+1) outputChatBox("#You have kill " .. getPlayerName(source) .. ", now you have "..getPlayerWantedLevel(killer).." stars !", killer, 255, 255, 0, true) end end)
-
Sorry Charlie, but I agree with TAPL, that code is a mess, it just doesn't make any sense.
-
Of course, it only works after you login, when you logout it set's the isAdmin data to false.
-
What are you talking about? what has logout or login to do with this? the script cannot generate a error because of not being logged in...
