Author Topic: Suggest some bullshit... OH WAIT, SARP IS BULLSHIT LOL  (Read 426 times)

Takajyo48

  • Trial Staff
  • Starter
  • *
  • Posts: 23
  • Aitakatta
  • Location: Jakarta, Indonesia
    • View Profile
Suggest some bullshit... OH WAIT, SARP IS BULLSHIT LOL
« on: June 02, 2012, 07:48:39 pm »
Suggest some scripts here, that maybe we can add it to Server. please don't Copy it from other server.

Code: [Select]
[b]Account Name:[/b]
[b]Script Name:[/b]
[b]Description:[/b]

Share on Bluesky Share on Facebook


PSN✞

  • Starter
  • *
  • Posts: 7
  • Meet the king!!!!
    • View Profile
Account Name:psnarayanan
Script Name:Admin Chat
Description:This is the Admin chat,use /sarp {text} to talk with it.

Code: [Select]
function adminChat( thePlayer,_,... )
    local text = table.concat( {...}, " " )
    local name = getPlayerName( thePlayer )
    for _,v in pairs( getPlayersInGroup( accName ) ) do
        outputChatBox ("#FF0000(SARP) "..tostring( name )..": #FFFFFF"..tostring( text ), v, 255, 255, 255, true)
    end
end
addCommandHandler("SARP", adminChat)
   
function getPlayersInGroup( accName )
    local Table = { }
    for _,v in pairs( getElementsByType( "player" ) ) do
    local accName =  getAccountName ( getPlayerAccount ( v ) )
        if (isObjectInACLGroup ("user." .. accName, aclGetGroup("Admin")) ) then
                table.insert( Table,v )   
        end
    end
    return Table
end
« Last Edit: June 11, 2012, 02:36:50 pm by PSN✞ »
Military Forces Trial Member

michael

  • Guest
Account Name:psnarayanan
Script Name:Admin Chat
Description:This is the Admin chat,use /sarp {text} to talk with it.

Code: [Select]
function adminChat( thePlayer,_,... )
    local text = table.concat( {...}, " " )
    local name = getPlayerName( thePlayer )
    for _,v in pairs( getPlayersInGroup( accName ) ) do
        outputChatBox ("#FF0000(SARP) "..tostring( name )..": #FFFFFF"..tostring( text ), v, 255, 255, 255, true)
    end
end
addCommandHandler("cit", adminChat)
   
function getPlayersInGroup( accName )
    local Table = { }
    for _,v in pairs( getElementsByType( "player" ) ) do
    local accName =  getAccountName ( getPlayerAccount ( v ) )
        if (isObjectInACLGroup ("user." .. accName, aclGetGroup("Admin")) ) then
                table.insert( Table,v )   
        end
    end
    return Table
end
It's Correct but it's for CIT.

Ronald

  • Forum Management
  • Head Staff
  • New Poster
  • ******
  • Posts: 29
    • View Profile
Its copy.

Takajyo48

  • Trial Staff
  • Starter
  • *
  • Posts: 23
  • Aitakatta
  • Location: Jakarta, Indonesia
    • View Profile
We have Admin Chat on Admin Panel

michael

  • Guest
We have Admin Chat on Admin Panel
We Know that but it's take time to press P>Select Chat>& Write>Send...

Takajyo48

  • Trial Staff
  • Starter
  • *
  • Posts: 23
  • Aitakatta
  • Location: Jakarta, Indonesia
    • View Profile
We have Admin Chat on Admin Panel
We Know that but it's take time to press P>Select Chat>& Write>Send...
Loll, okay xD

pazimo

  • IRC Developer
  • Starter
  • *
  • Posts: 15
  • What ? The ? Chicken ?
  • Location: Optimus Galexy
    • View Profile
Dont use the P>Admin panel just create your own Admin panel gui because it be easier to add scripts like jail,event hosting in one GUI and it will be simpler !

300 296 Year (YYYY) - Month (MM) - Day (DD)

PSN✞

  • Starter
  • *
  • Posts: 7
  • Meet the king!!!!
    • View Profile
« Last Edit: June 11, 2012, 02:51:05 pm by PSN✞ »
Military Forces Trial Member

PSN✞

  • Starter
  • *
  • Posts: 7
  • Meet the king!!!!
    • View Profile
Vehicle health by PSN


Code: [Select]
----------------------------------------------------------------
-------------------- Digital Vehicle Health --------------------
-------------------- Scripted by PSN ----------------


function vehicleHealth()
    local vehicle = getPedOccupiedVehicle( localPlayer )
if ( vehicle ) then
local vehicleHealth = getElementHealth( vehicle )
local scx, scy = guiGetScreenSize()
if ( math.floor( vehicleHealth  / 10 ) ) > 70 then
-- If the vehicle health is higher then 70% the health is showed in a white color
dxDrawText( ( math.floor( vehicleHealth / 10 ) ) .. "% Health", scx - 125,scy - 70,scx,scx,tocolor(255,255,255,255),0.9, "bankgothic","right","top",false,false,false)
elseif ( math.floor( vehicleHealth / 10 ) ) > 40 and ( math.floor( vehicleHealth / 10 ) ) < 70 then
-- If the vehicle health is between 40% and 70% the health is showed in a orange color
dxDrawText( ( math.floor( vehicleHealth / 10 ) ) .. "% Health", scx - 125,scy - 70,scx,scx,tocolor(225,165,0,255),0.9, "bankgothic","right","top",false,false,false)
elseif ( math.floor( vehicleHealth / 10 ) ) < 40 then
-- If the vehicle health is lower then 40% the health is showed in a red color
dxDrawText( ( math.floor( vehicleHealth / 10 ) ) .. "% Health", scx - 125,scy - 70,scx,scx,tocolor(225,0,0,255),0.9, "bankgothic","right","top",false,false,false)
end
end
end
addEventHandler("onClientRender", root, vehicleHealth


Meta

Code: [Select]
<meta>
<info author="PSN" version="1.0" type="script" name="Vehicle Health" description="Vehicle Health" />

<script src="vehicleHealth.lua" type="client"/>
</meta>
Military Forces Trial Member

PSN✞

  • Starter
  • *
  • Posts: 7
  • Meet the king!!!!
    • View Profile
Anti AFK by PSN

Client side

Code: [Select]
--***********************************--
--***********************************--
--      Anti AFK System For War      --
--            By PSN            --
--            Client Side            --
--***********************************--
--***********************************--
-------------- CHANGEABLE
NumToCount = 20 -- the number to count before the player get killed / kicked
MSGtoShow = "You Are Afk" -- the Message to show
CountSpeed = 1500 -- less number will be faster.
-------------- UNCHANGEABLE
rRoot = getResourceRootElement(getThisResource()) -- Resource Root ,,
setElementData(getLocalPlayer(),"AFKtime",0) -- Rest AFK Times For Player
setElementData(localPlayer,"State-AFK",false)
--- DX ---
sw, sh = guiGetScreenSize() -- Get The Screen Size
x,y = sw/2,sh/2 -- Using Math to Set The Text in center

addEvent("YouAreAFK",true) -- AFK Message Event
addEventHandler("YouAreAFK",root, -- AFK Message Event Handler
function() -- AFK Message Function
function You() -- AFK Message Function

dxDrawText(  MSGtoShow, x-700,y-497,sw,sh,tocolor ( 0, 0, 0, 255 ), 4, "pricedown","center", "center", false, false, false)-- AFK Message Shaddow
dxDrawText( MSGtoShow, x-700,y-500,sw,sh,tocolor ( 255, 255, 0, 255 ), 4, "pricedown","center", "center", false, false, false)-- AFK Message

end -- END of AFK Message Function
addEventHandler ( "onClientRender",root,You) -- AFK Message Event Handler
Count() -- Kill Player Counting Trigger
end )

function Count()-- Counting
-- Count --
local n = NumToCount -- Count Number
local count = ""..n.."" -- Count Number
local x,y = sw/2,sh/2 -- Center Text

function txt()
dxDrawText(" You Will Be Killed After "..count.." Seconds", x-700,y-292,sw,sh,tocolor ( 0, 0, 0, 255 ), 1, "pricedown","center", "center", false, false, false) -- Counting DX
dxDrawText(" You Will Be Killed After "..count.." Seconds", x-700,y-295,sw,sh,tocolor ( 255, 0, 0, 255 ), 1, "pricedown","center", "center", false, false, false)-- Counting DX

dxDrawText(" Move To Cancel", x-700,y-241,sw,sh,tocolor ( 0, 0, 0, 255 ), 1, "pricedown","center", "center", false, false, false)-- Text DX
dxDrawText(" Move To Cancel", x-700,y-243,sw,sh,tocolor ( 255, 0, 0, 255 ), 1, "pricedown","center", "center", false, false, false)-- Text DX
end

addEventHandler ( "onClientRender" , root ,txt)-- Adding DX Event Handler

timer = setTimer ( -- Count
function()-- Count
n = n - 1 -- Count
count = ""..n.."" -- Count
playSoundFrontEnd ( 20 )-- Play Sound On Count
if n == 0 then -- on Count END
triggerServerEvent ("KillAFK", getLocalPlayer()) -- Triggers Killing Function
playSoundFrontEnd ( 101 ) -- Play SOund on Count END
removeEventHandler ( "onClientRender" , root ,txt) -- Remove DX Text's After Count END
removeEventHandler ( "onClientRender",root,You)-- Remove DX Text's After Count END
end
end
, CountSpeed , NumToCount ) -- End Of Count Timer

--- Count---
end

addEvent("YouAreNotAFK",true) -- Removing Message Event
addEventHandler("YouAreNotAFK",root,-- Removing Message Event
function()-- Removing Message Function
removeEventHandler ( "onClientRender",root,You)-- Removing Message 1
removeEventHandler ( "onClientRender" , root ,txt)-- Removing Message 2
if isTimer(timer) then
killTimer(timer)-- Killing The Timer
end
end ) -- END of Removing Message Event


Server side

Code: [Select]
--***********************************--
--***********************************--
--      Anti AFK System         --
--            By PSN            --
--            Server Side            --
--***********************************--
--***********************************--

----------- CHANGEABLE
AFK_TIME = 1 -- the time that if the player didn't moved he will be AFK , in minutes .
AFK_TIMES = 5 -- afk times before the player get kicked .
SHOW,AFK_MSG = true -- show the afk message [true or false
msgs = true -- show messages on chat box ?
-----------

function onResourceStart()
--
outputDebugString("Anti-AFK By Al3grab | Started")
--
startCheck()
end
addEventHandler("onResourceStart",resourceRoot,onResourceStart)

function startCheck()
checkTimer = setTimer ( function()
for i,m in ipairs ( getElementsByType("player") ) do
local idle = getPlayerIdleTime(m)
if tonumber(idle) >= AFK_TIME * 60 * 1000  then
if not isPlayerAfk(m) then
-- the player is afk
triggerEvent("onPlayerAfk",m,m,idle)
end
else
local afk = isPlayerAfk(m)
if ( afk == true ) then
-- the player was afk and now he is back !
triggerEvent("onPlayerAfkBack",m,m)
end
end
end
end , 1000 , 0 )
end

addEvent("onPlayerAfk",true)
addEventHandler("onPlayerAfk",root,function ( Player , Time )
------
if SHOW then
if ( tostring ( AFK_MSG ) ) then
showAfkMessage(Player,true)
end
end
------
setPlayerAfk(Player,true)
------

end )

addEvent("onPlayerAfkBack",true)
addEventHandler("onPlayerAfkBack",root,function ( Player  )
setPlayerAfk(source,false)
------
showAfkMessage(source,false)
------
end )


function isPlayerAfk(Player)
local afk = getElementData(Player,"State-AFK") or false
return afk
end

function setPlayerAfk(Player,state)
setElementData(Player,"State-AFK",state or false)
end

function showAfkMessage(Player,state)
if state == true then ev = "YouAreAFK" else ev = "YouAreNotAFK" end
triggerClientEvent(Player,tostring(ev) or "YouAreAFK",Player)
end

function onAfkEnd(Player)
Player = Player or source
--
setElementData(Player,"AFKtime",getElementData(Player,"AFKtime") + 1 )
local afkTimes = getElementData(Player,"AFKtime")
if ( afkTimes and afkTimes >= AFK_TIMES ) then
kickPlayer(Player,"You Have Been Afk For : "..tonumber(AFK_TIME).." Minutes")
if msgs then outputChatBox("** #FFFF00"..getPlayerName(Player).."#FFFF00 Has Been kicked for being afk ["..afkTimes.."]",root,255,0,0,true) end
else
killPed(Player)
if msgs then outputChatBox("** #FFFF00"..getPlayerName(Player).."#FFFF00 Has Been slapped for being afk ["..afkTimes.."]",root,255,0,0,true) end

end
end
addEvent("KillAFK",true)
addEventHandler("KillAFK",root,onAfkEnd)

Meta

Code: [Select]
<meta>
<info author="Al3grab" version="2.0" type="script" name="Anti Away From Keyboard" description="Anti Away From Keyboard" />
<script src="Server.lua" type="server" />
<script src="Client.lua" type="client" />
</meta>
Military Forces Trial Member

pazimo

  • IRC Developer
  • Starter
  • *
  • Posts: 15
  • What ? The ? Chicken ?
  • Location: Optimus Galexy
    • View Profile
Vehicle health by PSN


Code: [Select]
----------------------------------------------------------------
-------------------- Digital Vehicle Health --------------------
-------------------- Scripted by PSN ----------------


function vehicleHealth()
    local vehicle = getPedOccupiedVehicle( localPlayer )
if ( vehicle ) then
local vehicleHealth = getElementHealth( vehicle )
local scx, scy = guiGetScreenSize()
if ( math.floor( vehicleHealth  / 10 ) ) > 70 then
-- If the vehicle health is higher then 70% the health is showed in a white color
dxDrawText( ( math.floor( vehicleHealth / 10 ) ) .. "% Health", scx - 125,scy - 70,scx,scx,tocolor(255,255,255,255),0.9, "bankgothic","right","top",false,false,false)
elseif ( math.floor( vehicleHealth / 10 ) ) > 40 and ( math.floor( vehicleHealth / 10 ) ) < 70 then
-- If the vehicle health is between 40% and 70% the health is showed in a orange color
dxDrawText( ( math.floor( vehicleHealth / 10 ) ) .. "% Health", scx - 125,scy - 70,scx,scx,tocolor(225,165,0,255),0.9, "bankgothic","right","top",false,false,false)
elseif ( math.floor( vehicleHealth / 10 ) ) < 40 then
-- If the vehicle health is lower then 40% the health is showed in a red color
dxDrawText( ( math.floor( vehicleHealth / 10 ) ) .. "% Health", scx - 125,scy - 70,scx,scx,tocolor(225,0,0,255),0.9, "bankgothic","right","top",false,false,false)
end
end
end
addEventHandler("onClientRender", root, vehicleHealth


Meta

Code: [Select]
<meta>
<info author="PSN" version="1.0" type="script" name="Vehicle Health" description="Vehicle Health" />

<script src="vehicleHealth.lua" type="client"/>
</meta>
good one but to tell you something ! even i can copy scripts and change author name  ;)

300 296 Year (YYYY) - Month (MM) - Day (DD)

PSN✞

  • Starter
  • *
  • Posts: 7
  • Meet the king!!!!
    • View Profile
If you don't know how to script then stop saying mine is a copy.Its not a copy its made by myself fo my home server.
Military Forces Trial Member

Heineken

  • New Poster
  • **
  • Posts: 25
    • View Profile
If you don't know how to script then stop saying mine is a copy.Its not a copy its made by myself fo my home server.

Lolled, that vehicle health script isn't made by you.
Its just stolen from the MTA community and I know who realy made it :)

PSN✞

  • Starter
  • *
  • Posts: 7
  • Meet the king!!!!
    • View Profile
If you don't know how to script then stop saying mine is a copy.Its not a copy its made by myself fo my home server.

Lolled, that vehicle health script isn't made by you.
Its just stolen from the MTA community and I know who realy made it :)
Oh really but its made by me
Military Forces Trial Member