Logout

StrikersBR12
em Scripts

StrikersBR12

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 25/08/17Posts: 153Gênero: Masculino

Gostaria de um script pra não poder deslogar enquanto estiver em uma bike

 

bike.lua

Spoiler

local t = {text='Mount, bike!', dtext='Demount, bike!', s=5700, speed = 9999}
local bikeid = 12774 -- ITEMID da Bike

local function BikeSpeedOn(cid, t)                  
    setPlayerStorageValue(cid, t.s, t.speed)
    doChangeSpeed(cid, -getCreatureSpeed(cid))
    doChangeSpeed(cid, t.speed)
end
 
local function BikeSpeedOff(cid, t)
    setPlayerStorageValue(cid, t.s, -1)
    doRegainSpeed(cid)
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
    local pos = getThingPos(cid)
    if getPlayerItemCount(cid, 12774) <= 0 then
        return doPlayerSendCancel(cid, "Você precisa ter a bike na sua bag.")
    end
 
    if getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 or
        getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 75846) >= 1 or
        getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then
       return doPlayerSendCancel(cid, "You can't do that right now.")
    end
 
    if getPlayerStorageValue(cid, t.s) <= 0 then
        if item.actionid ~= 12120 then
            doRemoveItem(item.uid, 1)
            local create_action = doPlayerAddItem(cid, bikeid, 1)
            doItemSetAttribute(create_action, "aid", 12120)

            doSendMagicEffect(pos, 177)
            doCreatureSay(cid, t.text, 19)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have mounted in a bike.')
            BikeSpeedOn(cid, t)
            if getPlayerSex(cid) == 1 then
                doSetCreatureOutfit(cid, {lookType = 2518}, -1)
            else
                doSetCreatureOutfit(cid, {lookType = 2517}, -1)
            end
        else
            doPlayerSendCancel(cid, "This bike is in use.")
        end
    else
        if item.actionid == 12120 and getCreatureOutfit(cid).lookType == 2518 or getCreatureOutfit(cid).lookType == 2517 then
            doRemoveItem(item.uid, 1)
            doPlayerAddItem(cid, bikeid, 1)        
            doSendMagicEffect(pos, 177)
            doCreatureSay(cid, t.dtext, 19)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You haven demouted of a bike.')
            BikeSpeedOff(cid, t)
            doRemoveCondition(cid, CONDITION_OUTFIT)
        else

        end
    end
    
return true
end

Marshmello

Alone ~ [✖‿✖]
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 21/04/16Posts: 831Gênero: Masculino

@StrikersBR12 Em creatureScript crie um arquivo chamado blockl.lua e cole isso dentro

 

 

Spoiler

function onLogout(cid)
    if getPlayerStorageValue(cid, 5700) > 0 then
        doPlayerSendTextMessage(cid, 25, "Você não pode deslogar montado em uma bike)
    return false
    end
    return true
end

 

 

depois vá em creatureScript.xml e cole

Spoiler

<event type="logout" name="BlockL" event="script" value="blockl.lua"/>

 

placa1.png.90a184502351cebe72cd7b69751e551d.png

Meu Facebook

INFOS:

Citar

CIDADE: Rio de janeiro

Idade: 22 anos
SOU: {"Scripter(lua)", "WebMaster", "ProgramadorC++"}
 

local config = {
	delrey = getPlayerCarValue(cid, DELREY),
	cigarro = getPlayerCancer(cid, DERBY),
	prostituta = getPlayerAIDS(cid, cracuda),
	tresOitao = getPlayerRevorvi(cid, 38)
}
if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
end

 

 

 

StrikersBR12

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 25/08/17Posts: 153Gênero: Masculino
3 horas atrás, Marshmello disse:

@StrikersBR12 Em creatureScript crie um arquivo chamado blockl.lua e cole isso dentro

 

 

  Ocultar conteúdo

function onLogout(cid)
    if getPlayerStorageValue(cid, 5700) > 1 then
        doPlayerSendTextMessage(cid, 25, "Você não pode deslogar montado em uma bike)
    return false
    end
    return true
end

 

 

depois vá em creatureScript.xml e cole

  Ocultar conteúdo

<event type="logout" name="BlockL" event="script" value="blockl.lua"/>

 

ainda consigo deslogar e fica assim quando deslogo na bike http://prntscr.com/p6nztt

 

você teria algum script de bike sem bug que não possa tacar a bike no chão pra geral usar a msm bike ou então caso uma pessoa esteja usando uma certa bike a outra não use

 

@Marshmello

Ayron5

avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 26/08/15Posts: 239
10 horas atrás, StrikersBR12 disse:

Gostaria de um script pra não poder deslogar enquanto estiver em uma bike

 

bike.lua

  Mostrar conteúdo oculto

local t = {text='Mount, bike!', dtext='Demount, bike!', s=5700, speed = 9999}
local bikeid = 12774 -- ITEMID da Bike

local function BikeSpeedOn(cid, t)                  
    setPlayerStorageValue(cid, t.s, t.speed)
    doChangeSpeed(cid, -getCreatureSpeed(cid))
    doChangeSpeed(cid, t.speed)
end
 
local function BikeSpeedOff(cid, t)
    setPlayerStorageValue(cid, t.s, -1)
    doRegainSpeed(cid)
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
    local pos = getThingPos(cid)
    if getPlayerItemCount(cid, 12774) <= 0 then
        return doPlayerSendCancel(cid, "Você precisa ter a bike na sua bag.")
    end
 
    if getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 or
        getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 75846) >= 1 or
        getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then
       return doPlayerSendCancel(cid, "You can't do that right now.")
    end
 
    if getPlayerStorageValue(cid, t.s) <= 0 then
        if item.actionid ~= 12120 then
            doRemoveItem(item.uid, 1)
            local create_action = doPlayerAddItem(cid, bikeid, 1)
            doItemSetAttribute(create_action, "aid", 12120)

            doSendMagicEffect(pos, 177)
            doCreatureSay(cid, t.text, 19)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have mounted in a bike.')
            BikeSpeedOn(cid, t)
            if getPlayerSex(cid) == 1 then
                doSetCreatureOutfit(cid, {lookType = 2518}, -1)
            else
                doSetCreatureOutfit(cid, {lookType = 2517}, -1)
            end
        else
            doPlayerSendCancel(cid, "This bike is in use.")
        end
    else
        if item.actionid == 12120 and getCreatureOutfit(cid).lookType == 2518 or getCreatureOutfit(cid).lookType == 2517 then
            doRemoveItem(item.uid, 1)
            doPlayerAddItem(cid, bikeid, 1)        
            doSendMagicEffect(pos, 177)
            doCreatureSay(cid, t.dtext, 19)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You haven demouted of a bike.')
            BikeSpeedOff(cid, t)
            doRemoveCondition(cid, CONDITION_OUTFIT)
        else

        end
    end
    
return true
end

Teste esse meu brother. ^^ 

script da bike

Spoiler
local t = {text='Mount, bike!', dtext='Demount, bike!', s=5700, speed = 9999}
local bikeid = 1212 -- ITEMID da Bike

local function BikeSpeedOn(cid, t)                  
    setPlayerStorageValue(cid, t.s, t.speed)
    doChangeSpeed(cid, -getCreatureSpeed(cid))
    doChangeSpeed(cid, t.speed)
end
 
local function BikeSpeedOff(cid, t)
    setPlayerStorageValue(cid, t.s, -1)
    doRegainSpeed(cid)
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
    local pos = getThingPos(cid)
    if getPlayerItemCount(cid, 12774) <= 0 then
        return doPlayerSendCancel(cid, "Você precisa ter a bike na sua bag.")
    end
 
    if getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 or
        getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 75846) >= 1 or
        getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then
       return doPlayerSendCancel(cid, "You can't do that right now.")
    end

    if getPlayerStorageValue(cid, t.s) <= 0 then
        if item.actionid ~= 12120 then
            doRemoveItem(item.uid, 1)
            local create_action = doPlayerAddItem(cid, bikeid, 1)
            doItemSetAttribute(create_action, "aid", 12120)

            setPlayerStorageValue(cid, 12120, 1)
            doSendMagicEffect(pos, 177)
            doCreatureSay(cid, t.text, 19)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have mounted in a bike.')
            BikeSpeedOn(cid, t)
            if getPlayerSex(cid) == 1 then
                doSetCreatureOutfit(cid, {lookType = 1951}, -1)
            else
                doSetCreatureOutfit(cid, {lookType = 1950}, -1)
            end
        else
            doPlayerSendCancel(cid, "This bike is in use.")
        end
    else
        if item.actionid == 12120 and getCreatureOutfit(cid).lookType == 1951 or getCreatureOutfit(cid).lookType == 1950 then
            doRemoveItem(item.uid, 1)
            doPlayerAddItem(cid, bikeid, 1)
            setPlayerStorageValue(cid, 12120, -1)
            doSendMagicEffect(pos, 177)
            doCreatureSay(cid, t.dtext, 19)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You haven demouted of a bike.')
            BikeSpeedOff(cid, t)
            doRemoveCondition(cid, CONDITION_OUTFIT)
        else
            doPlayerSendCancel(cid, "This bike isn't yours.")
        end
    end
    
return true
end

 

Agora em creaturescripts.xml adicione a tag:

 

<event type="logout" name="EventLogout" event="script" value="SystemLogout.lua"/>

 

E em SystemLogout.lua, adicione o script abaixo:

 

function onLogout(cid)
    if getPlayerStorageValue(cid, 12120) > 0 then
        return doPlayerSendCancel(cid, "You can't logout while riding in the bike.") and false
    end
return true
end

 

Agora em login.lua, adicione a tag abaixo junto com as do gênero:

 

registerCreatureEvent(cid, "EventLogout")

 

créditos: driano swatt

                                                                  

                                                                    Meus tópicos         

                                                                   Se ajudei você deixe seu Rep! para fortalecer a amizade ^^

                                                                                        Vamos ajudar o fórum a crescer mais.

                                                                

                                                                                             ----- NPC que vende informação -----

                                                                                          -----Baú Que dá Outfit se tiver Level -----

                                                                    

StrikersBR12

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 25/08/17Posts: 153Gênero: Masculino
6 horas atrás, Ayron5 disse:

Teste esse meu brother. ^^ 

script da bike

  Mostrar conteúdo oculto
local t = {text='Mount, bike!', dtext='Demount, bike!', s=5700, speed = 9999}
local bikeid = 1212 -- ITEMID da Bike

local function BikeSpeedOn(cid, t)                  
    setPlayerStorageValue(cid, t.s, t.speed)
    doChangeSpeed(cid, -getCreatureSpeed(cid))
    doChangeSpeed(cid, t.speed)
end
 
local function BikeSpeedOff(cid, t)
    setPlayerStorageValue(cid, t.s, -1)
    doRegainSpeed(cid)
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
    local pos = getThingPos(cid)
    if getPlayerItemCount(cid, 12774) <= 0 then
        return doPlayerSendCancel(cid, "Você precisa ter a bike na sua bag.")
    end
 
    if getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 or
        getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 75846) >= 1 or
        getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then
       return doPlayerSendCancel(cid, "You can't do that right now.")
    end

    if getPlayerStorageValue(cid, t.s) <= 0 then
        if item.actionid ~= 12120 then
            doRemoveItem(item.uid, 1)
            local create_action = doPlayerAddItem(cid, bikeid, 1)
            doItemSetAttribute(create_action, "aid", 12120)

            setPlayerStorageValue(cid, 12120, 1)
            doSendMagicEffect(pos, 177)
            doCreatureSay(cid, t.text, 19)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have mounted in a bike.')
            BikeSpeedOn(cid, t)
            if getPlayerSex(cid) == 1 then
                doSetCreatureOutfit(cid, {lookType = 1951}, -1)
            else
                doSetCreatureOutfit(cid, {lookType = 1950}, -1)
            end
        else
            doPlayerSendCancel(cid, "This bike is in use.")
        end
    else
        if item.actionid == 12120 and getCreatureOutfit(cid).lookType == 1951 or getCreatureOutfit(cid).lookType == 1950 then
            doRemoveItem(item.uid, 1)
            doPlayerAddItem(cid, bikeid, 1)
            setPlayerStorageValue(cid, 12120, -1)
            doSendMagicEffect(pos, 177)
            doCreatureSay(cid, t.dtext, 19)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You haven demouted of a bike.')
            BikeSpeedOff(cid, t)
            doRemoveCondition(cid, CONDITION_OUTFIT)
        else
            doPlayerSendCancel(cid, "This bike isn't yours.")
        end
    end
    
return true
end

 

Agora em creaturescripts.xml adicione a tag:

 

<event type="logout" name="EventLogout" event="script" value="SystemLogout.lua"/>

 

E em SystemLogout.lua, adicione o script abaixo:

 

function onLogout(cid)
    if getPlayerStorageValue(cid, 12120) > 0 then
        return doPlayerSendCancel(cid, "You can't logout while riding in the bike.") and false
    end
return true
end

 

Agora em login.lua, adicione a tag abaixo junto com as do gênero:

 

registerCreatureEvent(cid, "EventLogout")

 

créditos: driano swatt

registerCreatureEvent(cid, "EventLogout"

 

coloco aonde exatamente no login.lua?

 

ainda continua deslogando encima da bike

pra ficar mais fácil tenta colocar pra mim o sistema de bloquear o uso de uma mesma bike por mais de uma pessoa

 

bike.lua sem bugs , so preciso bloquear o uso da bike por mais de uma pessoa

Spoiler

-- { Autor: Lucas Rafaeel }
-- { Version: 1.0 }


local config =
{
    velocidadeDaSuaBike = 5000, -- Velocidade da bike coloquei igual o do OtPokemon 
    outfitMale = 2518, -- Outfit MALE
    outfitFemale = 2517, -- Outfit FEMALE
    storageValue = 243656, -- Não mude
}
 
function onUse(cid, item, itemEx, fromPosition, toPosition)

    if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_RING).uid then
        doPlayerSendCancel(cid, "Você deve colocar sua bike no local correto.") -- Mensagem que da ao tentar usar a bike fora do slot (by: Lukas)
    return TRUE
end

    if getPlayerStorageValue(cid, 17001) > 0 or getPlayerStorageValue(cid, 17000) > 0 or getPlayerStorageValue(cid, 63215) > 0 then
        doPlayerSendCancel(cid, "Você não pode usar bike em situações especiais.")
    return true
end
 
    if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end
        if getPlayerStorageValue(cid, config.storageValue) <= 0 then
            local a = {lookType = config.outfitMale, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}
            local b = {lookType = config.outfitFemale, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}
            setPlayerStorageValue(cid, 3624, ""..getPlayerStamina(cid).."")
            doChangeSpeed(cid, -getCreatureSpeed(cid))
            doChangeSpeed(cid, config.velocidadeDaSuaBike)
            setPlayerStorageValue(cid, config.storageValue, 1)        
            if getPlayerSex(cid) == 0 then
                doSetCreatureOutfit(cid, b, -1)
            else
                doSetCreatureOutfit(cid, a, -1)
            end
        else
            setPlayerStorageValue(cid, config.storageValue, 0)
            doRemoveCondition(cid, CONDITION_OUTFIT)
            doRegainSpeedLevel(cid)
       end
    return true
end

 

Outro bike.lua

Spoiler

function onUse(cid, item, fromPosition, itemEx, toPosition)

local sBike = 12774

local t = {
[12774] = {article='a', name='bike', text='Vou montar na bike!', dtext='Vou sair da bike!', s=99999999, condition=bikeCondition},
}

local premium = false

function BikeSpeedOn(cid,nSpeed)
setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid))
doChangeSpeed(cid,-getCreatureSpeed(cid))
doChangeSpeed(cid,nSpeed)
end
function BikeSpeedOff(cid)
doChangeSpeed(cid,-getCreatureSpeed(cid))
doChangeSpeed(cid,getPlayerStorageValue(cid,sBike))
end

if not isPremium(cid) then
doPlayerSendCancel(cid, "Vc nao é premium, Vaza.")
return true
end


local v, r = getCreaturePosition(cid), t[item.itemid]
local s = r.s
local pos = {x = v.x, y = v.y, z = v.z}
if r then
if getPlayerStorageValue(cid, 25000) == 5 then
return
end
if getPlayerStorageValue(cid, 23000) == 5 then
return
end


if getPlayerStorageValue(cid, 17001) == 1 or getPlayerStorageValue(cid, 63215) == 1 or getPlayerStorageValue(cid, 17000) == 1 then
doPlayerSendCancel(cid, "You can't use bike while ride/fly/surf.")
return true
end
if getPlayerStorageValue(cid, s) <= 0 then
doCreatureSay(cid, r.text, 19)
setPlayerStorageValue(cid, s, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Você montou na ' .. r.article .. ' '.. r.name .. '.')
BikeSpeedOn(cid,1100)
if getPlayerSex(cid) == 1 then
doSetCreatureOutfit(cid, {lookType = 2518, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
else
doSetCreatureOutfit(cid, {lookType = 2517, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
end


elseif getPlayerStorageValue(cid, s) == 1 then
doCreatureSay(cid, r.dtext, 19)
setPlayerStorageValue(cid, s, 0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Você saiu da ' .. r.article .. ' '.. r.name .. '.')
BikeSpeedOff(cid)
return doRemoveCondition(cid, CONDITION_OUTFIT)
else
return doPlayerSendCancel(cid, 'You can\'t do this.')
end
else
return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.')
end

end

 

 

@Ayron5 ou @Marshmello ou @Yan Liima ajuda ae

Refe

avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 14/07/10Posts: 645Gênero: Masculino
2 horas atrás, StrikersBR12 disse:

registerCreatureEvent(cid, "EventLogout"

 

coloco aonde exatamente no login.lua?

 

ainda continua deslogando encima da bike

pra ficar mais fácil tenta colocar pra mim o sistema de bloquear o uso de uma mesma bike por mais de uma pessoa

 

bike.lua sem bugs , so preciso bloquear o uso da bike por mais de uma pessoa

  Ocultar conteúdo

-- { Autor: Lucas Rafaeel }
-- { Version: 1.0 }


local config =
{
    velocidadeDaSuaBike = 5000, -- Velocidade da bike coloquei igual o do OtPokemon 
    outfitMale = 2518, -- Outfit MALE
    outfitFemale = 2517, -- Outfit FEMALE
    storageValue = 243656, -- Não mude
}
 
function onUse(cid, item, itemEx, fromPosition, toPosition)

    if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_RING).uid then
        doPlayerSendCancel(cid, "Você deve colocar sua bike no local correto.") -- Mensagem que da ao tentar usar a bike fora do slot (by: Lukas)
    return TRUE
end

    if getPlayerStorageValue(cid, 17001) > 0 or getPlayerStorageValue(cid, 17000) > 0 or getPlayerStorageValue(cid, 63215) > 0 then
        doPlayerSendCancel(cid, "Você não pode usar bike em situações especiais.")
    return true
end
 
    if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end
        if getPlayerStorageValue(cid, config.storageValue) <= 0 then
            local a = {lookType = config.outfitMale, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}
            local b = {lookType = config.outfitFemale, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}
            setPlayerStorageValue(cid, 3624, ""..getPlayerStamina(cid).."")
            doChangeSpeed(cid, -getCreatureSpeed(cid))
            doChangeSpeed(cid, config.velocidadeDaSuaBike)
            setPlayerStorageValue(cid, config.storageValue, 1)        
            if getPlayerSex(cid) == 0 then
                doSetCreatureOutfit(cid, b, -1)
            else
                doSetCreatureOutfit(cid, a, -1)
            end
        else
            setPlayerStorageValue(cid, config.storageValue, 0)
            doRemoveCondition(cid, CONDITION_OUTFIT)
            doRegainSpeedLevel(cid)
       end
    return true
end

 

Outro bike.lua

  Mostrar conteúdo oculto

 

 

@Ayron5 ou @Marshmello ou @Yan Liima ajuda ae

me manda qual arquivo do sistema de bike que tá no seu servidor ativo, assim eu posso tentar ajudar.

Contato:

 

 

Email: contato@ceetros.com

Discord: Ceetros#5376

Telegram: @ceetros

 

 

StrikersBR12

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 25/08/17Posts: 153Gênero: Masculino
Agora, Ceetros disse:

me manda qual arquivo do sistema de bike que tá no seu servidor ativo, assim eu posso tentar ajudar.

Atualmente esse

 

Spoiler

function onUse(cid, item, fromPosition, itemEx, toPosition)

local sBike = 12774

local t = {
[12774] = {article='a', name='bike', text='Vou montar na bike!', dtext='Vou sair da bike!', s=99999999, condition=bikeCondition},
}

local premium = false

function BikeSpeedOn(cid,nSpeed)
setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid))
doChangeSpeed(cid,-getCreatureSpeed(cid))
doChangeSpeed(cid,nSpeed)
end
function BikeSpeedOff(cid)
doChangeSpeed(cid,-getCreatureSpeed(cid))
doChangeSpeed(cid,getPlayerStorageValue(cid,sBike))
end

if not isPremium(cid) then
doPlayerSendCancel(cid, "Vc nao é premium, Vaza.")
return true
end


local v, r = getCreaturePosition(cid), t[item.itemid]
local s = r.s
local pos = {x = v.x, y = v.y, z = v.z}
if r then
if getPlayerStorageValue(cid, 25000) == 5 then
return
end
if getPlayerStorageValue(cid, 23000) == 5 then
return
end


if getPlayerStorageValue(cid, 17001) == 1 or getPlayerStorageValue(cid, 63215) == 1 or getPlayerStorageValue(cid, 17000) == 1 then
doPlayerSendCancel(cid, "You can't use bike while ride/fly/surf.")
return true
end
if getPlayerStorageValue(cid, s) <= 0 then
doCreatureSay(cid, r.text, 19)
setPlayerStorageValue(cid, s, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Você montou na ' .. r.article .. ' '.. r.name .. '.')
BikeSpeedOn(cid,1100)
if getPlayerSex(cid) == 1 then
doSetCreatureOutfit(cid, {lookType = 2518, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
else
doSetCreatureOutfit(cid, {lookType = 2517, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
end


elseif getPlayerStorageValue(cid, s) == 1 then
doCreatureSay(cid, r.dtext, 19)
setPlayerStorageValue(cid, s, 0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Você saiu da ' .. r.article .. ' '.. r.name .. '.')
BikeSpeedOff(cid)
return doRemoveCondition(cid, CONDITION_OUTFIT)
else
return doPlayerSendCancel(cid, 'You can\'t do this.')
end
else
return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.')
end

end

 

o que quero é o seguinte 

 

Impedir que dois player usem a mesma bike

Yan Liima

Scripter,Programador,WebMaster.
avatar
Diretor
Diretor

INFOS

Grupo: DiretorRegistrado: 12/05/12Posts: 818Gênero: MasculinoChar no Tibia: [ADM] Night

Usa da maneira que o Marsh mandou, porém ele cometeu um pequeno erro. Só está verificando apartir da storage de valor 2. Tente assim:

function onLogout(cid)
if getPlayerStorageValue(cid, 5700) >= 1 then
doPlayerSendTextMessage(cid, 25, "Você não pode deslogar montado em uma bike)
return false
else
return true
end
end

E só pra deixar ciente, não precisa registrar no login.lua, eventos de login e logout não é necessário.

════ҳ̸Ҳ̸ҳஜ۩۞۩ஜҳ̸Ҳ̸ҳ═══╗

ALGUNS DOS MEUS TRABALHOS:

Spoiler

WODBOHS[DOWNLOAD]

Newstory dbo+nto+bleach[DOWNLOAD]

 

>> Mais infos <<

- Projetos lançados também feitos por mim {

DBO SKY

POKE SKY

WODBOWARS

Tic-tac-War

Dbo Universe(em desenvolvimento)

}

universe.thumb.png.6840320998d0fc1a4652b3db81a585c0.png

Separador.PNG

Te Ajudei? Rep + e ficamos Quits

imageproxy.png.84dce08dd18d31663a72aa1ce37b858a.png

Precisando de ajuda?

discord.png.1ecd188791d0141f74d99db371a2e0a4.pngDiscord: Yan Liima #3702

Programador Júnior de LUA, PHP e JavaScript

Juntos somos lendas, separados somos Mitos!

╚══════════════════════════ҳ̸Ҳ̸ҳஜ۩۞۩ஜҳ̸Ҳ̸ҳ═════════════════════════════╝

StrikersBR12

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 25/08/17Posts: 153Gênero: Masculino
3 minutos atrás, Yan Liima disse:

Usa da maneira que o Marsh mandou, porém ele cometeu um pequeno erro. Só está verificando apartir da storage de valor 2. Tente assim:

function onLogout(cid)
if getPlayerStorageValue(cid, 5700) >= 1 then
doPlayerSendTextMessage(cid, 25, "Você não pode deslogar montado em uma bike)
return false
else
return true
end
end

E só pra deixar ciente, não precisa registrar no login.lua, eventos de login e logout não é necessário.

ainda deslogo normalmente ksks

base Utilizada PokeZR

 

Refe

avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 14/07/10Posts: 645Gênero: Masculino
17 minutos atrás, StrikersBR12 disse:

ainda deslogo normalmente ksks

base Utilizada PokeZR

 

Então, os caras tão pegando algo pronto da net, muda ali na segunda linha o 5700 para 99999999, que é a storago do seu servidor

Contato:

 

 

Email: contato@ceetros.com

Discord: Ceetros#5376

Telegram: @ceetros

 

 

StrikersBR12

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 25/08/17Posts: 153Gênero: Masculino
2 minutos atrás, Ceetros disse:

Então, os caras tão pegando algo pronto da net, muda ali na segunda linha o 5700 para 99999999, que é a storago do seu servidor

vou testar aqui

4 minutos atrás, Ceetros disse:

Então, os caras tão pegando algo pronto da net, muda ali na segunda linha o 5700 para 99999999, que é a storago do seu servidor

ainda consigo deslogar porem , esse não é o problema agora , eu so quero que dois players n consigam usar a mesma bike

Marshmello

Alone ~ [✖‿✖]
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 21/04/16Posts: 831Gênero: Masculino
27 minutos atrás, Yan Liima disse:

Usa da maneira que o Marsh mandou, porém ele cometeu um pequeno erro. Só está verificando apartir da storage de valor 2. Tente assim:

function onLogout(cid)
if getPlayerStorageValue(cid, 5700) >= 1 then
doPlayerSendTextMessage(cid, 25, "Você não pode deslogar montado em uma bike)
return false
else
return true
end
end

E só pra deixar ciente, não precisa registrar no login.lua, eventos de login e logout não é necessário.

Tinha feito Pelo Celular nem vi a cagada kk vlw pela correção

placa1.png.90a184502351cebe72cd7b69751e551d.png

Meu Facebook

INFOS:

Citar

CIDADE: Rio de janeiro

Idade: 22 anos
SOU: {"Scripter(lua)", "WebMaster", "ProgramadorC++"}
 

local config = {
	delrey = getPlayerCarValue(cid, DELREY),
	cigarro = getPlayerCancer(cid, DERBY),
	prostituta = getPlayerAIDS(cid, cracuda),
	tresOitao = getPlayerRevorvi(cid, 38)
}
if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
end

 

 

 

StrikersBR12

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 25/08/17Posts: 153Gênero: Masculino
1 minuto atrás, Marshmello disse:

Tinha feito Pelo Celular nem vi a cagada kk vlw pela correção

da pra me ajudar ae??

Marshmello

Alone ~ [✖‿✖]
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 21/04/16Posts: 831Gênero: Masculino
Agora, StrikersBR12 disse:

da pra me ajudar ae??

Eu atualizei o codigo lá em cima testa lá

placa1.png.90a184502351cebe72cd7b69751e551d.png

Meu Facebook

INFOS:

Citar

CIDADE: Rio de janeiro

Idade: 22 anos
SOU: {"Scripter(lua)", "WebMaster", "ProgramadorC++"}
 

local config = {
	delrey = getPlayerCarValue(cid, DELREY),
	cigarro = getPlayerCancer(cid, DERBY),
	prostituta = getPlayerAIDS(cid, cracuda),
	tresOitao = getPlayerRevorvi(cid, 38)
}
if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
end

 

 

 

StrikersBR12

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 25/08/17Posts: 153Gênero: Masculino
1 minuto atrás, Marshmello disse:

Eu atualizei o codigo lá em cima testa lá

to querendo um código pra bloquear o uso da mesma bike por dois players por exemplo um cara tem uma bike ele usa e taca pra outro e o outro usa tbm

 

meus scripts de bike.lua

 

bike.lua

 

Spoiler

-- { Autor: Lucas Rafaeel }
-- { Version: 1.0 }


local config =
{
    velocidadeDaSuaBike = 5000, -- Velocidade da bike coloquei igual o do OtPokemon 
    outfitMale = 2518, -- Outfit MALE
    outfitFemale = 2517, -- Outfit FEMALE
    storageValue = 243656, -- Não mude
}
 
function onUse(cid, item, itemEx, fromPosition, toPosition)

    if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_RING).uid then
        doPlayerSendCancel(cid, "Você deve colocar sua bike no local correto.") -- Mensagem que da ao tentar usar a bike fora do slot (by: Lukas)
    return TRUE
end

    if getPlayerStorageValue(cid, 17001) > 0 or getPlayerStorageValue(cid, 17000) > 0 or getPlayerStorageValue(cid, 63215) > 0 then
        doPlayerSendCancel(cid, "Você não pode usar bike em situações especiais.")
    return true
end
 
    if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end
        if getPlayerStorageValue(cid, config.storageValue) <= 0 then
            local a = {lookType = config.outfitMale, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}
            local b = {lookType = config.outfitFemale, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}
            setPlayerStorageValue(cid, 3624, ""..getPlayerStamina(cid).."")
            doChangeSpeed(cid, -getCreatureSpeed(cid))
            doChangeSpeed(cid, config.velocidadeDaSuaBike)
            setPlayerStorageValue(cid, config.storageValue, 1)        
            if getPlayerSex(cid) == 0 then
                doSetCreatureOutfit(cid, b, -1)
            else
                doSetCreatureOutfit(cid, a, -1)
            end
        else
            setPlayerStorageValue(cid, config.storageValue, 0)
            doRemoveCondition(cid, CONDITION_OUTFIT)
            doRegainSpeedLevel(cid)
       end
    return true
end

 

Atualmente esse \/

 

Spoiler

function onUse(cid, item, fromPosition, itemEx, toPosition)

local sBike = 12774

local t = {
[12774] = {article='a', name='bike', text='Vou montar na bike!', dtext='Vou sair da bike!', s=99999999, condition=bikeCondition},
}

local premium = false

function BikeSpeedOn(cid,nSpeed)
setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid))
doChangeSpeed(cid,-getCreatureSpeed(cid))
doChangeSpeed(cid,nSpeed)
end
function BikeSpeedOff(cid)
doChangeSpeed(cid,-getCreatureSpeed(cid))
doChangeSpeed(cid,getPlayerStorageValue(cid,sBike))
end

if not isPremium(cid) then
doPlayerSendCancel(cid, "Vc nao é premium, Vaza.")
return true
end


local v, r = getCreaturePosition(cid), t[item.itemid]
local s = r.s
local pos = {x = v.x, y = v.y, z = v.z}
if r then
if getPlayerStorageValue(cid, 25000) == 5 then
return
end
if getPlayerStorageValue(cid, 23000) == 5 then
return
end


if getPlayerStorageValue(cid, 17001) == 1 or getPlayerStorageValue(cid, 63215) == 1 or getPlayerStorageValue(cid, 17000) == 1 then
doPlayerSendCancel(cid, "You can't use bike while ride/fly/surf.")
return true
end
if getPlayerStorageValue(cid, s) <= 0 then
doCreatureSay(cid, r.text, 19)
setPlayerStorageValue(cid, s, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Você montou na ' .. r.article .. ' '.. r.name .. '.')
BikeSpeedOn(cid,1100)
if getPlayerSex(cid) == 1 then
doSetCreatureOutfit(cid, {lookType = 2518, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
else
doSetCreatureOutfit(cid, {lookType = 2517, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
end


elseif getPlayerStorageValue(cid, s) == 1 then
doCreatureSay(cid, r.dtext, 19)
setPlayerStorageValue(cid, s, 0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Você saiu da ' .. r.article .. ' '.. r.name .. '.')
BikeSpeedOff(cid)
return doRemoveCondition(cid, CONDITION_OUTFIT)
else
return doPlayerSendCancel(cid, 'You can\'t do this.')
end
else
return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.')
end

end