Ir para conteúdo
  • 0

PZ tile?


malyfanek

Pergunta

I have a problem with PZ, players can enter PZ with fight on and they get PZ, when they left fight is back ....

I though about making walkon event with pz tile but ... im not sure is it good idea, wouldnt it slow down server very much?

Maybe i got something wrong in source? (where to search for it? i checked tile.h, tile.cpp, players.cpp didnt see anything wrong there i guess)

Making script with pz pushback if in fight condition ?? But also have no idea how it shall look ...

Strange is cuz though that if i add PZ at mapeditor, it shoudlnt let players enter there if in fight etc but it does ....

 

Tfs 0.4 rev 3777 client 8.6

 

Tried:

 

function onThink (interval)
        
            if isPlayer (cid) and (getTilePzInfo (getCreaturePosition (cid)) and
getCreatureCondition (cid, CONDITION_INFIGHT)) then
        doTeleportThing (cid, fromPosition, false)
        doPlayerSendTextMessage (cid, 25, "while you can't enter . ")
end    
    return true
    end

 

No errors at console, tried with true / false but not works; x

Editado por malyfanek
Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

  • 0
3 horas atrás, malyfanek disse:

I have a problem with PZ, players can enter PZ with fight on and they get PZ, when they left fight is back ....

I though about making walkon event with pz tile but ... im not sure is it good idea, wouldnt it slow down server very much?

Maybe i got something wrong in source? (where to search for it? i checked tile.h, tile.cpp, players.cpp didnt see anything wrong there i guess)

Making script with pz pushback if in fight condition ?? But also have no idea how it shall look ...

Strange is cuz though that if i add PZ at mapeditor, it shoudlnt let players enter there if in fight etc but it does ....

 

Tfs 0.4 rev 3777 client 8.6

 

Tried:

 

function onThink (interval)
        
            if isPlayer (cid) and (getTilePzInfo (getCreaturePosition (cid)) and
getCreatureCondition (cid, CONDITION_INFIGHT)) then
        doTeleportThing (cid, fromPosition, false)
        doPlayerSendTextMessage (cid, 25, "while you can't enter . ")
end    
    return true
    end

 

No errors at console, tried with true / false but not works; x

Are you sure it isn't giving any error in console? I think there is some things missing in this code, shouldn't it be like onThink(cid, interval) instead of onThink(interval)?  Also the variable fromPosition in function doTeleportThing is not declareted so it doesn't have a value. I think it's way easier to make this script using onMove instead of onThink xD

 

edit: I think there is something wrong with your distro, you shouldn't need a lua script for this system, try using TFS 0.4 Rev3996, you can find it here:

 

Editado por lSainty
Link para o comentário
Compartilhar em outros sites

  • 0
Well that was just example, tried with cid etc like:

function onThink(cid, interval)
        if (getTilePzInfo(getCreaturePosition(cid))) then
            
            if isPlayer(cid) and (getTilePzInfo(getCreaturePosition(cid)) and
getCreatureCondition(cid, CONDITION_INFIGHT)) then
        doTeleportThing(cid, fromPosition, false)
        doPlayerSendTextMessage(cid, 25, "You cant enter protection zone while in fight.")
    
    end
    end
    return true
    end

and about "Also the variable fromPosition in function doTeleportThing is not declared so it doesn't have a value."

I though thats how works Pushback :D And to be honest, as I wrote i also think its something in distro but i see thats i got same tile/player/combat/game.cpp same as the distro u gave when i search for "PROTECTIONZONE" So i already have no idea whats wrong ;x Maybe some tips where to search for those function exacly at source or something? Cuz i rly dont wanna do it in LUA to dont make server too laggy but atleast i think i gonna need to make onmove ;x

Link para o comentário
Compartilhar em outros sites

  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...