Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ########################################################
- -- ##### Name: Adriano Swatt' #####
- -- ##### Version: 1.0 #####
- -- ########################################################
- -- ##### Developed by Adriano Swatt' #####
- -- ##### Contact: [email protected] #####
- -- ##### PRIVATE WAR SYSTEM BY SWATT' #####
- -- ########################################################
- local cfg = _PRIVATE_WAR_SYSTEM_CONFIG
- function onUse(cid, item, frompos, item2, topos)
- if getGlobalStorageValue(cfg.gbet_sto) > 0 then
- local string = tostring(getGlobalStorageValue(cfg.glead_sto))
- local cutSto = string:explode(";")
- doPlayerSendTextMessage(cid, 18, "O evento já está em progresso. \n[Blue Team Leader: "..cutSto[1].." ("..getGlobalStorageValue(cfg.teamConfig[1].gsto_kills).." Points) Vs. Red Team Leader: "..cutSto[2].." ("..getGlobalStorageValue(cfg.teamConfig[2].gsto_kills).." Points)].")
- return true
- end
- bet = checkPrivWarBet(cid)
- if bet then -- Checa Apostas
- teamID = getPrivWarTeam(cid)
- if item.itemid ~= cfg.teamConfig[teamID].lever.on then -- Checa Alavanca NÃO Puxada
- if checkPrivWarTeams(cid) then -- Checa Numero de Players nos Times
- if getAlreadyLeverPrivWar(cid, teamID) then -- Checa 1ª Alavanca Puxada
- doPrivWarStart(cid, bet, teamID)
- doTransformItem(item.uid, cfg.teamConfig[teamID].lever.on)
- else
- doChanceLeverPrivWar(cid, item.uid, teamID)
- end
- else
- doPlayerSendCancel(cid, "Cada time precisa ter o mesmo tanto de participantes e mais de "..cfg.minPlayers.." em cada.")
- end
- else
- doPlayerSendCancel(cid, "Esta alavanca já foi puxada, aguarde o oponente puxar a dele.")
- end
- else
- doPlayerSendCancel(cid, "O valor da aposta precisa ser igual e maior do que 0 crystal coin.")
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment