What's new

Pomoc ze skryptem :D

Status
Not open for further replies.

keal1

Advanced User
Joined
Dec 8, 2009
Messages
339
Reaction score
21
Siema , ot?z mam ma?y problem posiadam skrypt frag reward 8.54
Wszystko niby dzia?a , tylko jest male niedociagniecie kt?rego nie potrafie wyeliminowa? tzn , wystarczy ze gracz uderzy 2 i ten 2 padnie dostaje frag reward , a chcia?bym aby tylko osoba kt?ra dostanie za niego fraga dostawa?a rewarda wklej? tutaj skrypt

PHP:
local item = 2160
function onKill(cid, target, lastHit)
    if isPlayer(cid) == true and isPlayer(target) == true then
        doPlayerAddItem(cid, item, 1)
    end
return true
end

Prosz? o szybk? pomoc :(
 

sSlasheRs

Advanced User
Joined
Apr 30, 2010
Messages
193
Reaction score
15
Odp: Pomoc ze skryptem :D

Umh... Masz inny skrypt na frag reward. Prosz? bardzo:
w Creturescript.xml :
Kod php:
<event type="kill" name="FragReward" event="script" value="fragreward.lua"/>
w creaturescripts/scripts utw?rz fragreward.lua:
Kod php:
local config = {
money = TRUE, --True jezeli nagroda ma byc kasa
ilekasy = 600, --jezeli w money dales true to tu wpisz ilosc
item = {2160, 2159} --jezeli w money dales cos innego niz true wtedy wpisz tu jakie ma dawac itemy lub item, jezeli jeden item to wpisz tylko = ID
}


function onKill(cid, target, lastHit)
if isPlayer(cid) == TRUE and isPlayer(target) == TRUE and lastHit == TRUE then
if config.money == TRUE then
doPlayerAddMoney(cid, config.ilekasy)
else
for i = 1, #config.item do
doPlayerAddItem(cid, config.item, 1)
end
end
end
return TRUE
end

W login.lua przed ostatnim endem wklej:
Kod php:
registerCreatureEvent(cid, "FragReward")
 

keal1

Advanced User
Joined
Dec 8, 2009
Messages
339
Reaction score
21
Odp: Pomoc ze skryptem :D

Ja wiem to jest to samo tylko ze skr?cona wersja i ona dzia?a lecz ja POTRZEBUJE PRZEROBIENIA SKRYPTU ABY DOSTAL REWARD TYLKO TEN KTO GO OSTATNI DOBIL !!!
czyli 1 osoba a nie bije w 15 jednego chlopa i 15 dostanie reward .. _._

Prosz? w dalszym ciagu o pomoc :d.. Napewno kto? sie zna dam rep+:>
 

Nights

Ten typ ;)
Joined
May 12, 2010
Messages
350
Reaction score
32
Odp: Pomoc ze skryptem :D

Tylko, ?e skrypt powinien dzia?a?, bo zosta?o dodane lastHit == TRUE. Je?eli wywala jaki? error to napisz ;d
 

andy1995

Senior User
Joined
Apr 12, 2009
Messages
602
Reaction score
100
Odp: Pomoc ze skryptem :D

PHP:
local item = 2160 
function onKill(cid, target, lastHit) 
    if isPlayer(cid) == true and isPlayer(target) == true and lastHit then 
        doPlayerAddItem(cid, item, 1) 
    end 
return true 
end
 

Xayan

Senior User
Joined
Jul 4, 2009
Messages
2,608
Reaction score
390
Age
28
Odp: Pomoc ze skryptem :D

Code:
local item = 2160
function onKill(cid, target, lastHit)
    if isPlayer(lastHit) == true and isPlayer(target) == true then
        doPlayerAddItem(lastHit, item, 1)
    end
return true
end
 

Fikusek

Banned
Joined
May 17, 2010
Messages
248
Reaction score
9
Odp: Pomoc ze skryptem :D

Elo !
Po pierwsze kolego nie ten dzia? o skrypty prosimy w dziale request !
Po drugie jak juz napisa?e? to ci pomoge ...

w Creturescript.xml :

<event type="kill" name="FragReward" event="script" value="fragreward.lua"/>

w creaturescripts/scripts utw?rz fragreward.lua:
local config = {
money = TRUE, -- Gdy Nagroda bd kasa to wpisz
ilekasy = 600, --jezeli w money dales true to tu wpisz ilosc
item = {2160, 2159} --jezeli w money dales cos innego niz true wtedy wpisz tu jakie ma dawac itemy lub item, jezeli jeden item to wpisz tylko = ID
}


function onKill(cid, target, lastHit)
if isPlayer(cid) == TRUE and isPlayer(target) == TRUE and lastHit == TRUE then
if config.money == TRUE then
doPlayerAddMoney(cid, config.ilekasy)
else
for i = 1, #config.item do
doPlayerAddItem(cid, config.item, 1)
end
end
end
return TRUE
end


W login.lua przed ostatnim endem wklej:

registerCreatureEvent(cid, "FragReward")

I to tyle powino dzia?a? w razie jaki? k?opot?w pisz na pw lub tutaj ;p
Pozdrawiam Fikusek
 
Last edited:

kryspink

New User
Joined
Sep 29, 2010
Messages
6
Reaction score
0
Odp: Pomoc ze skryptem :D

local item = 2160
function onKill(cid, target, lastHit)
if isPlayer(lastHit) == true and isPlayer(target) == true then
doPlayerAddItem(lastHit, item, 1)
end
return true
end
 
Status
Not open for further replies.
Top