
BinSlayer1
Members-
Posts
491 -
Joined
-
Last visited
Everything posted by BinSlayer1
-
attempt to call global 'estaPertoActivaMines' (a nil value)
BinSlayer1 replied to DarkLink's topic in Scripting
i used a timer once and i called it before i defined the function and it worked -
attempt to call global 'estaPertoActivaMines' (a nil value)
BinSlayer1 replied to DarkLink's topic in Scripting
setTimer(estaPertoActivaMines(),1000,0) should be : setTimer(estaPertoActivaMines,1000,0) -
umm addEvent('onClientMapStarting', true) addEventHandler('onClientMapStarting', getRootElement(), function() for i,j in pairs(teamDraw) do destroyElement(j) end teamDraw = {} teamName = {} end )
-
function modifyKills(oldText, newText) teamDraw[oldText]:text( newText ) teamDraw[newText] = teamDraw[oldText] end addEvent ( "modifyKillsForTeam", true ) addEventHandler ( "modifyKillsForTeam", getRootElement(), modifyKills ) try this but you'll need the old text and the new text as arguments for the triggerServerEvent my experience with textlib is pretty limited maybe someone else can help more if this won't do it.
-
------------------SS for k,v in ipairs(gameTeams) do local teamName = v.name triggerClientEvent("onAddTeam", getRootElement(), teamName) end triggerClientEvent("showKillsForTeam", getRootElement()) ------------------CS local teamName = {} function addTeam(name) teamName[name] = name end addEvent ( "onAddTeam", true ) addEventHandler ( "onAddTeam", getRootElement(), addTeam ) local teamDraw = {} function showKills() local textBoost = 240 for k, team in pairs(teamName) do teamDraw[team] = dxText:create( team, 15, y, false, 'bankgothic', 0.50, 'left') teamDraw[team]:type('stroke', 1, 0, 0, 0, 255) textBoost = textBoost + 15 end end addEvent ( "showKillsForTeam", true ) addEventHandler ( "showKillsForTeam", getRootElement(), showKills ) I'm not sure what exactly you're trying to do, I think the code can be simplified a lot but here's how I think you should do it (based on your code)
-
I'm pretty sure that your SS isn't sending to CS a variable containing an object of textlib 'text' is obvious that is sent (from the FOR in SS) but just make a table of teamName = {} and use teamName[text] = dxText:create( text, 15, y, false, 'bankgothic', 0.50, 'left') this table will be global variable in CS (so remove it from function parameter) and call the same teamName[text] in modifyKills function
-
teamName shouldn't be a function paratemer for modifyKills or showKills .. teamName should be a global variable in your client script. and shouldn't this line: addEventHandler ( "modifyKillsForTeam", getRootElement(), showKills ) actually be addEventHandler ( "modifyKillsForTeam", getRootElement(), modifyKills ) ?
-
That's where the problem is. The command is not a message so you can't find it like that. I hope you understood from Aibo's example. Post again otherwise
-
onClientChatMessage won't return you a command why don't you use addCommandHandler() ?
-
it's outputChatBox("#00FF00Jonathan :".."#FFFFFFWho?", source ) --notice those dots, they're for concatenating strings. and 'source' to send it to that player for every message, do this: message = string.lower(message) this will make the message be gay even if it was previously gAy or Gay. So in your bad-words-list just use lowercase letters wordsTable = { } --add stuff here like wordsTable = { "gay" ,"fu" } then go through the table using ipairs like this: for i,v in ipairs(wordsTable) do in the for, "v" will be your swear word string (defined in the table, 1 at a time) I just answered some of your questions, you should take a look at the link above my post though.
-
setElementAlpha() --alpha setElementCollisionsEnabled() --gm setElementCollidableWith() --still gm, i suggest you use this one but every respawn, race will set the default values back on So your script should re-run everytime race tries to force its values. Test it out a lot and figure out a way
-
do you actually need to see the cursor for this to work? I mean, did you use showCursor(true) ?
-
i think you actually don't want it to go on fire if yes, then @ setElementHealth use "1000" instead of "100" any value less than 250 makes the car go on fire I tested this a while ago.
-
debug it so you see if getPlayerName(player) actually returns the name with hex code. it's possible that race is editing that function so hex codes are cut off for when they draw it. i do not know for sure, but debugging will point this out. EDIT: Yes, I was right. resources/race/_common.lua Lines 81-84 getPlayerName() is altered by race to remove the hex code from the string. Race creates _getPlayerName() which will have the hex code. What you need to do is use your code + you have to change getPlayerName with _getPlayerName in the dxDrawColorText
-
I see you're using dxDrawColorText Where is it defined? it's a custom function, you need to add it into the script. And when you use it, do not use dxDrawText too. Just 1 of these 2 functions. see this link too: viewtopic.php?f=91&t=30227&p=347694&hilit=dxDrawColorText#p347694
-
It's just the ipairs loop that can only start from 1. Looping through a table (traditionally, by only changing the iterator) doesn't count I believe
-
well.. doesn't the serverside function setTime() do that? https://wiki.multitheftauto.com/wiki/SetTime
-
well, for starters. It's mostly true admin rank isn't much of a motivation to start scripting for some random guy in the forum
-
Correction: BinSlayer's ideas! My post was first, then yours. So..
-
I am not sure because the description of the "attacker" argument is vague, but try it nevertheless: use this event: https://wiki.multitheftauto.com/wiki/OnClientPedDamage check if attacker is a vehicle and if attacker's vehicle model number is heli model (https://wiki.multitheftauto.com/wiki/Vehicle_IDs) If conditions are matched, cancelEvent() Again, I'm not sure if the event will trigger when a heli damages a player because the description is pretty vague but i think it's worth a try , maybe someone else has another idea tho
-
no need for client/server triggering use createMarker() to create it and afterwards use this function: https://wiki.multitheftauto.com/wiki/SetElementVisibleTo First, you have to use this function to set the marker invisible to everyone Afterwards, you will use this function to set it visible only to the admin (whom you will detect with https://wiki.multitheftauto.com/wiki/Has ... rmissionTo (everything serverside)
-
any progress on the program? >
-
make a table for the timer because more people could join at the same time
-
script looks good, are you sure your own dimension is set to "1" ?
-
My gawd, why is everyone being so mean to him? He's basically opened the opportunity for anyone who wants to help him develop his server.. He didn't say he demanded a script. He is asking us if we'd like to contribute.. No need to be so rude in my opinion..