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

Solved Only Promoted Players can use this talkaction?

WiLDTuRTLE

Member
Joined
Feb 26, 2011
Messages
478
Reaction score
5
So i've had a thread about another command and well i decided to make another thread ->

Code:
function onSay(cid, words, param, channel)
 
        if getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE and getHouseByPlayerGUID(getPlayerGUID(cid)) then
                doTeleportThing(cid, getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid))))
        else
		doSendMagicEffect(getPlayerPosition(cid),0)
        end
        return true 
end

This is the script (!home) Everyone can uses it and i want it only Promoted Players, thanks

PD: If anybody can add the line "You are PZ" and "You own no house" that would be greaT
repp+ for the otlander
 
The script in your other thread already has what you are looking for, only change it to 2 (or >= 1 if is should also be for first promotion).
LUA:
if getPlayerPromotionLevel(cid) == 2 then
If you are not sure how if/end works.
http://otland.net/f481/scripting-guide-74030/#post758243

About the textmessages, depense on what kind of textmessage you are looking for.
You can do this for example.
LUA:
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are PZ.")
This will give a green textmessage, for other kind of textmessages, you can look in 000-constant.lua.

Btw, if you are looking for basic things like this, try to look in other scripts that do the same and look how it's done there.
 
Last edited:
The script in your other thread already has what you are looking for, only change it to 2 (or >= 1 if is should also be for first promotion).
LUA:
if getPlayerPromotionLevel(cid) == 2 then
If you are not sure how if/end works.
http://otland.net/f481/scripting-guide-74030/#post758243

About the textmessages, depense on what kind of textmessage you are looking for.
You can do this for example.
LUA:
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are PZ.")
This will give a green textmessage, for other kind of textmessages, you can look in 000-constant.lua.

Btw, if you are looking for basic things like this, try to look in other scripts that do the same and look how it's done there.


Well yeah my bad you're totaly right Limos, i had the promo line but eh, Im totaly not sure about the (IfPlayerOwnNoHouse sendmsg ~~) ahah ;s you mind helping with that line? :)


UPDATE

Whats wrong about it..

Code:
function onSay(cid, words, param, channel)

       			if getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE and getHouseByPlayerGUID(getPlayerGUID(cid)) then
                	if getPlayerPromotionLevel(cid) == 2 then
		doTeleportThing(cid, getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid))))
        else
		doSendMagicEffect(getPlayerPosition(cid),0)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are PZ.")
        end
        return true 
end


33dy5ac.jpg

I dont get it
 
Last edited:
It doesn't matter what kind if message you use, only difference is how it looks.
If you don't understand how if/else/end works, look at the link I posted. You can also see there where to place things.
 
Rcedrick,
Try:
PHP:
function onSay(cid, words, param, channel)
	if getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE and getHouseByPlayerGUID(getPlayerGUID(cid)) then
		if getPlayerPromotionLevel(cid) == 2 then
			doTeleportThing(cid, getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid))))
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need promotion!")
		end
	else
		doSendMagicEffect(getPlayerPosition(cid),0)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are PZ.")
	end
	return true 
end
 
Rcedrick,
Try:
PHP:
function onSay(cid, words, param, channel)
	if getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE and getHouseByPlayerGUID(getPlayerGUID(cid)) then
		if getPlayerPromotionLevel(cid) == 2 then
			doTeleportThing(cid, getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid))))
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need promotion!")
		end
	else
		doSendMagicEffect(getPlayerPosition(cid),0)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are PZ.")
	end
	return true 
end

It always says "you need promotion" even if promoted.


I got it to work with your help =DD


Code:
function onSay(cid, words, param, channel)
    if getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE and getHouseByPlayerGUID(getPlayerGUID(cid)) then
    if getPlayerPromotionLevel(cid) >= 1 or getPlayerGroupId(cid) >= 4 then
            doTeleportThing(cid, getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid))))
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need promotion!")
        end
    else
        doSendMagicEffect(getPlayerPosition(cid),0)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are PZ.")
    end
    return true 
end
 
Last edited:
Try again:
PHP:
function onSay(cid, words, param, channel)
    if getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE and getHouseByPlayerGUID(getPlayerGUID(cid)) then
        if getPlayerPromotionLevel(cid) == 1 then
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need promotion!")
			return TRUE
        end
		doTeleportThing(cid, getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid))))
    else
        doSendMagicEffect(getPlayerPosition(cid),0)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are PZ.")
    end
    return true 
end
 
Back
Top