• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Party Script [plx help]

KacykOs

New Member
Joined
Aug 31, 2009
Messages
56
Reaction score
0
I need edit script. I want to add to login team party, other party to second team. Help me please. Sorry for my bad english;/
war.lua
Code:
-- config --
WAR_MAP_NAMES = {'Fibula', 'Edron', 'Thais'}
WAR_SPAWNS = {}
WAR_SPAWNS[1] = {{2,3},{4,5}} -- map 1
WAR_SPAWNS[2] = {{6,7},{8,9}} -- map 2
WAR_SPAWNS[3] = {{11,12},{13,14}} -- map 2
WAR_MAP_CYCLE = {{1,1},{2,1},{3,1}}
WAR_COLORS = {{98,94,64,94},{114,23,114,114}}
WAR_TEAM_NAMES = {'Team 1','Team 2'}
WAR_BROADCAST_INTERVAL_TOP5 = 213

WAR_START_LEVEL = 80
WAR_TEAMS = 1

WAR_POINTS_FOR_KILL = 3
WAR_POINTS_FOR_KILL_ASSIST = 1

--------------------------------------------------------
STORAGE_LAST_KILLER_GUID = 10100
STORAGE_LAST_KILLER_GUID_TIMES = 10101
STORAGE_LAST_KILLER_IP = 10200
STORAGE_LAST_KILLER_IP_TIMES = 10201
STORAGE_LAST_KILLER_ACCOUNT = 10300
STORAGE_LAST_KILLER_ACCOUNT_TIMES = 10301
STORAGE_POINTS = 11000
STORAGE_TEAM_ID = 12000
STORAGE_SKULL = 13000
STORAGE_DEPOT = 14000

login.lua
Code:
local anti_logout = createConditionObject(CONDITION_INFIGHT)
setConditionParam(anti_logout, CONDITION_PARAM_TICKS, 3000)

function onLogin(cid)
    if warInitialized == 0 then
        warInitialized = 1
        setPlayerStorageValue(cid, STORAGE_TEAM_ID, 1)
        setMap(1)
        cronWar()
    end
    if getPlayerStorageValue(cid, STORAGE_POINTS) == -1 then
        setPlayerStorageValue(cid, STORAGE_POINTS, 0)
    end
    if getPlayerStorageValue(cid, STORAGE_SKULL) > 0 then
        doCreatureSetSkullType(cid,getPlayerStorageValue(cid, STORAGE_SKULL))
    end
    --doAddCondition(cid, anti_logout)
    setPlayerStorageValue(cid, STORAGE_TEAM_ID, 0)
    setPlayerStorageValue(cid, STORAGE_DEPOT, 0)
    setTeam(cid)
    doTeleportThing(cid, getSpawn(cid), TRUE)
    registerCreatureEvent(cid, "PlayerDeath")
    registerCreatureEvent(cid, "PlayerThink")
    return TRUE
end

playerdeath.lua:
Code:
local fragConfig = {
    ip = getConfigInfo('fragLimitIP'),
    guid = getConfigInfo('fragLimitGUID'),
    account = getConfigInfo('fragLimitAccount')
}

function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
    local addFrag = true
    if isPlayer(lastHitKiller) == TRUE then
        -- anti MC, give frag ect.
        if getPlayerStorageValue(lastHitKiller, STORAGE_LAST_KILLER_GUID) ~= getPlayerGUID(cid) then
            setPlayerStorageValue(lastHitKiller, STORAGE_LAST_KILLER_GUID, getPlayerGUID(cid))
            setPlayerStorageValue(lastHitKiller, STORAGE_LAST_KILLER_GUID_TIMES, 0)
        else
            setPlayerStorageValue(lastHitKiller, STORAGE_LAST_KILLER_GUID_TIMES, getPlayerStorageValue(lastHitKiller, STORAGE_LAST_KILLER_GUID_TIMES)+1)
        end
        if getPlayerStorageValue(lastHitKiller, STORAGE_LAST_KILLER_IP) ~= getPlayerIp(cid) then
            setPlayerStorageValue(lastHitKiller, STORAGE_LAST_KILLER_IP, getPlayerIp(cid))
            setPlayerStorageValue(lastHitKiller, STORAGE_LAST_KILLER_IP_TIMES, 0)
        else
            setPlayerStorageValue(lastHitKiller, STORAGE_LAST_KILLER_IP_TIMES, getPlayerStorageValue(lastHitKiller, STORAGE_LAST_KILLER_IP_TIMES)+1)
        end
        if getPlayerStorageValue(lastHitKiller, STORAGE_LAST_KILLER_ACCOUNT) ~= getPlayerAccountId(cid) then
            setPlayerStorageValue(lastHitKiller, STORAGE_LAST_KILLER_ACCOUNT, getPlayerAccountId(cid))
            setPlayerStorageValue(lastHitKiller, STORAGE_LAST_KILLER_ACCOUNT_TIMES, 0)
        else
            setPlayerStorageValue(lastHitKiller, STORAGE_LAST_KILLER_ACCOUNT_TIMES, getPlayerStorageValue(lastHitKiller, STORAGE_LAST_KILLER_ACCOUNT_TIMES)+1)
        end
        if getPlayerIp(lastHitKiller) == getPlayerIp(cid) then
            doPlayerSendTextMessage(lastHitKiller, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed player with same IP as yours. You will not gain frag. Multi-client?")
            addFrag = false
        elseif getPlayerStorageValue(lastHitKiller, STORAGE_LAST_KILLER_GUID_TIMES) >= fragConfig.fragLimitGUID then
            doPlayerSendTextMessage(lastHitKiller, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed same player " .. getPlayerStorageValue(lastHitKiller, STORAGE_LAST_KILLER_GUID_TIMES) .. " times. You will not gain frag. Friend give you frags?")
            addFrag = false
        elseif getPlayerStorageValue(lastHitKiller, STORAGE_LAST_KILLER_IP_TIMES) >= fragConfig.fragLimitIP then
            doPlayerSendTextMessage(lastHitKiller, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed player with same IP " .. getPlayerStorageValue(lastHitKiller, STORAGE_LAST_KILLER_IP_TIMES) .. " times. You will not gain frag. Friend give you frags?")
            addFrag = false
        elseif getPlayerStorageValue(lastHitKiller, STORAGE_LAST_KILLER_ACCOUNT_TIMES) >= fragConfig.fragLimitAccount then
            doPlayerSendTextMessage(lastHitKiller, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed player with same account number " .. getPlayerStorageValue(lastHitKiller, STORAGE_LAST_KILLER_ACCOUNT_TIMES) .. " times. You will not gain frag. Friend give you frags?")
            addFrag = false
        end
        if addFrag then
            doPlayerAddSoul(lastHitKiller, 1)
            setPlayerStorageValue(lastHitKiller, STORAGE_POINTS, getPlayerStorageValue(lastHitKiller, STORAGE_POINTS)+WAR_POINTS_FOR_KILL)
            db.executeQuery("UPDATE `players` SET `frags` = `frags`+1 WHERE `id` = " ..getPlayerGUID(lastHitKiller) .. ";")
            if isPlayer(mostDamageKiller) == TRUE and lastHitKiller ~= mostDamageKiller then
                db.executeQuery("UPDATE `players` SET `supports` = `supports`+1 WHERE `id` = " ..getPlayerGUID(mostDamageKiller) .. ";")
                setPlayerStorageValue(mostDamageKiller, STORAGE_POINTS, getPlayerStorageValue(mostDamageKiller, STORAGE_POINTS)+WAR_POINTS_FOR_KILL_ASSIST)
            end
            if getPlayerStorageValue(cid, STORAGE_SKULL) <= 0 then
                if getPlayerSoul(lastHitKiller) >= 5 and getPlayerSoul(lastHitKiller) < 10 then
                    doCreatureSetSkullType(lastHitKiller,SKULL_WHITE)
                elseif getPlayerSoul(lastHitKiller) >= 10 and getPlayerSoul(lastHitKiller) < 15 then
                    doCreatureSetSkullType(lastHitKiller,SKULL_RED)
                elseif getPlayerSoul(lastHitKiller) >= 15 then
                    doCreatureSetSkullType(lastHitKiller,SKULL_YELLOW)
                elseif getPlayerSoul(lastHitKiller) >= 25 then
                    doCreatureSetSkullType(lastHitKiller,SKULL_GREEN)
                end
            end
            if getPlayerStorageValue(lastHitKiller, STORAGE_TEAM_ID) == 1 then
                setGlobalStorageValue(GLOBAL_STORAGE_TEAM_1_FRAGS,getGlobalStorageValue(GLOBAL_STORAGE_TEAM_1_FRAGS)+1)
            else
                setGlobalStorageValue(GLOBAL_STORAGE_TEAM_2_FRAGS,getGlobalStorageValue(GLOBAL_STORAGE_TEAM_2_FRAGS)+1)
            end
        end
    end
    db.executeQuery("UPDATE `players` SET `dies` = `dies`+1 WHERE `id` = " ..getPlayerGUID(cid) .. ";")
    setPlayerStorageValue(cid, STORAGE_TEAM_ID, 0)
    removeConditions(cid)
    setTeam(cid)
    doTeleportThing(cid, getSpawn(cid), TRUE)
    addEvent(doCreatureAddHealth, 10,cid, getCreatureMaxHealth(cid))
    addEvent(doCreatureAddMana, 10,cid, getCreatureMaxMana(cid))
    removeConditions(cid)
    return TRUE
end
 
Back
Top