• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Its able to do these ??

elking

Swev-v2.sytes.net Comming Soon !<>!
Joined
Aug 20, 2012
Messages
445
Reaction score
28
Location
Egypt
Hello people of OTLand
first : I need answer for this question.
Its able to exchange player storage by killing ? or increase by +1 on and decrease -1
like :-
When one player kill another they exchange their storage and send massage to both player
msg to winner you have win ..name.. and Extracted his place
msg to loser you have lost by ..name.. and he Extracted you place

second : make NPC that help player to join an event and increase 1 every time when player join
like :-
..name.. you have joined the event you is the first
..name.. you have joined the event you is the second
..name.. you have joined the event you is the third
and another ..name.. you have joined the event your place is 4
ETC
 
Do you mean set the storagevalue of the player +1 or that a player gets the storage value of the player he kills?
Code:
setPlayerStorageValue(cid, 39483, getPlayerStorageValue(cid, 39483) + 1)

setPlayerStorageValue(cid, 39483, getPlayerStorageValue(target, 39483))
I don't understand what you mean with the second part.
 
Do you mean set the storagevalue of the player +1 or that a player gets the storage value of the player he kills?
Code:
setPlayerStorageValue(cid, 39483, getPlayerStorageValue(cid, 39483) + 1)

setPlayerStorageValue(cid, 39483, getPlayerStorageValue(target, 39483))
I don't understand what you mean with the second part.

I was want this and exchange storage like killer storage is 21535 and another player 53156 when killer kill player then his storage change to 53156 and another player to 21353

about second part when you talk to NPC he set you storage xx and that if you first player who talk to him and another player every time set storage +1
 
This way the target gets the storage value of the killer.
Code:
setPlayerStorageValue(target, 39483, getPlayerStorageValue(cid, 39483))

I still don't understand what you mean with the rest.
 
This way the target gets the storage value of the killer.
Code:
setPlayerStorageValue(target, 39483, getPlayerStorageValue(cid, 39483))

I still don't understand what you mean with the rest.
I think this will exchange 2 storage only ?
I want it run on all player

what you mean with rest I didn't say rest ?!
 
This sets the storage value of the target to the killer.
Code:
setPlayerStorageValue(cid, 39483, getPlayerStorageValue(target, 39483))

This sets the storage value of the killer to the target.
Code:
setPlayerStorageValue(target, 39483, getPlayerStorageValue(cid, 39483))

With the rest I mean the other thins you posted about the npc.
Can you give an conversation example how this npc should work? So how it will look like if you talk to the npc ingame.
 
With the rest I mean the other thins you posted about the npc.
Can you give an conversation example how this npc should work? So how it will look like if you talk to the npc ingame.

I think he wants to make an npc who tp's you to the event position. And it has to count how many players already entered the event and tell that to the next player who wants to join.

Like
-hi
--do you want to join the event?
-yes
-(tp to event) msg: You are the 2nd one that joined........... (3rd,4th..)
 
This sets the storage value of the target to the killer.
Code:
setPlayerStorageValue(cid, 39483, getPlayerStorageValue(target, 39483))

This sets the storage value of the killer to the target.
Code:
setPlayerStorageValue(target, 39483, getPlayerStorageValue(cid, 39483))

With the rest I mean the other thins you posted about the npc.
Can you give an conversation example how this npc should work? So how it will look like if you talk to the npc ingame.

This happened 1 day in a week
Like :-
Player : hi
NPC :Hello |PLAYERNAME| , I'm the Battle event manger say {Join} to join the event , say {Rank} to see your rank ,{Best} to see the best rank
Player : join
NPC :you have joined the event you is the first player [If he is first] else you have joined the event and your place is 4 [If he come after the third] be careful because if you die with player who already in the event you will lose your place ,Good luck
Player : rank
NPC : doPlayerPopupFYI(cid, "your place is ".. getPlayerStorage(cid) .." keep it"
Player : Best
NPC : doPlayerPopupFYI(cid, "the best player ".. getPlayerStorageValue(player, 70100) == 1 .."
about last line I can't explain more in conversation I mean get player strage and if it = 1 then he is first ,=2 second,=3 third ,=4 fourth ,=5 fifth
 
You can set global storage to count the players the npcs teleports.
Code:
setGlobalStorageValue(39483, getGlobalStorageValue(39483) + 1)

Then in the textmessage (under where it sets global storage), you get check for the global storage to get which place someone is.
Code:
"..getGlobalStorageValue(39483).."
This will get the number of the place.

In the event you get set the global storage to 0 again when it's over.
 
You can set global storage to count the players the npcs teleports.
Code:
setGlobalStorageValue(39483, getGlobalStorageValue(39483) + 1)

Then in the textmessage (under where it sets global storage), you get check for the global storage to get which place someone is.
Code:
"..getGlobalStorageValue(39483).."
This will get the number of the place.

In the event you get set the global storage to 0 again when it's over.
why this give me this error ?
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)


function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid)             end
function onCreatureDisappear(cid)             npcHandler:onCreatureDisappear(cid)         end
function onCreatureSay(cid, type, msg)         npcHandler:onCreatureSay(cid, type, msg)     end
function onThink()                             npcHandler:onThink()                         end

npcHandler:setMessage(MESSAGE_GREET, "Greetings|PLAYERNAME| , I'm the Battle event manger say {Join} to join the event , say {Rank} to see your rank ,{Best} to see the best rank")

function Rank(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
   
   

local joinevent = KeywordNode:new({'join'})
local playerrank = KeywordNode:new({'ranking'})
local bestplayer = KeywordNode:new({'beskplayer'})


-- Join
if (parameters.join == true) then
if (getPlayerStorageValue(cid, 39483) < 1) then
setPlayerStorageValue(39483, getGlobalStorageValue(39483) + 1)
npcHandler:say("you have joined the event and your place is "..getGlobalStorageValue(39483).." ", cid)
else
npcHandler:say("you already join the event and your place is "..getGlobalStorageValue(39483).." ", cid)
end
end
npcHandler:addModule(FocusModule:new())

Code:
[10/06/2014 06:30:56] [Error - LuaScriptInterface::loadFile] data/npc/scripts/Dejin.lua:36: 'end' expected (to close 'function' at line 14) near '<eof>'
[10/06/2014 06:30:56] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/Dejin.lua
[10/06/2014 06:30:56] data/npc/scripts/Dejin.lua:36: 'end' expected (to close 'function' at line 14) near '<eof>'
 
You didn't close the function Rank, so there needs to be an extra end under the last end, also return true above that end you add.
 
You didn't close the function Rank, so there needs to be an extra end under the last end, also return true above that end you add.
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)


function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid)             end
function onCreatureDisappear(cid)             npcHandler:onCreatureDisappear(cid)         end
function onCreatureSay(cid, type, msg)         npcHandler:onCreatureSay(cid, type, msg)     end
function onThink()                             npcHandler:onThink()                         end

npcHandler:setMessage(MESSAGE_GREET, "Greetings|PLAYERNAME| , I'm the Battle event manger say {Join} to join the event , say {Rank} to see your rank ,{Best} to see the best rank")

function Rank(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
    return true
    end
  
  

local joinevent = KeywordNode:new({'join'})
local playerrank = KeywordNode:new({'ranking'})
local bestplayer = KeywordNode:new({'beskplayer'})


-- Join
if (parameters.join == true) then
if (getPlayerStorageValue(cid, 39483) < 1) then
setPlayerStorageValue(39483, getGlobalStorageValue(39483) + 1)
npcHandler:say("you have joined the event and your place is "..getGlobalStorageValue(39483).." ", cid)
else
npcHandler:say("you already join the event and your place is "..getGlobalStorageValue(39483).." ", cid)
end
end
npcHandler:addModule(FocusModule:new())

Code:
[10/06/2014 08:47:28] [Error - Npc interface]
[10/06/2014 08:47:29] data/npc/scripts/Dejin.lua
[10/06/2014 08:47:29] Description:
[10/06/2014 08:47:29] data/npc/scripts/Dejin.lua:28: attempt to index global 'parameters' (a nil value)
[10/06/2014 08:47:29] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/Dejin.lua
 
With last end I mean last end at the bottom of the script.
It work but why that ?
when I say "join" nothing happened
How to make it when I say join do this
Code:
if (getPlayerStorageValue(cid, 39483) < 1) then
setPlayerStorageValue(39483, getGlobalStorageValue(39483) + 1)
npcHandler:say("you have joined the event and your place is "..getGlobalStorageValue(39483).." ", cid)
else
npcHandler:say("you already join the event and your place is "..getGlobalStorageValue(39483).." ", cid)
end
end

Sorry but this my first time with NPC :p
 
With last end I mean last end at the bottom of the script.
@Limos Help me I made this and it might have problem this is conversation
10:08 Dejin: Greetings Admin , I'm the Battle event manger say Join to join the event , say Rank to see your rank ,Best to see the best rank
10:08 Admin [206]: join
10:08 Dejin: you already join the event and your place is 1
10:08 Admin [206]: join
10:08 Dejin: you already join the event and your place is 1
10:08 Admin [206]: join
10:08 Dejin: you already join the event and your place is 1
10:08 Admin [206]: rank
10:08 Dejin: your place number is 1 keep it
10:08 Admin [206]: rank
10:08 Dejin: your place number is 1 keep it
And this happened with all player and when say Best the 5 first players all line = -1
First =-1
second = -1
etc..

and this my LUA
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)            npcHandler:onCreatureSay(cid, type, msg)        end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
return true
end

function creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then

        return false
    end



-- Join
  if (msgcontains(msg, 'join')) then
  if (getGlobalStorageValue(cid, 39483) == -1) then
  setGlobalStorageValue(39483, getGlobalStorageValue(39483) + 2)
  else
if (getGlobalStorageValue(cid, 39483) < 0) then

setGlobalStorageValue(39483, getGlobalStorageValue(39483) + 1)
npcHandler:say("you have joined the event and your place is "..getGlobalStorageValue(39483).." ", cid)
else
npcHandler:say("you already join the event and your place is "..getGlobalStorageValue(39483).." ", cid)
end
end
end
  if (msgcontains(msg, 'rank')) then
  if (getGlobalStorageValue(cid, 39483) > -1 ) then
  selfSay("your place number is ".. getGlobalStorageValue(cid, 39483).." keep it ", cid)
  else
  selfSay("You are not join the event", cid)
  end
  end
    if (msgcontains(msg, 'best')) then
  selfSay("There is five player they are the best in event", cid)
  doPlayerPopupFYI(cid, "First : ".. getGlobalStorageValue(cid,39483,1).."\n \nSecond : "..getGlobalStorageValue(cid,39483,2).." \n \nThird : "..getGlobalStorageValue(cid,39483,3).." \n \nFourth : "..getGlobalStorageValue(cid,39483,4).." \n \nFivth : "..getGlobalStorageValue(cid,39483,5).."")
  end
    return true
    end
    npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Global storage is without cid, getGlobalStorageValue gets the value of the storage, so you don't write the value as parameter in the function.
What exactly are you trying to do with that first, second etc?
 
Global storage is without cid, getGlobalStorageValue gets the value of the storage, so you don't write the value as parameter in the function.
What exactly are you trying to do with that first, second etc?
So all Global must like this ?
Code:
if (getGlobalStorageValue( 39483) < 0) then

about first ,second etc
I made it to show the player first 5 player in event their storage [ 39483] from 1 to 5
when I say [best] it give you windows and their name in it
 
Global storage is without cid, getGlobalStorageValue gets the value of the storage, so you don't write the value as parameter in the function.
What exactly are you trying to do with that first, second etc?
Still say to all player your place number is 1 and it don't change

BUMP

@Limos BUMP

@Limos BUMP

@Limos BUMP

BUMP
 
Back
Top