What's new

Pomocy pytanie kierowane do dobrych skrypterow

Status
Not open for further replies.

szakers

Active User
Joined
Oct 11, 2009
Messages
101
Reaction score
3
Witam mam taki skrypt
ktory utworzylem w skript w folderze talkations ten skrypt dziala
Code:
function onSay(cid, param) 
local pos = getPlayerPosition(cid)
  doSummonCreature("Bug",pos)
  doSendMagicEffect(pos,3)
  return true
end
a to do data/talkactions.xml
Code:
<talkaction words="komenda"  event="script" script="nazwa skryptu.lua" />
ten skrypt dziala ale z prozbal sie zwracam poniewaz chce zeby ten skrypt byl z ograniczeniem do 4 bogow np ale ma byc do czterech
pomocy pilne!!
 

phern

Advanced User
Joined
Oct 30, 2008
Messages
454
Reaction score
39
Odp: Pomocy pytanie kierowane do dobrych skrypterow

Tutaj masz przyk?ad Twojej komendy, kt?r? edytowa?em w taki spos?b, aby mo?na by?o u?y? jej tylko 2 razy.
function onSay(cid, param)
if getPlayerStorageValue(cid, 60200) == -1 then

local pos = getPlayerPosition(cid)
doSummonCreature("Bug",pos)
doSendMagicEffect(pos,3)

doPlayerSetStorageValue(cid,60200, 1)



elseif getPlayerStorageValue(cid, 60201) == -1 then
local pos = getPlayerPosition(cid)
doSummonCreature("Bug",pos)
doSendMagicEffect(pos,3)

doPlayerSetStorageValue(cid,60201, 1)

else

doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have already summoned 2 bugs and can not do it again.")

end
end
end
 
Last edited:

szakers

Active User
Joined
Oct 11, 2009
Messages
101
Reaction score
3
Odp: Pomocy pytanie kierowane do dobrych skrypterow

Tutaj masz przyk?ad Twojej komendy, kt?r? edytowa?em w taki spos?b, aby mo?na by?o u?y? jej tylko 2 razy.
Cytat:
Code:
function onSay(cid, param)
if getPlayerStorageValue(cid, 60200) == -1 then

local pos = getPlayerPosition(cid)
doSummonCreature("Bug",pos)
doSendMagicEffect(pos,3)

doPlayerSetStorageValue(cid,60200, 1)



elseif getPlayerStorageValue(cid, 60201) == -1 then
local pos = getPlayerPosition(cid)
doSummonCreature("Bug",pos)
doSendMagicEffect(pos,3)

doPlayerSetStorageValue(cid,60201, 1)

else

doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have already summoned 2 bugs and can not do it again.")

end
end
end

przykro mi nie dziala na moim silniku wyskakuje blad
 
Last edited by a moderator:

phern

Advanced User
Joined
Oct 30, 2008
Messages
454
Reaction score
39
Odp: Pomocy pytanie kierowane do dobrych skrypterow

przykro mi nie dziala na moim silniku wyskakuje blad
Podaj prosz? ten b??d, mo?liwe, ?e gdzie? si? pomyli?em, bo nie mam mo?liwo?ci sprawdzenia skryptu "na ?ywo".
 

szakers

Active User
Joined
Oct 11, 2009
Messages
101
Reaction score
3
Odp: Pomocy pytanie kierowane do dobrych skrypterow

prosze to ten blad o ktory prosiles
bykj.png
 

phern

Advanced User
Joined
Oct 30, 2008
Messages
454
Reaction score
39
Odp: Pomocy pytanie kierowane do dobrych skrypterow

Spr?buj tego:
function onSay(cid, param)
if getPlayerStorageValue(cid, 60200) == -1 then

local pos = getPlayerPosition(cid)
doSummonCreature("Bug",pos)
doSendMagicEffect(pos,3)

doPlayerSetStorageValue(cid,60200, 1)



elseif getPlayerStorageValue(cid, 60201) == -1 then
local pos = getPlayerPosition(cid)
doSummonCreature("Bug",pos)
doSendMagicEffect(pos,3)

doPlayerSetStorageValue(cid,60201, 1)

else

doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have already summoned 2 bugs and can not do it again.")

end
end
 

Vergil93

Advanced User
Joined
Jun 19, 2010
Messages
263
Reaction score
6
Odp: Pomocy pytanie kierowane do dobrych skrypterow

Lito?ci...
PHP:
function onSay(cid, words, param)
local max_summons, summons, pos = 2, getCreatureSummons(cid), getCreaturePosition(cid)
if(table.maxn(summons) <= max_summons-1) then
  doSummonCreature("Bug",pos)
  doSendMagicEffect(pos,3)
end
  return true
end
 
Last edited:

szakers

Active User
Joined
Oct 11, 2009
Messages
101
Reaction score
3
Odp: Pomocy pytanie kierowane do dobrych skrypterow

nie dziala moze to od tego zalezy
w talkations.xml mam
<talkaction words="komenda" event="script" script="komenda.lua" />
 
Status
Not open for further replies.
Top