• 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!

[HELP] Summon like warlock wow

Dewx

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

I have a script that a gm write !invoke player_name, and then the player recive a message telling him to type !accept or !reject to go to the gm position or not.

Well i think it should work well but i want to know if ther's a way to give a response time, so if you dont answear in 1 minute its like you rejected. Becase now if when you type accept if someone have tried to invoke you you can go to that position.

Sry for the english. jeje

talkactions code:
PHP:
<talkaction log="yes" words="!invoke" access="3" 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"/>
invoke.lua:
PHP:
function onSay(cid, words, param, channel)
    if(param ~= "")then
        local player = getPlayerByName(param)
		local pos = getCreaturePosition(cid)
        if(isPlayer(player))then
                setPlayerStorageValue(player, 30000, 1)
				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.")
        else
			doPlayerSendCancel(cid, "Wrong player.")
        end
    else
        doPlayerSendCancel(cid, "Please write the player name.")
    end
    return TRUE
end
invok.lua:
PHP:
function onSay(cid, words, param, channel)
	local pos = {x=getPlayerStorageValue(cid, 30001), y=getPlayerStorageValue(cid, 30002), z=getPlayerStorageValue(cid, 30003), stackpos=1}
	if(words=="!accept" and getPlayerStorageValue(cid, 30000)==1)then
		doTeleportThing(cid, pos)
	end
	setPlayerStorageValue(player, 30000, 0)
	return TRUE
end
 
Last edited:
Back
Top