Jump to content

Flood in server / helps


Gallagher

Recommended Posts

Hello all right?

I have a problem, I made a simple script to give information to the players on my server vip.

More players are flooding the server with the /vip command.

how do I fix this?

how can i put a timer so that the command can be executed only after 1 minute? Or only once per spawn?

thanks for attention!

function v1p ( source ) 
outputChatBox ( "Want to be VIP? add skype Load31", source, 0, 250, 150, false, false ) 
outputChatBox ( "VIPs can not abuse their extra skills", source, 0, 250, 150, false, false ) 
    playSoundFrontEnd ( source, 5 ) 
    end 
     addCommandHandler("vip", v1p) 

Link to comment

so is right?

function v1p ( source ) 
outputChatBox ( "Want to be VIP? add skype Load31", source, 0, 250, 150, false, false ) 
outputChatBox ( "VIPs can not abuse their extra skills", source, 0, 250, 150, false, false ) 
    playSoundFrontEnd ( source, 5 ) 
SetTimer  (  "DestroyElement" , 10000, 1, v1p )  
    end 
     addCommandHandler("vip", v1p) 

Link to comment

This should do the trick:

function v1p ( source ) 
    outputChatBox ( "Want to be VIP? add skype Load31", source, 0, 250, 150, false, false) 
    outputChatBox ( "VIPs can not abuse their extra skills", source, 0, 250, 150, false, false) 
    playSoundFrontEnd ( source, 5 ) 
    removeCommandHandler("vip", v1p) 
    setTimer(addCommandHandler, 10000, 1, "vip", v1p) 
end 
addCommandHandler("vip", v1p) 

Link to comment
vTimer = {} 
  
addCommandHandler("vip", 
function(player) 
    if not isTimer(vTimer[player]) then 
        vTimer[player] = setTimer(function(player) vTimer[player] = nil end, 60000, 1, player) 
        outputChatBox("Want to be VIP? add skype Load31", player, 0, 250, 150, false) 
        outputChatBox("VIPs can not abuse their extra skills", player, 0, 250, 150, false) 
        playSoundFrontEnd(player, 5) 
    end 
end) 

Link to comment
vTimer = {} 
  
addCommandHandler("vip", 
function(player) 
    if not isTimer(vTimer[player]) then 
        vTimer[player] = setTimer(function(player) vTimer[player] = nil end, 60000, 1, player) 
        outputChatBox("Want to be VIP? add skype Load31", player, 0, 250, 150, false) 
        outputChatBox("VIPs can not abuse their extra skills", player, 0, 250, 150, false) 
        playSoundFrontEnd(player, 5) 
    end 
end) 

Thanks :)

Link to comment
This should do the trick:
function v1p ( source ) 
    outputChatBox ( "Want to be VIP? add skype Load31", source, 0, 250, 150, false, false) 
    outputChatBox ( "VIPs can not abuse their extra skills", source, 0, 250, 150, false, false) 
    playSoundFrontEnd ( source, 5 ) 
    removeCommandHandler("vip", v1p) 
    setTimer(addCommandHandler, 10000, 1, "vip", v1p) 
end 
addCommandHandler("vip", v1p) 

the command is disabled, but after 10 seconds the command is not enabled!

anyway thanks for listening!

Link to comment
This should do the trick:
function v1p ( source ) 
    outputChatBox ( "Want to be VIP? add skype Load31", source, 0, 250, 150, false, false) 
    outputChatBox ( "VIPs can not abuse their extra skills", source, 0, 250, 150, false, false) 
    playSoundFrontEnd ( source, 5 ) 
    removeCommandHandler("vip", v1p) 
    setTimer(addCommandHandler, 10000, 1, "vip", v1p) 
end 
addCommandHandler("vip", v1p) 

the command is disabled, but after 10 seconds the command is not enabled!

anyway thanks for listening!

Link to comment
vTimer = {} 
  
addCommandHandler("vip", 
function(player) 
    if not isTimer(vTimer[player]) then 
        vTimer[player] = setTimer(function(player) vTimer[player] = nil end, 60000, 1, player) 
        outputChatBox("Want to be VIP? add skype Load31", player, 0, 250, 150, false) 
        outputChatBox("VIPs can not abuse their extra skills", player, 0, 250, 150, false) 
        playSoundFrontEnd(player, 5) 
    end 
end) 

Thanks :)

You're welcome.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...