Jump to content

Karevan

Members
  • Posts

    7
  • Joined

  • Last visited

About Karevan

  • Birthday 12/02/1994

Details

  • Gang
    vMafia|
  • Location
    Spain

Karevan's Achievements

Newbie

Newbie (4/54)

0

Reputation

  1. Add blips manually by making a loop trough all players, you can use onClientRender
  2. your code works properly but only if the player changes his name from settings in MTA menu. But what players do is use /nick command. The problem is if I cancel the event on using nick command its impossible to change it from setting too Edit: Just changed onPlayerChangeNick to onPlayerCommand, works for both (command and in settings). Heres how the code looks like now, maybe someone wants it: local nickChangeRestriction = { } addEventHandler ( "onPlayerCommand", getRootElement(), function ( command ) if command ~= "nick" then return end if ( nickChangeRestriction [ source ] and isTimer ( nickChangeRestriction [ source ] ) ) then cancelEvent ( ) local a, b, c = getTimerDetails ( nickChangeRestriction [ source ] ) local waitTime = ( a / 1000 ) local waitTime = ( waitTime < 60 and tostring ( math.round ( waitTime ) ).." seconds" or tostring ( math.round ( ( waitTime / 60 ), 0, "ceil" ) ) .." minutes" ) outputChatBox ( "#FF9900*[PM][ANTI FLOOD] #FFFFFFYou have to wait #ABCDEF".. tostring ( waitTime ) .." #FFFFFFto change your nick again", source, 255, 0, 0, true ) return end nickChangeRestriction [ source ] = setTimer ( function ( thePlayer ) nickChangeRestriction [ thePlayer ] = false end ,300000, 1, source ) end ) function math.round ( number, decimals, method ) local decimals = ( decimals or 0 ) local factor = ( 10 ^ decimals ) if ( method == "ceil" or method == "floor" ) then return math [ method ] ( number * factor ) / factor else return tonumber ( ( "%.".. decimals .."f" ):format ( number ) ) end end Thanks Castillo!
  3. Hello everyone. I was trying to make my own nick change restriction script because people started to spam with it on my server. Well I wrote the next code, even if i tried many things, I always get the same error: on line 20 ( nickChangeRestriction[source] = true ) it says table index is nil. It must be an stupid error, but I cant find it. Thanks in advance. My code: local nickChangeRestriction = {} local timer = {} addEventHandler("onPlayerCommand",getRootElement(), function(command) if command == "nick" then if nickChangeRestriction[source] then cancelEvent() local a,b,c = getTimerDetails ( timer[source] ) local waitTime = a/1000 if waitTime < 60 then waitTime = tostring(math.round(waitTime)).." seconds" else waitTime = tostring(math.round(waitTime/60, 0, "ceil")).." minutes" end outputChatBox("#FF9900*[PM][ANTI FLOOD] #FFFFFFYou have to wait #ABCDEF"..tostring(waitTime).." #FFFFFFto change your nick again",source,255,0,0, true) return end --outputChatBox("GTFO",source,255,0,0,true) nickChangeRestriction[source] = true timer[source] = setTimer(function () nickChangeRestriction[source] = false end, 5000, 1) --end end end) function math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end
  4. Karevan

    MTA Paradise.

    You cant access externally to databases from 000webhost, you may consider looking for a paid host which allows you to do so
  5. Megaupload... =/ is there a chance someone could upload it on a new host (PHP files)
  6. im already running websites, using plesk on it. cant change OS = /
  7. Well, Ive been trying to set an MTA server on my 64 bit ubuntu server (which I can only access using SFTP and SSH) and had lots of problems with many libraries, specially with libstdc++.so.6 one, Well, I had to reinstall my server because while I tried to fix it, I fucked lots of things. I would really appreciate if you could tell me some things I should know, some steps to follow.... before making shit with it again. Thanks in advance.
×
×
  • Create New...