-
Posts
1,058 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Saml1er
-
Suppose you have 2 resources named R1 and R2. R1 contains a script that spawns a player when he dies and R2 has the same script so the player is being spawned by 2 resources when he dies, thats what he meant.
-
i dont understand what str = "a,b,c" does. Its just an example. Suppose ab is a string and has commas so we need to split the values from the string so we'll use split function. local ab = "x * 0.3, y +1,x*y + 5, z - 12" local vals = string.split(str,",") for i,v in ipairs(vals) do outputChatBox(v) end Test it and you'll see.
-
If source is the player then it should work but there's nothing bad with trying.
-
Try removing quotation marks with this: function escapeCSV (s) if string.find(s, '[,"]') then s = string.gsub(s, '"', '""') end return s end I still doubt this will work but anyway if this doesn't work then you can use galladros code.
-
Just like SN said, this is how it looks like: dxDrawRectangle (" 1.0.14191175997257 * x, 0.15364582836628 * y,( 0.37794119119644 * x ) - ( 0.14191175997257 * x ), ( 0.62109375 * y - 0.15364582836628 * y ), -1275068416" ) Do you really think this will work with quotation marks ?
-
Its just a string. I use loadString for loading map scripts. I insert functions into tables and I didn't touch chatbox functions since its a string and loadString just executes it and its not saved in memory or something. <-- This is how much I know. btw if you have event handlers in the string then you'll need to insert it into tables and after that you'll need to use removeEventHandler same goes for timers. This might be helpful.
-
The code is still incorrect. ------------------------------------------------ function checkMoney() local money = getPlayerMoney(thePlayer) outputChatBox("You have $"..money,player) end addCommandHandler("money",checkMoney) ------------------------------------------------- Should be function checkMoney() local money = getPlayerMoney(thePlayer) outputChatBox("You have $"..money,thePlayer) end addCommandHandler("money",checkMoney)
-
But he isn't using onClientWeaponFire but onClientPlayerWeaponFire. It can be both, source and localPlayer. sorry, my bad.
-
The source of onClientWeaponFire is the weapon not the player element. A small typo. addEventHandler("onClientPlayerWeaponFire",localPlayer,function() triggerServerEvent("playerFire",localPlayer) end)
-
I was just scrolling and found a few typos luckily at line 154. function (button, state) if button == "left" and state == "up" then -- replace up with "down" if it doesn't work Same thing at line 144 and 77.
-
This is a leaked script. Please remove the code as soon as possible.
-
Do you really think that you'll get me offended with that? But first of all just take a look at what you said just now. It was really disrespectful. You're showing how cheap you are. Let me ask you a question "Do you have parents?". I don't insult anyone especially their parents because I've my own parents and I love them. I doubt if you love your parents and you don't know how others will feel about you when you talk completely rubbish and your posts have no logic at all. I'm ashamed of my self because I'm lecturing a deaf guy. I don't like to argue with people who have no self respect, you'll always face humility in life if you keep being such an irritating person. I'm out.
-
I did a type there at line 30. Just replace line 30 with this if theTarget ~= nil and isObjectInACLGroup ("user."..accN,aclGetGroup (groupName) ) then -- missing bracket
-
Replace this with line 18. setTimer(allowShooting, 10000, 1) 1000 milliseconds = 1 seconds 3000 milliseconds = 3 seconds 10000 milliseconds = 10 seconds
-
If someone is ready to apologize then I've nothing against him anymore. I apologize for getting little bit harsh there. Use: function getPlayerFromNamePart(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end function warnPlayer_CMD(thePlayer, theCMD, theTarget, ...) local accN = getAccountName ( getPlayerAccount (thePlayer) ) local groupName = "Admin" or "Moderator" or "SuperModerator" -- you can add more if groupName then if theTarget ~= nil and isObjectInACLGroup ("user."..accN,aclGetGroup (groupName) then local theTargetElement = getPlayerFromNamePart(theTarget) if(getElementType(theTargetElement) == "player") then local allArgs = {...} local theReason = table.concat(allArgs, " ") outputChatBox("[WARN]: "..getPlayerName(thePlayer).."#FF0000 has warned "..getPlayerName(theTargetElement).."#FF0000!", getRootElement(), 255, 0, 0, true) outputChatBox("[WARN]: Reason: #FF2626("..tostring(theReason)..")", getRootElement(), 255, 0, 0, true) else outputChatBox("[WARN]: Invalid target! Syntax: /warn [Player] [Reason]", thePlayer, 255, 0, 0, true) end end end end addCommandHandler("warn", warnPlayer_CMD, false)
-
Learn to respect others, I was going to help you but my opinions changed. I didn't start anything which I should stop but you don't know how to respect others. Saying things like "Fix it for me", this shows that you are commanding us and I'm not a kind of person who would say "OK boss, I fixed it. No problem".
-
Then why did you post the conversation? Not only me but anyone will call this "show off" and since there can't be any other reason for posting this but proving yourself good which is really unwise and I'm not in your son, calling me your son means that you have sexual relationship with my mother which is intolerant from me and don't ever say that again.
-
Nobody has the right to judge anyone ( except god if you believe in him ). I find this kinda crazy from your side. You helped someone because we'll say that you're a nice person? Oh c'mon, there are a thousand of scripters who help others for free. You're the first person I've seen in my life who is saying " I helped someone, now judge me". I mean dude seriously nobody cares what you do.
-
Learn to say the magic word "please". Such an attitude ain't kewl, you know?
-
AddScoreBoardColumn is a server side function. I really forgot that.
-
The reason, I choose client side is because if you loop through all players every 2.5 seconds then you're server might lagg like hell but for client side I think it should be okay. Not sure but I think you need to replace this line with this: exports [ "scoreboard" ]:addScoreboardColumn ( "Occupation" )
-
Are you sure that you modified your meta.xml ? anyways try this: exports [ "scoreboard" ]:addScoreboardColumn ( "Occupation", 2 ) function thatit() -- just removed and "if" statement local sourceTeam = getTeamName ( getPlayerTeam(localPlayer) ) if ( sourceTeam == "Police" ) then setElementData ( localPlayer, "Occupation", "Officer" ) elseif ( sourceTeam == "Staff" ) then setElementData ( localPlayer, "Occupation", "Staff" ) else setElementData ( localPlayer, "Occupation", "Civillian" ) end end setTimer ( thatit, 2500, 0 )
-
exports [ "scoreboard" ]:addScoreboardColumn ( "Occupation", 2 ) function thatit() local sourceTeam = getTeamName ( getPlayerTeam(localPlayer) ) if sourceTeam then if ( sourceTeam == "Police" ) then setElementData ( localPlayer, "Occupation", "Officer" ) elseif ( sourceTeam == "Staff" ) then setElementData ( localPlayer, "Occupation", "Staff" ) else setElementData ( localPlayer, "Occupation", "Civillian" ) end end end setTimer ( thatit, 2500, 0 ) This is a client side script now.