GuyFromPast Posted September 27, 2010 Share Posted September 27, 2010 (edited) ***problem solved *** Edited September 29, 2010 by Guest Link to comment
dzek (varez) Posted September 27, 2010 Share Posted September 27, 2010 just make outputChatBox to be visible for player that fixed vehicle, not for everybody!! Link to comment
GuyFromPast Posted September 27, 2010 Author Share Posted September 27, 2010 No can't do it... dont ask why Q_Q and also i think anti-command-flood script is very nessesary.. not only for me Link to comment
dzek (varez) Posted September 27, 2010 Share Posted September 27, 2010 tell me why - im very curious.. its very easy top make one.. just save variable (new one for every player) that saves the time of last use of command, and on use check the current time and compare - if its > 6 sec or not.. Link to comment
GuyFromPast Posted September 27, 2010 Author Share Posted September 27, 2010 tell me why - im very curious..its very easy top make one.. just save variable (new one for every player) that saves the time of last use of command, and on use check the current time and compare - if its > 6 sec or not.. u can avoid hackers if server say who used that command and who din't(its for cash) but can u explain more about "variable" ? im newbie as u know and don't understand smart talk YET Link to comment
dzek (varez) Posted September 27, 2010 Share Posted September 27, 2010 hackers? cash? cash cant be hacked in mta omg.. next one.. how can you script when you dont know what variable is... this_is_variable = "this is its value" Link to comment
Castillo Posted September 27, 2010 Share Posted September 27, 2010 maybe make 2 new functions? lock, unlock? local lock = 0 function lock() lock = 1 end function unlock() lock = 0 end when execute your function add, setTimer ( lock, 50, 1 ) setTimer ( unlock, 6000, 1 ) and also check if time its 1 if lock == 1 then outputChatBox("ERROR: You can fix once every 6 seconds.",255,0,0) and that should work? Link to comment
dzek (varez) Posted September 27, 2010 Share Posted September 27, 2010 why creating function only to set one variable o_O. also that 50ms lock is .. weird lock = 1 setTimer(function() lock = 0 end, 6000, 1) but this is server side script so lock will lock for all players, if you want it to work for each player independed you have to define lock table at beginning of script: lock = { } and use later something like lock[source]=1 etc etc but if you dont know the basics - dont try to understand me - because you wont... Link to comment
Castillo Posted September 27, 2010 Share Posted September 27, 2010 why creating function only to set one variable o_O. also that 50ms lock is .. weird lock = 1 setTimer(function() lock = 0 end, 6000, 1) but this is server side script so lock will lock for all players, if you want it to work for each player independed you have to define lock table at beginning of script: lock = { } and use later something like lock[source]=1 etc etc but if you dont know the basics - dont try to understand me - because you wont... he can make it client side like i did one time Link to comment
dzek (varez) Posted September 27, 2010 Share Posted September 27, 2010 as you can see- he needs to output text to all players - teaching him to trigger custom server event from client will be much harder than global table Link to comment
GuyFromPast Posted September 28, 2010 Author Share Posted September 28, 2010 function lock() if lock == {1} then cancelEvent() end end or function lock() if lock == {1} then n = false end end something like this ? oO Link to comment
Castillo Posted September 28, 2010 Share Posted September 28, 2010 function lock() if lock == {1} then cancelEvent() end end something like this ? oO lol i don't even... what is that? Link to comment
GuyFromPast Posted September 28, 2010 Author Share Posted September 28, 2010 should be script that disable command ? damn wiki dont give me anything useful about "variable" Link to comment
dzek (varez) Posted September 28, 2010 Share Posted September 28, 2010 variable.. how can you script when you dont know what variable is (i think im saying this for 3rd time since 2 days, wtf?)? this is very basic, and you shouldnt try writing a function/whatever without this knowledge.. it's like you want to drive car, you already sitting in car, even start engine, but you dont know even that vehicle have pedals omg.. okay, i won't read/reply anymore in yours and Fabios topics - this doesnt have any sense.. you can ask million of questions, but nobody can help you if you sit down for a while and start to think ;/ Link to comment
GuyFromPast Posted September 28, 2010 Author Share Posted September 28, 2010 if u don't ready my topics anymore then how u know when i start to think ? huh, cheff left me Link to comment
dzek (varez) Posted September 28, 2010 Share Posted September 28, 2010 i will from time to time. im not the only one that know lua, im just tired for now .. trying.. Link to comment
GuyFromPast Posted September 28, 2010 Author Share Posted September 28, 2010 yeah i understand ur not robot ur not only one who know lua but ur only one who is trying to help other people Link to comment
dzek (varez) Posted September 28, 2010 Share Posted September 28, 2010 afaik 50p is busy recently, and im spending most of my day i front of pc since some time (im working btw ), what about others - i dunno, sometimes i see others trying to help, but much topics are already replied Link to comment
Castillo Posted September 28, 2010 Share Posted September 28, 2010 afaik 50p is busy recently, and im spending most of my day i front of pc since some time (im working btw ), what about others - i dunno, sometimes i see others trying to help, but much topics are already replied Tell me what is exactly i think i can help Link to comment
50p Posted September 28, 2010 Share Posted September 28, 2010 If you want to disable command, you have to modify its handler. There will be no script to stop commands because there is no function to "cancel" command.. but before you start editing the command you should gain some general knowledge about Lua itself. Link to comment
GuyFromPast Posted September 28, 2010 Author Share Posted September 28, 2010 modify handler ? so u wanna just say its impossible to make this script if ur not lua pro right -.- so many players have to continue playing with command flooders.. i guess every server owner checked this topic ok seems like i got my answers Link to comment
50p Posted September 28, 2010 Share Posted September 28, 2010 All I'm saying is you need to modify the resource that has this command because you can't make separate resource that will stop the command from working. Link to comment
dzek (varez) Posted September 28, 2010 Share Posted September 28, 2010 dont get annoyed - because this won't help you. you dont have to be pro, you need to have general idea bout scripting.. handler is that function that is being fired when you input the command - so in other words - you need to modify that function you have made. Link to comment
GuyFromPast Posted September 28, 2010 Author Share Posted September 28, 2010 yeah i understood it but maybe more tips ? like add timers or so ? Link to comment
50p Posted September 28, 2010 Share Posted September 28, 2010 You've had tips on the first page; telling you to use table and timers to (un)lock the command.. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now