What's new
  • logo_cipsoft
    Latest servers:
    New servers will open on: 19th Feb 2025:
    Noctalia (Open PvP) Ignitera (Open PvP) us_logo Xybra (Open PvP)

Talkactions Redskull/blackskull remover

Status
Not open for further replies.

n0t

User
Joined
Sep 18, 2010
Messages
27
Reaction score
0
Witam

Hej, jak ju? wiecie z tytu?u jest to skrypt na Red/black skull removera.
Zaczn? od remove red:
1.Tworzymy plik o nazwie "xxx.lua" nazwa mo?e by? jaki kto ma gust.
2.Otwieramy i wklejamy tam:
[LUA]local COST = 4000000 --400cc za delete redskulla

function onSay(cid, words, chanel, param)
if (getCreatureSkullType(cid) == SKULL_RED) and (getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE) then
if doPlayerRemoveMoney(cid, COST) then
doCreatureSetSkullType(cid, SKULL_NONE)
doCreatureSay(cid, "Red Skull zlikwidowany 4000000 Zlota", TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), 27)
else
doPlayerSendCancel(cid, "Nie posiadasz 4000000 Zlota do zlikwidacji Red Skull'a.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
else
doPlayerSendCancel(cid, "Nie masz Red Skull'a lub posiadasz pz.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
return TRUE
end[/LUA]
3. Do edycji koszt?w, edytujemy [LUA]local COST = 4000000[/LUA] i zmieniamy walut?.
Teraz zaczniemy z black skullem.
1. Tworzymy plik .lua jak w red remover.
2. Wklejamy podobny kod lecz r??ni si? on [LUA]SKULL_RED/SKULL_BLACK[/LUA]
[LUA]local COST = 5000000

function onSay(cid, words, chanel, param)
if (getCreatureSkullType(cid) == SKULL_BLACK) and (getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE) then
if doPlayerRemoveMoney(cid, COST) then
doCreatureSetSkullType(cid, SKULL_NONE)
doCreatureSay(cid, "Black Skull zlikwidowany za 5000000 Zlota", TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), 27)
else
doPlayerSendCancel(cid, "Nie masz 5000000 Zlota aby usunac Black Skull'a.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
else
doPlayerSendCancel(cid, "Nie masz Black Skull'a lub masz pz.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
return TRUE
end[/LUA]

Teraz wchodzimy: TW?J OTS/data/talcations/scripts/i wklejamy pliki kt?re utworzyli?my.
Cofnijmy teraz si? o jeden folder i edytujmy talcations.xml pod wszystkim wklejamy .
[XML]<!--zmie? "twojanazwa.lua" na te kt?re zrobi?e? wcze?niej.-->
<!--do edycji jest opcja "!red" i "!black" to s?owa kt?re odpowiadaj? za ten skrypt.-->
<talkaction words="!red" event="script" value="twojanazwa.lua"/>
<talkaction words="!black" event="script" value="twojanazwa.lua"/>[/XML]
Dzi?kuj? licz? na dobre komentarze to moje pierwsze skrypty tworzone na Spisie funkcji lua by Kahras
 

Kahras

Senior User
Joined
Aug 26, 2011
Messages
2,714
Reaction score
167
Age
26
Odp: Redskull/blackskull remover

Og?lnie mog?e? to zrobi? w 1 skrypcie - co do tych text?w co b?d? wysy?ane do gracza to gdy zmieni? cen? tych remover?w to i tak b?dzie pisa? ta sama cena mog?e? zrobi? tak:
[lua] doPlayerSendCancel(cid, "Nie posiadasz "..COST.." Zlota do zlikwidacji Red Skull'a.")[/lua]
W ten czas wy?wietli si? liczba podana w COST.

#Tzn. nic nie napisa?e? ?e trzeba nie mie? walki tzn tak mi si? zdaje bynajmniej
Kopiowa?e? to z innego skryptu czy sam to pisa?e? i zapomnia?e? napisa? tutaj?
 

Zbizu

Luakami
Joined
Mar 13, 2010
Messages
719
Reaction score
104
Age
29
Odp: Redskull/blackskull remover

a gdyby kto? w?tpi? - na TFS 0.2/1.0 te? si? da:
[lua]function onSay(cid, words, chanel, param)
COST = 5000
unremovable_skulls = {
SKULL_NONE,
SKULL_YELLOW,
SKULL_GREEN,
SKULL_WHITE,
SKULL_ORANGE
}

if isInArray(unremovable_skulls, getPlayerSkullType(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_LOOT, "You can't remove that skull!")
return true
else
if doPlayerRemoveMoney(cid, COST) then
customer = getPlayerGUID(cid)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `skulltime` = '0' WHERE `players`.`id` = " .. customer .. ";")
else
doPlayerSendTextMessage(cid, MESSAGE_LOOT, "You need ".. COST .." gold to do that.")
end
end
return true
end[/lua]

---------- Tre?? dodana o 18:43 ----------

zapomnia?em doda? sprawdzanie pz, u mnie jest to pod itemem w shopie
 
Last edited:
Status
Not open for further replies.
Top