sameyes
Active User
- Joined
- Apr 3, 2009
- Messages
- 97
- Reaction score
- 4
Wiele os?b szuka kodu na party system. Te? go szuka?em. Po pewnym czasie znalaz?em wi?c chc? wam go udost?pni? + om?wi? co gdzie i jak.
W creaturescripts robimy plik 'party.lua'. Wklejamy do niego.
Nast?pnie w login.lua b?d? onLogin.lua dajemy wpis.
I w pliku creaturecripts.xml dodajemy linijk?.
W creaturescripts robimy plik 'party.lua'. Wklejamy do niego.
function onStatsChange(cid, attacker, type, combat, value)
if isPlayer(attacker) == false then
return true
end
if isPlayer(cid) == false then
return true
end
if isInParty(cid) == false then
return true
end
if getPlayerParty(cid) == getPlayerParty(attacker) then
if combat ~= COMBAT_HEALING then
return doPlayerSendCancel(cid, 'You cannot attack teammate.') and false
end
end
return true
end
Nast?pnie w login.lua b?d? onLogin.lua dajemy wpis.
registerCreatureEvent(cid, "Party")
I w pliku creaturecripts.xml dodajemy linijk?.
<event type="statschange" name="Party" event="script" value="party.lua"/>