• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Wow warlock summoning

Dewx

New Member
Joined
Jun 14, 2008
Messages
9
Reaction score
0
Hi,

First of all the script its not tested im lazy to run mysql xD it should work for TFS 0.3.4

Well first explain how it works:

-A player type !invoke player_name.
-The player_name player gets a message telling him to type !accept or !reject in 2 minutes.
-If the player_name player types !accept he goes to the gm position when gm typed !invoke.
-If time expires player_name player can't get teleported there.

Well first add this code to talkactions.xml
PHP:
<talkaction log="yes" words="!invoke" access="0" event="script" value="invoke.lua"/>
<talkaction words="!accept" access="0" event="script" value="invok.lua"/>
<talkaction words="!reject" access="0" event="script" value="invok.lua"/>

Then create the file invoke.lua in your talkactions directory:
PHP:
function onSay(cid, words, param, channel)
    if(param ~= "")then
        local player = getPlayerByName(param)
        local pos = getCreaturePosition(cid)
        local expire = 60 * 60 * 2 -- time to expire invocation
        if(isPlayer(player))then
                setPlayerStorageValue(player, 30000, os.time()+expire)
                setPlayerStorageValue(player, 30001, pos.x)
                setPlayerStorageValue(player, 30002, pos.y)
                setPlayerStorageValue(player, 30003, pos.z)
                doPlayerSendTextMessage(cid, 19, "You have tried to invoke "..getPlayerName(player).." please wait him to write !accept or !reject.")
                doPlayerSendTextMessage(player, 19, ""..getPlayerName(cid).." is trying to invoke you to his position please type !accept or !reject you have only 2 minutes.")
        else
            doPlayerSendCancel(cid, "Wrong player.")
        end
    else
        doPlayerSendCancel(cid, "Please write the player name.")
    end
    return TRUE
end

And finally create invok.lua in the same directory:
PHP:
function onSay(cid, words, param, channel)
    local pos = {x=getPlayerStorageValue(cid, 30001), y=getPlayerStorageValue(cid, 30002), z=getPlayerStorageValue(cid, 30003), stackpos=1}
    local expire = getPlayerStorageValue(cid, 30000)
    if(words=="!accept" and expire > os.time())then
        doTeleportThing(cid, pos)
	else
		setPlayerStorageValue(player, 30000, 0)
    end
    return TRUE
end

Well if you found any errors post it here ^^
 
Last edited:
Good job! :)
I didnt test it, cause I dont think it would work on my server very well :p
You should enable this to every player, but when it ask's someone to teleport, it gets a higher delay, like 10 minutes to pull another one.

Nice script tho.
 
Heres my error! :p

14sjdzo.jpg
 
Good job! :)
I didnt test it, cause I dont think it would work on my server very well :p
You should enable this to every player, but when it ask's someone to teleport, it gets a higher delay, like 10 minutes to pull another one.

Nice script tho.

Pls try the new code sry for not testing it ^^U if it dont work now tell me again and i will try to change type of values
 
hmm i think they will abuse this talkaction, if somebody did a quest, like annihilator then he do !invoke and teleport a level 1 or something ;p
 

Ups xDDD i think that the time between its a little bad xDD well... beter use for gm so players can go or not at their own.

It will be nice to make this function to call every player on server xDD basicly for events and gm will be the only who can use this.
 
Back
Top