-
Posts
461 -
Joined
-
Last visited
Everything posted by Feche1320
-
Any mirror?
-
Thanks, the thePreviousAccount thing fixed it
-
I made this script: local p_Wins = {} local p_Deaths = {} local p_Joins = {} local p_MPlayed = {} addEventHandler("onPlayerLogin", g_Root, function(thePreviousAccount, theCurrentAccount, autoLogin) if theCurrentAccount then p_Wins[source] = tonumber(getAccountData(theCurrentAccount, "wins.stats")) p_Deaths[source] = tonumber(getAccountData(theCurrentAccount, "deaths.stats")) p_Joins[source] = tonumber(getAccountData(theCurrentAccount, "joins.stats")) p_MPlayed[source] = tonumber(getAccountData(theCurrentAccount, "mapsp.stats")) if not p_Joins[source] then p_Joins[source] = 1 else p_Joins[source] = p_Joins[source]+1 end outputChatBox("Your stats have been succesfully loaded, welcome back " ..getPlayerName(source).."!", source, 46, 154, 254) end end ) addEventHandler("onPlayerLogout", g_Root, function() local acc = getPlayerAccount(source) if acc then setAccountData(acc, "wins.stats", tostring(p_Wins[source])) setAccountData(acc, "deaths.stats", tostring(p_Deaths[source])) setAccountData(acc, "joins.stats", tostring(p_Joins[source])) setAccountData(acc, "mapsp.stats", tostring(p_MPlayed[source])) outputChatBox("Your stats have been succesfully saved.", source, 46, 154, 254) end end ) addEventHandler("onPlayerQuit", g_Root, function() local acc = getPlayerAccount(source) if acc then setAccountData(acc, "wins.stats", tostring(p_Wins[source])) setAccountData(acc, "deaths.stats", tostring(p_Deaths[source])) setAccountData(acc, "joins.stats", tostring(p_Joins[source])) setAccountData(acc, "mapsp.stats", tostring(p_MPlayed[source])) end end ) addEvent("onPostFinish") addEventHandler("onPostFinish", g_Root, function() for i, player in ipairs(getElementsByType('player')) do if getElementData(player, "State") == "alive" then if not p_Wins[source] then p_Wins[source] = 1 else p_Wins[source] = p_Wins[source]+1 end end end end ) addEventHandler("onPlayerWasted", g_Root, function() if not p_Deaths[source] then p_Deaths[source] = 1 else p_Deaths[source] = p_Deaths[source]+1 end end ) addEvent("onMapStarting") addEventHandler("onMapStarting", g_Root, function() for i, player in ipairs(getElementsByType('player')) do if not p_MPlayed[player] then p_MPlayed[player] = 1 else p_MPlayed[player] = p_MPlayed[player]+1 end end end ) addCommandHandler("stats", function(source) local acc = getPlayerAccount(source) if isGuestAccount(acc) then outputChatBox("You must be logged to view your stats.", source, 46, 154, 254) else outputChatBox(getPlayerName(source).." stats:") if not p_Wins[source] or p_Wins[source] < 5 then outputChatBox("Visits: " ..tostring(p_Joins[source]).. " Wins: " ..tostring(p_Wins[source]).. "(0.0%) Deaths: " ..tostring(p_Deaths[source]).. " Maps played: " ..tostring(p_MPlayed[source]), source, 46, 154, 254) else outputChatBox("Visits: " ..tostring(p_Joins[source]).. " Wins: " ..tostring(p_Wins[source]).. "("..tostring(p_Wins[source]/p_MPlayed[source]*100).."%) Deaths: " ..tostring(p_Deaths[source]).. " Maps played: " ..tostring(p_MPlayed[source]), source, 46, 154, 254) end outputChatBox("Cash: $"..getPlayerMoney(source), source, 46, 154, 254) end end ) But when I quit or log out and then log in again, the stats are 0 again, it doesn't get saved. Thanks
-
Is there any way to spectate a pedestrian made with createPed? Thanks
-
Ah, I get it now, thanks a lot!
-
A example please? Thanks
-
How can I create it? I have a function on a resource and use it on another resource, that's all ^^ Thanks.
-
Oh lol, thank you so much! Another little question, how can I delete a file but from a resource? I have a command in a resource that deletes player toptimes and a archive contaning the player ghost car, but the ghost car archive is in another resource, and if I use this: fileDelete("race_ghost/ghosts/" ..getMapName().. ".ghost") It will be like doing: fileDelete("race_toptimes/race_ghost/ghosts/" ..getMapName().. ".ghost") Anything else? Thanks EDIT: No no no no no,nevermind, I forgot to add : EDIT2: Ah, no, got an error: ERROR: race_toptimes\toptimes_server.lua:406: fileDelete failed; ModifyOtherObjects in ACL denied resource race_toptimes to access race_ghost
-
Yes, it is, but I found something wierd, it only works on this function (it's another script on different file): addEvent("onPlayerPickUpRacePickup", true) function onPlayerPickUpRacePickup(pickupID, pickupType, vehicleModel) if pickupType == "vehiclechange" and vehicleModel == 425 and g_GotHunter[source] == 0 then if string.find(g_MapInfo.name, "[DM]", 1, true) then outputChatBox('' ..getPlayerName(source).. ' got the hunter! (+$500)') givePlayerMoney(source, 500) g_GotHunter[source] = 1 toggleControl ( source, "vehicle_secondary_fire", false ) if gm == 0 then outputChatBox("#FF0000Disabling Ghostmode in 10 seconds...", getRootElement(), 255, 255, 255, true) setTimer(gmoff, 10000, 1) gm = 1 end end end end addEventHandler("onPlayerPickUpRacePickup", getRootElement(), onPlayerPickUpRacePickup) I also disabled that ussing '--[[ ]]--' and the other one still wasn't working, really wierd.
-
No, I'm not lazy at all, and I DID DOWNLOAD IT, the only difference is that I was looking for RACE_MAPRATINGS and not MAPRATINGS, as you noticed, the title says race_mapratings. Thanks and sorry.
-
Nope, I only used a Hunter pickup, and debugscript didn't give me any error.
-
I have this little code using it like a resource: addEvent("onPlayerPickupRacePickup", true) function test(pickupID, pickupType, vehicleModel) outputChatBox(pickupID.. " " ..pickupType.. " " ..vehicleModel) end addEventHandler("onPlayerPickupRacePickup", getRootElement(), test) But when I pick up a pickup, it doesn't get called. Thanks
-
So, I have a column in my scoreboard that must show the player ID, but if I do this: setElementData(source, "ID", source) It will show id as: 'userdata: 00'. So, I have no idea on how to retrieve the players id. Thanks.
-
Wow, thanks again, but I have a question. This line: local player, playerName = findPlayer(toblow) if player then Won't be player always 0 since you didn't add a value to it? Thanks
-
function blowPlayer(source, command, toblow) if not g_Admin[source] then outputChatBox("You don't have the permission for this.", source, 255, 0, 0) return else if toblow then if getPlayerFromName(toblow) then blowVehicle(getPedOccupiedVehicle(getPlayerFromName(toblow))) outputChatBox("#01DFD7" ..getPlayerName(toblow).. "has been blown up.", 0, 0, 0, true) end end end end addCommandHandler('bu', blowPlayer) But if my name is' #FFFFFFASD.', I have to type #FFFFFFASD. to blow him, and I need it to blow him by only putting ASD Thanks
-
Mhh.. nope, it's not there.
-
Were can I find this resource?? I don't have it on my server, and I could'nt find it on the community. Thanks
-
Wow thanks, never thought of that
-
Hello, I'm making a /flip command, but if he types nothing or just letters, it give me an error on debugscript, so I made this: if ammount == "nil" then outputChatBox("Usage: flip [amount]", source, 46, 154, 254) return end And: if tonumber(ammount) == "nil" then outputChatBox("Usage: flip [amount]", source, 46, 154, 254) return end But none of them work. Thanks
-
Oh lol, I coppied yours, and works!! Thanks!
-
Mhh.. but it doesn't, I have rankings like this: Ranking = 0
-
Okay, I have this: Ranking-- It should decrease the variable value, if that variable is 5, it should go to 4, but it gives me a warning, and the hole script doesn't load. This is what it says: '=' expected near '-' I also tried: Ranking = Ranking-1 But the same error.. Thanks
-
Hmm, I use this: function addRaceScoreboardColumns() exports.scoreboard:addScoreboardColumn('state') exports.scoreboard:addScoreboardColumn('money') end But doesn't add it.. EDIT: Ah no, nevermind, reading I figured out that I had to put 'export.dxscoreboard:..', another thing, how do I enable names colors? Thanks EDIT 2: Lol, nevermind again, just changed the meta.xml config.
-
I have that resource, but I don't know how to create a column, or update it with new data. Also, another thing, I have some DM maps, but some of them says 'no node in meta.xml', what it can be? Thanks
-
Yea works, thanks.