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

[Talkaction]Main

Ecstacy

Mothafuckaaa
Joined
Dec 26, 2008
Messages
3,836
Reaction score
108
Location
The Netherlands
Hey,

I've just been starting this script, and it it just won't set the player townid.

PHP:
function onSay(cid, words, param)
local argpos = {x = 1333, y = 984, z = 7}
	if getPlayerLevel(cid) >= 8 and getPlayerStorageValue(cid, 123123) == -1 then
		doTeleportThing(cid, argpos)
		doPlayerSendTextMessage(cid,22,"You are now a citizen of arganoth")
		setPlayerTown(cid, 2)
		setPlayerStorageValue(cid, 123123, 1)
	else
		doPlayerSendCancel(cid,"You need to be level 8 or higher!")
	end
	return FALSE
end

I'm using TFS 0.3.4pl2.

It tells me it's a nill value :(

Could someone tell me the proper string to set a player's town id?

+rep

Thanks,
unknown1138
 
Try this one i've made

Lua:
-- Script made by diviinoo --

local config = {
        town = 5
        name = TOWN NAME
        pos = {x = xxx, y = xxx, z = x}
}

-- End of config --

function onSay(cid, words, param)
if getPlayerLevel(cid) >= 8
doTeleportThing(cid, config.pos)
    doPlayerSendTextMessage(cid,22,"You are now a citizen of config.name.")
    doPlayerSetTown(cid, config.town)
end
return TRUE
end

Not tested.. but it should work
 
Thanks, kind of obvious though :p

Also could you help me a bit?
It keeps telling me to end function

PHP:
--Arganoth--
local argpos = {x = 1333, y = 984, z = 7}
--Icarus--
local icapos = {x = 1333, y = 984, z = 7}
function onSay(cid, words, param)
	if param == {"arganoth"} then
		if getPlayerLevel(cid) >= 8 then
			if getPlayerStorageValue(cid, 123123) == -1 then
				doTeleportThing(cid, argpos)
				doPlayerSendTextMessage(cid,22,"You are now a citizen of arganoth")
				setPlayerSetTown(cid, 2)
				setPlayerStorageValue(cid, 123123, 1)
				doSendMagicEffect(getPlayerPosition, 12)
			else				
			doPlayerSendCancel(cid,"You are already in main!")
			end
			return TRUE
		else
		doPlayerSendCancel(cid,"You need to be level 8!")
		end
		return TRUE
	else
	end
	return FALSE
end

EDIT:
doesn't work when I type it..
Script edited.

P.S. don't mind icapos.

Thanks,
unknown666


@diviino
thanks, but I need more city's though


FIXED.
 
Last edited:
I thinks this should do it.. im not sure but try it

Lua:
local argpos = {x = 1333, y = 984, z = 7}

function onSay(cid, words, param)
        if getPlayerLevel(cid) >= 8 and getPlayerStorageValue(cid, 123123) == -1 then
                doTeleportThing(cid, argpos)
                doPlayerSendTextMessage(cid,22,"You are now a citizen of arganoth")
                 doPlayerSetTown(cid, 2)
                setPlayerStorageValue(cid, 123123, 1)
  	   doSendMagicEffect(getPlayerPosition(cid),12)
            else                
                doPlayerSendCancel(cid,"You are already a citizen of this city!")
            end
            return TRUE
	    end
	end
 
I thinks this should do it.. im not sure but try it

Lua:
local argpos = {x = 1333, y = 984, z = 7}

function onSay(cid, words, param)
        if getPlayerLevel(cid) >= 8 and getPlayerStorageValue(cid, 123123) == -1 then
                doTeleportThing(cid, argpos)
                doPlayerSendTextMessage(cid,22,"You are now a citizen of arganoth")
                 doPlayerSetTown(cid, 2)
                setPlayerStorageValue(cid, 123123, 1)
  	   doSendMagicEffect(getPlayerPosition(cid),12)
            else                
                doPlayerSendCancel(cid,"You are already a citizen of this city!")
            end
            return TRUE
	    end
	end

That part is already fixed as you can see I updated my lastest post, thanks though :thumbup:
+rep also.

Fixed, stupit mistake to add {} ._. :)
thanks for all help
 
Last edited:
Back
Top