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

[request] talkaction for kick.

GMNino

New Member
Joined
Jun 30, 2007
Messages
119
Reaction score
3
Hello!!

Need script for kick players of your accounts like !kick name.

requirements:

isPlayerPzLocked(cid) if players have pzlock say: "you cannot kick player pz locked",

getPlayerAccess(cid) if player is GM: say "you cannot kick any GM or GOD",

and this important..

getPlayerAccountId(cid) only can kick players of your account: say "sorry only can kick players of your account"

thanks.
 
Last edited:
Go to Execute -> Compile or Cntrl + F9 wait until the window says Done...

Then go to your sources folder and go to dev-cpp/, in that folder it will be created a .exe

Everytime you press Compile and it says Done it will be created or replaced a .exe in that folder :D

Copy the .exe and paste it to your Server!

Enjoy it

REP?
 
i maybe rep+ you but i execute in TFS .exe.it is possible?

eq i want change "You must enter account name".how i execute it in tfs.exe?
 
the case PlayerInfoPzLock: is in the getplayerinfo function..you also need to add in luascript.cpp somewhere

Code:
int32_t LuaScriptInterface::luaIsPlayerPzLocked(lua_State* L)
{
	return internalGetPlayerInfo(L, PlayerInfoPzLock);
}

and then towards the top
Code:
	lua_register(m_luaState, "isPlayerPzLocked", LuaScriptInterface::luaIsPlayerPzLocked);

that is all along with what you already posted in your last post

And you have to declare it in PlayerInfo table(?) at luascript.h, also. :)
 
Here is the .exe from the latest Mystic Spirit 0.2 with isPlayerPzLocked.

I didnt test it but it should work :D

i use your tfs.exe and this script, and if player have pz locked
is kicked :S

Code:
function onSay(cid, words, param)
    if(param == "") then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Command param required.")
        return FALSE
    end

    local player = getPlayerByName(param)
    local self = getPlayerName(cid)
    if isPlayer(player) == FALSE then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Player " .. param .. " is not currently online.")
        return FALSE
    end

    if(getPlayerGroupId(player) > 1) then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You cannot kick this player.")
        return FALSE
    end

    if(getAccountNumberByPlayerName(param) ~= getAccountNumberByPlayerName(self)) then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You can only kick players of your account.")
        return FALSE
    end

    if(isPlayerPzLocked(pid) == TRUE) then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You cannot kick pz locked players.")
        return TRUE
    end

    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, getCreatureName(player) .. " has been kicked.")
    doRemoveCreature(player)
    return FALSE
end
 
Know how to compile?

luascript.cpp, below isPlayer(cid) add
Code:
	//isPlayerPzLocked(cid)
	lua_register(m_luaState, "isPlayerPzLocked", LuaScriptInterface::luaIsPlayerPzLocked);

below playerInfoMarriage add
Code:
			case PlayerInfoPzLock:
				value = player->isPzLocked();
				break;

below luaGetPlayerPartner add
Code:
int32_t LuaScriptInterface::luaIsPlayerPzLocked(lua_State* L)
{
	return internalGetPlayerInfo(L, PlayerInfoPzLock);
}

luascript.h, below PlayerInfoMarriage add
Code:
PlayerInfoPzLock,

below luaIsPlayer add
Code:
static int32_t luaIsPlayerPzLocked(lua_State* L);

NOTE: Dont add exactly after what Ive said.
 
this sources dont have "playerInfoMarriage" , "luaGetPlayerPartner"
need this tag
Code:
http://svn.otland.net/public/forgottenserver/tags/0.2pl22/
whit isPlayerPzLocked, some one compiling for me?
 
Back
Top