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

When player have storage value=XXX then he can sell item.

witmar

New Member
Joined
Oct 21, 2008
Messages
248
Reaction score
0
Location
Poland, Dębica
Hello, i have problem.
I need script to npc which work some like that:

When player have storage value = XXX then he can sell and buy special items in Special npc shop.

Please Help me.
 
Just make a door and then NPC inside it.

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
			if getPlayerStorageValue(cid,XXXX) == 1
                if getCreaturePosition(cid).y < toPosition.y then
                        doTeleportThing(cid, {x=toPosition.x,y=toPosition.y+1,z=toPosition.z}, TRUE)
                else
                        doTeleportThing(cid, {x=toPosition.x,y=toPosition.y-1,z=toPosition.z}, TRUE)
                end
                doCreatureSay(cid, "MESSAGE!!", TALKTYPE_ORANGE_1)
                doSendMagicEffect(getCreaturePosition(cid), 10)
        else
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "CANCEL MESSAGE!")
        end
        return TRUE
end
 
is there a way that the player can only talk to an npc with "X" storage?

because im going to be using an npc system like this with 2 races so npc's on race (1) side wont talk to players on race (2) side
 
for nubs:
Code:
function greetCallback(cid)
	return getPlayerStorageValue(cid, XXX) > 0
end
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
 
Code:
function greetCallback(cid)
	return getPlayerStorageValue(cid, XXX) > 0 and npcHandler:say("You are welcome here!", cid) or npcHandler:say("You are not welcome here!", cid)
end
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
 
idk how u scripters deal with this daily..its beyond me lmfao.

Witmar if your serious about taking donations, then atleast learn to script dude theres plenty of tutorials out there.
 
Back
Top