TopllDan
Football <3
- Joined
- May 14, 2015
- Messages
- 66
- Reaction score
- 0
Hello I'm using this script it is typical only wanted to remove the option of NPCs channel that appears when I click on the computer
script
and I wanted to know to take members of the TOP level staff? GroupID of 4 to 6?
I've been researching and found that part of the source in game.cpp
up
script
Code:
function onJoinChannel(cid, channelId, users, isTv)
if channelId ==10then
doShowPokemonStatistics(cid)returnfalseend
if channelId ==11then
doPlayerPopupFYI(cid, getHighscoreString(8))returnfalseend
if channelId ==12then
doPlayerPopupFYI(cid, getHighscoreString(6))returnfalseend--////////////////////////////////////////////////////////////////////////////////////////--if channelId >=13and channelId <=18then
doSendAnimatedText(getThingPos(cid),(channelId-12).." Poke"..(channelId >13and"s"or""), COLOR_BURN)
setPlayerStorageValue(cid,52481,(channelId-12))
if isInParty(cid)then
local party = getPartyMembers(cid)
if#party >= 2 then
for i =1,#party do
if getPlayerStorageValue(party[i],52481)<=-1then --alterado v2.6 duel system
setPlayerStorageValue(party[i],52481,(channelId-12))
end
end
end
elseif not isInParty(cid)then
for _, sid in ipairs(getPlayersOnline())do
if getPlayerStorageValue(sid,52482)== getCreatureName(cid)then
if getPlayerStorageValue(sid,52481)==-1then
setPlayerStorageValue(sid,52481,(channelId-12))
end
end
end
end
addEvent(doSendAnimatedText,1000, getThingPos(cid),"BATTLE", COLOR_ELECTRIC)
doPlayerSetVocation(cid,1)
returnfalse
end
--////////////////////////////////////////////////////////////////////////////////////////--
if channelId >=100and channelId <=10000then
local owner = getPlayerByGUID(getChannelOwner(channelId))
if isChannelTv(channelId)thenif isCreature(owner)thenif owner ~= cid then
doPlayerWatchOther(cid, owner)local plural =#users == 1 and "" or "s"
doPlayerSendChannelMessage(owner,"TV Channel", getCreatureName(cid)..' is now watching your channel (currently '..#users..' player'..plural..' watching this channel).',15, channelId)else
setPlayerStorageValue(cid,99284,1)endend
elseif owner == cid then
setPlayerStorageValue(cid,99284,2)end
returntrueend
returntrueend
function onLeaveChannel(cid, channelId, users)
if channelId >=100and channelId <=10000then
local owner = getPlayerByGUID(getChannelOwner(channelId))
if isChannelTv(channelId)thenif owner ~= cid and getCreatureOutfit(cid).lookType ==814then
doPlayerStopWatching(cid)local plural =#users == 2 and "" or "s"
doPlayerSendChannelMessage(owner,"TV Channel", getCreatureName(cid)..' is not watching your channel anymore (currently '..#users -(1)..' player'..plural..' watching this channel).',15, channelId)
elseif owner == cid then
setPlayerStorageValue(cid,99284,-1)
doSendAnimatedText(getThingPos(cid),"CAM OFF",180)for stops =1,#users doif users[stops]~= owner then
doPlayerStopWatching(users[stops])endendend
elseif owner == cid then
setPlayerStorageValue(cid,99284,-1)end
returntrueend
returntrueend
function onMove(cid, fromPosition, toPosition)
-- Código não é mais necessário, feito em c++--Code deprecated, made in c++--ifnot canWalkOnPos(toPosition,false,false,false,true,false)and getPlayerStorageValue(cid,17000)>=1then-- doTeleportThing(cid, fromPosition,false)-- doPlayerSendCancel(cid,"Sorry, not possible.")--end
if getPlayerStorageValue(cid,99284)<=0thenreturntrueend
local speed = getCreatureSpeed(cid)local a = getWatchingPlayersFromPos(cid, fromPosition)
for b =1,#a doif getCreatureSpeed(a[b])~= speed then
doChangeSpeed(a[b],- getCreatureSpeed(a[b]))
doChangeSpeed(a[b], speed)end
doTeleportThing(a[b], toPosition,true)end
returntrueend
local permited ={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","x","w",",","'",'"',"y","z","1","2","3","4","5","6","7","8","9","0",".","!","@","#","$","%","&","*","(",")","-","_","+","/",";",":","?","^","~","{","[","}","]",">","<","£","¢","¬"}
function onTextEdit(cid, item, newText)
if item.itemid ==12330then
if getPlayerStorageValue(cid,99284)>=1then
doPlayerSendCancel(cid,"You are already on air!")returnfalseend
local channelName = getCreatureName(cid).."'s TV Channel"
ifstring.len(newText)<=0then
doPlayerSendCancel(cid,"Your channel is going to be shown as \""..getCreatureName(cid).."'s TV Channel\".")
elseif string.len(newText)>25then
doPlayerSendCancel(cid,"Your channel name can't have more than 25 characters.")returnfalseelse
channelName = newText
end
setPlayerStorageValue(cid,99284,1)
setPlayerStorageValue(cid,99285,"")
setPlayerStorageValue(cid,99285, channelName)
doPlayerCreatePrivateChannel(cid, channelName)
doSendAnimatedText(getThingPos(cid),"ON AIR!", COLOR_GRASS)
returnfalseend
returntrueend
![2s99jtf.png](/proxy.php?image=http%3A%2F%2Fi57.tinypic.com%2F2s99jtf.png&hash=49bc94c3d7a2f4e95978d0d54c53b685)
and I wanted to know to take members of the TOP level staff? GroupID of 4 to 6?
I've been researching and found that part of the source in game.cpp
Code:
boolGame::reloadHighscores(){
lastHighscoreCheck = time(NULL);for(int16_t i =0; i <9;++i)
highscoreStorage[i]= getHighscore(i);
returntrue;}
voidGame::checkHighscores(){
reloadHighscores();uint32_t tmp = g_config.getNumber(ConfigManager::HIGHSCORES_UPDATETIME)*60*1000;if(tmp <=0)return;
Scheduler::getInstance().addEvent(createSchedulerTask(tmp, boost::bind(&Game::checkHighscores,this)));}
std::stringGame::getHighscoreString(uint16_t skill){Highscore hs = highscoreStorage[skill];
std::stringstream ss;
ss <<"Highscore for "<< getSkillName(skill)<<"\n\nRank Level - Player Name";for(uint32_t i =0; i < hs.size(); i++)
ss <<"\n"<<(i +1)<<". "<< hs[i].second <<" - "<< hs[i].first;
ss <<"\n\nLast updated on:\n"<< std::ctime(&lastHighscoreCheck);return ss.str();}
HighscoreGame::getHighscore(uint16_t skill){Highscore hs;
Database* db =Database::getInstance();DBResult* result;
DBQuery query;if(skill >= SKILL__MAGLEVEL){if(skill == SKILL__MAGLEVEL)
query <<"SELECT `maglevel`, `name` FROM `players` ORDER BY `maglevel` DESC, `manaspent` DESC LIMIT "<< g_config.getNumber(ConfigManager::HIGHSCORES_TOP);else
query <<"SELECT `level`, `name` FROM `players` ORDER BY `level` DESC, `experience` DESC LIMIT "<< g_config.getNumber(ConfigManager::HIGHSCORES_TOP);
if(!(result = db->storeQuery(query.str())))return hs;
do{uint32_t level;if(skill == SKILL__MAGLEVEL)
level = result->getDataInt("maglevel");else
level = result->getDataInt("level");
std::string name = result->getDataString("name");if(name.length()>0)
hs.push_back(std::make_pair(name, level));}while(result->next());
result->free();}else{
query <<"SELECT `player_skills`.`value`, `players`.`name` FROM `player_skills`,`players` WHERE `player_skills`.`skillid`="<< skill <<" AND `player_skills`.`player_id`=`players`.`id` ORDER BY `player_skills`.`value` DESC, `player_skills`.`count` DESC LIMIT "<< g_config.getNumber(ConfigManager::HIGHSCORES_TOP);if(!(result = db->storeQuery(query.str())))return hs;
do{
std::string name = result->getDataString("name");if(name.length()>0)
hs.push_back(std::make_pair(name, result->getDataInt("value")));}while(result->next());
result->free();}
return hs;}
up
Last edited by a moderator: