Ir para conteúdo

Vip System By Account V1.0


Kydrai

Posts Recomendados

error

 

 

[28/12/2012 21:06:07] [Error - TalkAction Interface]

[28/12/2012 21:06:07] data/talkactions/scripts/vipaccgod.lua:onSay

[28/12/2012 21:06:07] Description:

[28/12/2012 21:06:07] data/lib/vipAccount.lua:60: attempt to call field 'executeQuery' (a nil value)

[28/12/2012 21:06:07] stack traceback:

[28/12/2012 21:06:07] data/lib/vipAccount.lua:60: in function 'setVipTimeByAccount'

[28/12/2012 21:06:07] data/lib/vipAccount.lua:83: in function 'addVipDaysByAccount'

[28/12/2012 21:06:07] data/talkactions/scripts/vipaccgod.lua:15: in function <data/talkactions/scripts/vipaccgod.lua:1>

 

[28/12/2012 21:09:00] [Error - TalkAction Interface]

[28/12/2012 21:09:00] data/talkactions/scripts/vipaccplayer.lua:onSay

[28/12/2012 21:09:00] Description:

[28/12/2012 21:09:00] data/lib/vipAccount.lua:60: attempt to call field 'executeQuery' (a nil value)

[28/12/2012 21:09:00] stack traceback:

[28/12/2012 21:09:00] data/lib/vipAccount.lua:60: in function 'setVipTimeByAccount'

[28/12/2012 21:09:00] data/lib/vipAccount.lua:83: in function <data/lib/vipAccount.lua:77>

[28/12/2012 21:09:00] (tail call): ?

[28/12/2012 21:09:00] data/talkactions/scripts/vipaccplayer.lua:6: in function <data/talkactions/scripts/vipaccplayer.lua:1>

 

[28/12/2012 21:09:22] [Error - TalkAction Interface]

[28/12/2012 21:09:22] data/talkactions/scripts/vipaccgod.lua:onSay

[28/12/2012 21:09:22] Description:

[28/12/2012 21:09:22] data/lib/vipAccount.lua:34: attempt to call field 'executeQuery' (a nil value)

[28/12/2012 21:09:22] stack traceback:

[28/12/2012 21:09:22] data/lib/vipAccount.lua:34: in function 'installVip'

[28/12/2012 21:09:22] data/talkactions/scripts/vipaccgod.lua:5: in function <data/talkactions/scripts/vipaccgod.lua:1>

Link para o comentário
Compartilhar em outros sites

Não funciona nas versões mais recentes de otserv.

Talvez seja só mudar o nome da função, tenta mudar onde ta db.executeQuery por db.query.

Editado por kydrai
Link para o comentário
Compartilhar em outros sites

  • 6 months later...
  • 2 weeks later...
  • 1 month later...

Aqui quando eu executo o comando /installvip aparece o seguinte erro,

[Error - TalkAction Interface]
data/talkactions/scripts/vipaccgod.lua:onSay
Description:
data/lib/vipAccount.lua:34: attempt to call field 'executeQuery' (a nil value)
stack traceback:
data/lib/vipAccount.lua:34: in function 'installVip'
data/talkactions/scripts/vipaccgod.lua:5: in function <data/talkactions/
scripts/vipaccgod.lua:1>
Como resolvo???
Link para o comentário
Compartilhar em outros sites

  • 5 weeks later...
  • 2 years later...
  • 1 month later...

Estou com o seguinte problema no viplogin.lua
Quando termina a Vip o Jogador é teleportado para o Templo, ate ai tudo bem

Porem meu mapa tem rookgaard com townid=1 e quando eu logo com ele, ele vai pra main e o doPlayerSetTown(cid, townid) nao funciona, pq nao muda la na base. Obs uso sqlite Meu código ficou assim:

function onLogin(cid)
    local vip = isVip(cid)
    if getVipTime(cid) > 0 and vip == FALSE then
        local townid = 7 -- local que possui tp para city free
        if isRookie(cid) then
           townid = 1
        elseif getPlayerTown(cid) > 1 and getPlayerTown(cid) < 5 then
           townid = getPlayerTown(cid)
        end
        doPlayerSetTown(cid, townid)
        local templePos = getTownTemplePosition(townid)
        doTeleportThing(cid, templePos, false)
        setVipTime(cid, 0)
        doTeleportPlayers(cid, templePos)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua Vip acabou!")
    elseif vip == TRUE then
        local duration = getVipDate(cid)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você possui "..getVipDays(cid).." dia(s) de vip."..(duration and (" Ela irá durar até "..duration..".") or ""))
    end
    return TRUE
end
Link para o comentário
Compartilhar em outros sites

  • 2 weeks later...

Alguem pode me ajudar com vip status do character.php?

 

o meu está assim ja fiz de tudo e não funciona

 

<?PHP
$name = stripslashes(ucwords(strtolower(trim($_REQUEST['name']))));
if(empty($name)) {
$main_content .= '
<FORM ACTION="?subtopic=characters" METHOD=post>
<TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR>
<TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white>
<B>Search Character</B>
</TD></TR><TR>
<TD BGCOLOR="'.$config['site']['darkborder'].'">
<TABLE BORDER=0 CELLPADDING=1>
<TR><TD>Name:</TD>
<TD><INPUT NAME="name" VALUE=""SIZE=29 MAXLENGTH=29></TD>
<TD><INPUT TYPE=image NAME="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18>
</TD></TR></TABLE></TD></TR></TABLE></FORM>';
}
else
{
if(check_name($name)) {
$player = $ots->createObject('Player');
$player->find($name);
if($player->isLoaded()) {
$account = $player->getAccount();
$main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=0 HEIGHT=01 BORDER=0></TD><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Character Information</B></TD></TR>';
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=20%>Name:</TD><TD>';
$main_content .= $player->getName();
if($player->isDeleted())
$main_content .= ' <font color="red"><b>[DELETED]</b></font>';
if($player->isNameLocked())
$main_content .= ' <font color="red">[NAMELOCK]</font>';
$main_content .= '</TD></TR>';
$group = $player->getGroup();
if ($group == 2){$group_name = 'Tutor';}
if ($group == 3){$group_name = 'Senior Tutor';}
if ($group == 4){$group_name = 'Gamemaster';}
if ($group == 5){$group_name = 'Community Manager';}
if ($group == 6){$group_name = 'Administrator';}
if($group != 1){
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Position:</TD><TD>'.$group_name.'</TD></TR>';
}
// END Position Showing
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Sex:</TD><TD>';
$main_content .= ($player->getSex() == 0) ? 'female' : 'male';
$main_content .= '</TD></TR>';
if($player->getMarriage()){
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Marital status:</TD><TD>';
$marriage = new OTS_Player();
$marriage->load($player->getMarriage());
if($marriage->isLoaded())
$main_content .= 'married to <a href="?subtopic=characters&name='.urlencode($marriage->getName()).'"><b>'.$marriage->getName().'</b></a></TD></TR>';
else
$main_content .= 'single</TD></TR>';
}
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Profession:</TD><TD>'.$vocation_name[$player->getWorld()][$player->getPromotion()][$player->getVocation()].'</TD></TR>';
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Level:</TD><TD>'.$player->getLevel().'</TD></TR>';
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>World:</TD><TD>'.$config['site']['worlds'][$player->getWorld()].'</TD></TR>';
if(!empty($towns_list[$player->getWorld()][$player->getTownId()])){
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Residence:</TD><TD>'.$towns_list[$player->getWorld()][$player->getTownId()].'</TD></TR>';
}
$house = $SQL->query('SELECT `houses`.`name`, `houses`.`town`, `houses`.`paid` FROM `houses` WHERE `houses`.`world_id` = '.$player->getWorld().' AND `houses`.`owner` = '.$player->getId().';')->fetchAll();
if(count($house) != 0)
{
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>House:</TD><TD colspan="2">'.$house[0]['name'].' ('.$towns_list[$player->getWorld()][$house[0]['town']].')';
if ($house[0]['paid']){$main_content .=' is paid until '.date("M j Y", $house[0]['paid']);}
$main_content .='.</TD></TR>';
}
$rank_of_player = $player->getRank();
if(!empty($rank_of_player)){
{
$guild_id = $rank_of_player->getGuild()->getId();
$guild_name = $rank_of_player->getGuild()->getName();
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Guild Membership:</TD><TD>'.$rank_of_player->getName().' of the <a href="?subtopic=guilds&action=show&guild='.$guild_id.'">'.$guild_name.'</a></TD></TR>';
}
}
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
if($player->getLastLogin())
$main_content .= '<TR BGCOLOR='.$bgcolor.'><TD WIDTH="20%">Last login:</TD><TD>'.date("M j Y, H:i:s T", $player->getLastLogin()).'</TD></TR>';
else
$main_content .= '<TR BGCOLOR='.$bgcolor.'><TD WIDTH="20%">Last login:</TD><TD>Never logged in.</TD></TR>';
// VIP STATUS
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Account Status:</TD><TD>';
$main_content .= ($account->getPlayerVip_Time()) ? '<font color="green"><b>VIP Account</b></font>' : '<font color="red"><b>Not VIP Account</b></font>';
//Comment System
$comment = $player->getComment();
$newlines = array("\r\n", "\n", "\r");
$comment_with_lines = str_replace($newlines, '<br />', $comment, $count);
if($count < 50)
$comment = $comment_with_lines;
if(!empty($comment))
{
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD VALIGN="top">Comment:</TD><TD>'.$comment.'</TD></TR>';
}
$main_content .='
</td>
</tr>
</table>
</div>
<div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" />
</div>
<div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" />
</div>
<div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" />
</div>
</div>
</div>
</td>
</tr>
</table>
';
$deads = 0;
$player_deaths = $SQL->query('SELECT `id`, `date`, `level` FROM `player_deaths` WHERE `player_id` = '.$player->getId().' ORDER BY `date` DESC LIMIT 0,10;');
foreach($player_deaths as $death)
{
if(is_int($number_of_rows / 2))
$bgcolor = $config['site']['darkborder']; else $bgcolor = $config['site']['lightborder'];
$number_of_rows++; $deads++;
$dead_add_content .= "<tr bgcolor=\"".$bgcolor."\">
<td width=\"30%\" align=\"center\">".date("M j Y, H:i:s T", $death['date'])."</td>
<td>";
$killers = $SQL->query("SELECT environment_killers.name AS monster_name, players.name AS player_name, players.deleted AS player_exists FROM killers LEFT JOIN environment_killers ON killers.id = environment_killers.kill_id
LEFT JOIN player_killers ON killers.id = player_killers.kill_id LEFT JOIN players ON players.id = player_killers.player_id
WHERE killers.death_id = ".$SQL->quote($death['id'])." ORDER BY killers.final_hit DESC, killers.id ASC")->fetchAll();
$i = 0;
$count = count($killers);
foreach($killers as $killer)
{
$i++;
if(in_array($i, array(1, $count)))
$killer['monster_name'] = str_replace(array("an ", "a "), array("", ""), $killer['monster_name']);
if($killer['player_name'] != "")
{
if($i == 1)
$dead_add_content .= "Killed at level <b>".$death['level']."</b> by ";
else if($i == $count)
$dead_add_content .= " and by ";
else
$dead_add_content .= ", ";
if($killer['monster_name'] != "")
$dead_add_content .= $killer['monster_name']." summoned by ";
if($killer['player_exists'] == 0)
$dead_add_content .= "<a href=\"index.php?subtopic=characters&name=".urlencode($killer['player_name'])."\">";
$dead_add_content .= $killer['player_name'];
if($killer['player_exists'] == 0)
$dead_add_content .= "</a>";
}
else
{
if($i == 1)
$dead_add_content .= "Died at level <b>".$death['level']."</b> by ";
else if($i == $count)
$dead_add_content .= " and by ";
else
$dead_add_content .= ", ";
$dead_add_content .= $killer['monster_name'];
}
if($i == $count)
$dead_add_content .= "";
}
$dead_add_content .= ".</td></tr>";
}
if($deads > 0)
$main_content .= '<BR/><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Character Deaths</B></TD></TR>' . $dead_add_content . '</TABLE>';
//end
if(!$player->getHideChar()) {
$main_content .= '<BR /><TABLE BORDER=0><TR><TD></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Account Information</B></TD></TR>';
if($account->getRLName())
{
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR='.$bgcolor.'><TD WIDTH=20%>Real name:</TD><TD>'.$account->getRLName().'</TD></TR>';
}
if($account->getLocation())
{
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR='.$bgcolor.'><TD WIDTH=20%>Location:</TD><TD>'.$account->getLocation().'</TD></TR>';
}
$group = $player->getGroup();
if ($group == 2){$group_name = 'Tutor';}
if ($group == 3){$group_name = 'Senior Tutor';}
if ($group == 4){$group_name = 'Gamemaster';}
if ($group == 5){$group_name = 'Community Manager';}
if ($group == 6){$group_name = 'Administrator';}
if($group != 1){
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Position:</TD><TD>'.$group_name.'</TD></TR>';
}
if($player->getCreated())
{
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Created:</TD><TD>'.date("M j Y, H:i:s T", $player->getCreated()).'</TD></TR>';
}
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
if($account->getLastLogin())
$main_content .= '<TR BGCOLOR='.$bgcolor.'><TD WIDTH="20%">Last login:</TD><TD>'.date("M j Y, H:i:s T", $account->getLastLogin()).'</TD></TR>';
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$ban_types = array(1 => 'IP Banishment', 2 => 'Namelock', 3 => 'Account Banishment', 4 => 'Notation', 5 => 'Until Deletion');
$ban_reason = array("Offensive Name", "Invalid Name Format", "Unsuitable Name", "Name Inciting Rule Violation", "Offensive Statement", "Spamming", "Illegal Advertising", "Off-Topic Public Statement", "Non-English Public Statement", "Inciting Rule Violation", "Bug Abuse", "Game Weakness Abuse", "Using Unofficial Software to Play", "Hacking", "Multi-Clienting", "Account Trading or Sharing", "Threatening Gamemaster", "Pretending to Have Influence on Rule Enforcer", "False Report to Gamemaster", "Destructive Behaviour", "Excessive Unjustified Player Killing", "Invalid Payment", "Spoiling Auction");
$players_banned = $SQL->query('SELECT * FROM `bans` WHERE `value` = '.$account->getCustomField('id').'')->fetchAll();
foreach($players_banned as $player) {
if($account->isBanned())
if($account->getBanTime() > 0)
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Banished:</td><td><font color="red"><b>Account Banishment</b> <br /><b>Expires:</b> '.date("j F Y, G:i A", $account->getBanTime()).' - '.$ban_reason[$player['reason']].'</font></td></tr>';
else
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Banished:</td><td><font color="red"><b>Banished Forever</font></td></tr>';
}
$main_content .= '</TD></TR></TABLE>';
$main_content .= '<br /><TABLE BORDER=0><TR><TD></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=5 CLASS=white><B>Characters</B></TD></TR>
<TR BGCOLOR='.$config['site']['darkborder'].'><TD><B>Name</B></TD><TD><B>World</B></TD><TD><B>Level</B></TD><TD><b>Status</b></TD><TD><B> </B></TD></TR>';
$account_players = $account->getPlayersList();
$account_players->orderBy('name');
$player_number = 0;
foreach($account_players as $player_list)
{
if(!$player_list->getHideChar())
{
$player_number++;
if(is_int($player_number / 2))
$bgcolor = $config['site']['darkborder'];
else
$bgcolor = $config['site']['lightborder'];
if(!$player_list->isOnline())
$player_list_status = '';
else
$player_list_status = '<b style="color:green;">online</b>';
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=52%><NOBR>'.$player_number.'. '.$player_list->getName();
$main_content .= '</NOBR></TD><TD WIDTH=15%>'.$config['site']['worlds'][$player_list->getWorld()].'</TD><TD WIDTH=25%>'.$player_list->getLevel().' '.$vocation_name[$player_list->getWorld()][$player_list->getPromotion()][$player_list->getVocation()].'</TD><TD WIDTH="8%">'.$player_list_status.'</TD><TD><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=characters" METHOD=post><TR><TD><INPUT TYPE=hidden NAME=name VALUE="'.$player_list->getName().'"><INPUT TYPE=image NAME="View '.$player_list->getName().'" ALT="View '.$player_list->getName().'" SRC="'.$layout_name.'/images/buttons/sbutton_view.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></FORM></TABLE></TD></TR>';
}
}
$main_content .= '</TABLE></TD><TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD></TR></TABLE>';
}
$main_content .= '<br /><br /><FORM ACTION="?subtopic=characters" METHOD=post><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'"><TABLE BORDER=0 CELLPADDING=1><TR><TD>Name:</TD><TD><INPUT NAME="name" VALUE=""SIZE=29 MAXLENGTH=29></TD><TD><INPUT TYPE=image NAME="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>';
$main_content .= '</TABLE>';
}
else
$search_errors[] = 'Character <b>'.$name.'</b> does not exist.';
}
else
$search_errors[] = 'This name contains invalid letters. Please use only A-Z, a-z and space.';
if(!empty($search_errors))
{
$main_content .= '
<div class="SmallBox" >
<div class="MessageContainer" >
<div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
<div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
<div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
<div class="ErrorMessage" >
<div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
<div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
<div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div>
<b>The Following Errors Have Occurred:</b><br />';
foreach($search_errors as $search_error)
$main_content .= '<li>'.$search_error;
$main_content .= '</div>
<div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
<div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
<div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
</div>
</div>
<br />';
$main_content .= '<BR /><FORM ACTION="?subtopic=characters" METHOD=post><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'"><TABLE BORDER=0 CELLPADDING=1><TR><TD>Name:</TD><TD><INPUT NAME="name" VALUE=""SIZE=29 MAXLENGTH=29></TD><TD><INPUT TYPE=image NAME="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>';
}
}
?>
Link para o comentário
Compartilhar em outros sites

  • 3 weeks later...

Eu executei o comando /installvip

Apareceu isso no default : Vip System instalado com sucesso!
Mais na Distro apareceu : Error during getDataInt(viptime)
Logo em seguida fui na database executar a query : ALTER TABLE `accounts` ADD viptime INT(15) NOT NULL DEFAULT 0;

E apareceu esse Erro : Error while executing query: duplicate column name: viptime

Fui tentar usar o comando /addvip em uma player , foi adicionado 5 dias , mais quando tento entrar aparece esse erro na distro.
E NÃO CONSIGO MAIS LOGAR !
Oque eu faço ?
Editado por leozinpbb
Link para o comentário
Compartilhar em outros sites

  • 4 weeks later...
  • 2 years later...
Em 04/07/2010 em 22:23, Kydrai disse:

 

Vip System by Account 1.0



By Kydrai

 

 

 

Este é um vip system por account, ou seja, um sistema de vip válido para todos os characters de uma determinada conta.

 

O script foi testado no TFS 0.3.6 - 8.54.

E no site Gesior 0.3.4 beta4.

Em caso de erros ou dúvidas é só postar.

 

 

Funções do Script

 

 

Função necessária para começar a usar o script:

installVip() -> Cria a coluna no banco de dados para usar o sistema de vip (testei somente em sqlite, mas acredito que funcione em mysql)

 

Funções que utilizam o account id:

doTeleportPlayersByAccount(acc, topos) -> Teleporta todos os players da account

getVipTimeByAccount(acc) -> Pega o tempo de vip

setVipTimeByAccount(acc, time) -> Edita o tempo de vip

getVipDaysByAccount(acc) -> Pega o tempo de vip em dias

isVipAccount(acc) -> Verifica se é vip

addVipDaysByAccount(acc, days) -> Adiciona dias de vip

doRemoveVipDaysByAccount(acc, days) -> Remove dias de vip

getVipDateByAccount(acc) -> Pega a data e hora que irá terminar a vip

 

Funções que utilizam o creature id (cid):

doTeleportPlayers(cid, topos) -> Teleporta todos os players da account

getVipTime(cid) -> Pega o tempo de vip

setVipTime(cid, time) -> Edita o tempo de vip

getVipDays(cid) -> Pega o tempo de vip em dias

isVip(cid) -> Verifica se é vip

addVipDays(cid, days) -> Adiciona dias de vip

doRemoveVipDays(cid, days) -> Remove dias de vip

getVipDate(cid) -> Pega a data e hora que irá terminar a vip

 

 

Inserindo as funções

 

 

Abra a pasta data/lib, crie um arquivo lua e coloque:

vipAccount.lua

 


--[[
Name: Vip System by Account
Version: 1.0
Author: Kydrai
Forum: http://www.xtibia.com/forum/topic/136543-vip-system-by-account-v10/

[Functions]
	-- Install
	installVip()

	-- By Account
	doTeleportPlayersByAccount(acc, topos)
	getVipTimeByAccount(acc)
	setVipTimeByAccount(acc, time)
	getVipDaysByAccount(acc)
	isVipAccount(acc)
	addVipDaysByAccount(acc, days)
	doRemoveVipDaysByAccount(acc, days)
	getVipDateByAccount(acc)

	-- By Player
	doTeleportPlayers(cid, topos)
	getVipTime(cid)
	setVipTime(cid, time)
	getVipDays(cid)
	isVip(cid)
	addVipDays(cid, days)
	doRemoveVipDays(cid, days)
	getVipDate(cid)
]]--

-- Install
function installVip()
if db.executeQuery("ALTER TABLE `accounts` ADD viptime INT(15) NOT NULL DEFAULT 0;") then
	print("[Vip System] Vip System instalado com sucesso!")
	return TRUE
end
print("[Vip System] Não foi possível instalar o Vip System!")
return FALSE
end

-- By Account
function doTeleportPlayersByAccount(acc, topos)
if db.executeQuery("UPDATE `players` SET `posx` = "..topos.x..", `posy` = "..topos.y..", `posz` = "..topos.z.." WHERE `account_id` = "..acc..";") then
	return TRUE
end
return FALSE
end

function getVipTimeByAccount(acc)
local vip = db.getResult("SELECT `viptime` FROM `accounts` WHERE `id` = "..acc..";")
if vip:getID() == -1 then
	print("[Vip System] Account not found!")
	return FALSE
end
return vip:getDataInt("viptime")
end

function setVipTimeByAccount(acc, time)
if db.executeQuery("UPDATE `accounts` SET `viptime` = "..time.." WHERE `id` = "..acc..";") then
	return TRUE
end
return FALSE
end

function getVipDaysByAccount(acc)
local vipTime = getVipTimeByAccount(acc)
local timeNow = os.time()
local days = math.ceil((vipTime - timeNow)/(24 * 60 * 60))
return days <= 0 and 0 or days
end

function isVipAccount(acc)
return getVipDaysByAccount(acc) > 0 and TRUE or FALSE
end

function addVipDaysByAccount(acc, days)
if days > 0 then
	local daysValue = days * 24 * 60 * 60
	local vipTime = getVipTimeByAccount(acc)
	local timeNow = os.time()
	local time = getVipDaysByAccount(acc) == 0 and (timeNow + daysValue) or (vipTime + daysValue)
	setVipTimeByAccount(acc, time)
	return TRUE
end
return FALSE
end

function doRemoveVipDaysByAccount(acc, days)
if days > 0 then
	local daysValue = days * 24 * 60 * 60
	local vipTime = getVipTimeByAccount(acc)
	local time = vipTime - daysValue
	setVipTimeByAccount(acc, (time <= 0 and 1 or time))
	return TRUE
end
return FALSE
end

function getVipDateByAccount(acc)
if isVipAccount(acc) then
	local vipTime = getVipTimeByAccount(acc)
	return os.date("%d/%m/%y %X", vipTime)
end
return FALSE
end

-- By Player
function doTeleportPlayers(cid, topos)
doTeleportPlayersByAccount(getPlayerAccountId(cid), topos)
end

function getVipTime(cid)
return getVipTimeByAccount(getPlayerAccountId(cid))
end

function setVipTime(cid, time)
return setVipTimeByAccount(getPlayerAccountId(cid), time)
end

function getVipDays(cid)
return getVipDaysByAccount(getPlayerAccountId(cid))
end

function isVip(cid)
return isVipAccount(getPlayerAccountId(cid))
end

function addVipDays(cid, days)
return addVipDaysByAccount(getPlayerAccountId(cid), days)
end

function doRemoveVipDays(cid, days)
return doRemoveVipDaysByAccount(getPlayerAccountId(cid), days)
end

function getVipDate(cid)
return getVipDateByAccount(getPlayerAccountId(cid))
end
 

 

 

Exemplos de uso

 

 

Talkaction

 

GOD:

/installvip

/addvip name, days

/removevip name, days

/checkvip name

 

Player:

/buyvip

/vipdays

 

talkactions.xml:

 


<talkaction log="yes" access="5" words="/installvip;/addvip;/removevip;/checkvip" event="script" value="vipaccgod.lua"/>
<talkaction words="/buyvip;/vipdays" event="script" value="vipaccplayer.lua"/>
 

 

vipaccgod.lua:

 


function onSay(cid, words, param, channel)
local t = param:explode(",")
local name, days = t[1], tonumber(t[2])
if words == "/installvip" then
	if installVip() then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Vip System instalado com sucesso!")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Não foi possível instalar o Vip System!")
	end
elseif words == "/addvip" then
	if name then
		if days then
			local acc = getAccountIdByName(name)
			if acc ~= 0 then
				addVipDaysByAccount(acc, days)
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você adicionou "..days.." dia(s) de vip ao "..name..", agora ele possui "..getVipDaysByAccount(acc).." dia(s) de vip.")
			else
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este player não existe.")
			end
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode adicionar essa quantidade de dia(s) de vip.")
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode adicionar dia(s) de vip a este player.")
	end
elseif words == "/removevip" then
	if name then
		if days then
			local acc = getAccountIdByName(name)
			if acc ~= 0 then
				doRemoveVipDaysByAccount(acc, days)
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você retirou "..days.." dia(s) de vip do "..name..", agora ele possui "..getVipDaysByAccount(acc).." dia(s) de vip.")
			else
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este player não existe.")
			end
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode retirar essa quantidade de dia(s) de vip.")
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode retirar dia(s) de vip a este player.")
	end
elseif words == "/checkvip" then
	if name then
		local acc = getAccountIdByName(name)
		if acc ~= 0 then
			local duration = getVipDateByAccount(acc)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O "..name.." possui "..getVipDaysByAccount(acc).." dias de vip."..(duration and (" Ela irá durar até "..duration..".") or ""))
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este player não existe.")
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode visualizar os dias de vip a este player.")
	end
end
return TRUE
end
 

 

vipaccplayer.lua:

 


function onSay(cid, words, param, channel)
if words == "/buyvip" then
	local price = 1000000
	local days = 30
	if doPlayerRemoveMoney(cid, price) then
		addVipDays(cid, days)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você adicionou "..days.." dia(s) de vip, agora você possui "..getVipDays(cid).." dia(s) de vip.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você precisa de "..price.." para adicionar "..days.." dia(s) de vip.")
	end

elseif words == "/vipdays" then
	local duration = getVipDate(cid)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você possui "..getVipDays(cid).." dia(s) de vip."..(duration and (" Ela irá durar até "..duration..".") or ""))
end
return TRUE
end
 

 

Movement (Tile)

 

Coloque actionid 15000 em um tile onde somente os vips poderão passar.

 

movements.xml:

 


<movevent type="StepIn" actionid="15000" event="script" value="viptile.lua"/>
 

 

 

viptile.lua:

 


function onStepIn(cid, item, position, fromPosition)
if isVip(cid) == FALSE then
	doTeleportThing(cid, fromPosition, false)
	doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente players vip podem passar.")
end
return TRUE
end
 

 

Creaturescript (Login)

 

Quando player logar irá verificar se a vip do player acabou, se sim então irá teleportar todos os players da account para o templo, se não irá mostrar o tempo da vip.

 

creaturescripts.xml:

 


<event type="login" name="viplogin" script="viplogin.lua"/>
 

 

 

viplogin.lua:

 


function onLogin(cid)
local vip = isVip(cid)
if getVipTime(cid) > 0  and vip == FALSE then
	local townid = 1
	doPlayerSetTown(cid, townid)
	local templePos = getTownTemplePosition(getPlayerTown(cid))
	doTeleportThing(cid, templePos, false)
	setVipTime(cid, 0)
	doTeleportPlayers(cid, templePos)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua Vip acabou!")
elseif vip == TRUE then
	local duration = getVipDate(cid)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você possui "..getVipDays(cid).." dia(s) de vip."..(duration and (" Ela irá durar até "..duration..".") or ""))
end
return TRUE
end
 

 

Action (Door)

 

Coloque actionid 15001 na door onde somente os vips poderão passar. Use a porta gate of expertise (id: 1227)

 

actions.xml:

 


<action actionid="15001" script="vipdoor.lua"/>
 

 

 

vipdoor.lua:

 


function onUse(cid, item, fromPosition, itemEx, toPosition)
if isVip(cid) == FALSE then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Somente players vip podem passar.")
elseif item.itemid == 1227 then
	doTransformItem(item.uid, item.itemid + 1)
	doTeleportThing(cid, toPosition)
end
return TRUE
end
 

 

NPC (Vendedor de VIP)

 

vipnpc.xml:

 


<?xml version="1.0" encoding="UTF-8"?>
<npc name="Vendedor de VIP" script="vipnpc.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="128" head="17" body="54" legs="114" feet="0" addons="2"/>
<parameters>
	<parameter key="message_greet" value="Hello |PLAYERNAME|, I sell {vip} days."/>
</parameters>
</npc>
 

 

 

vipnpc.lua:

 


local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end

function buyVip(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
	return false
end

if doPlayerRemoveMoney(cid, parameters.price) then
	addVipDays(cid, parameters.days)
	npcHandler:say('Thanks, you buy '..parameters.days..' vip days. You have '..getVipDays(cid)..' vip days.', cid)
else
	npcHandler:say('Sorry, you don\'t have enough money.', cid)
end

npcHandler:resetNpc()
return true
end

local node1 = keywordHandler:addKeyword({'vip'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want buy 30 vip days for 1000000 gp\'s?'})
node1:addChildKeyword({'yes'}, buyVip, {price = 1000000, days = 30})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true})

npcHandler:addModule(FocusModule:new())
 

 

 

 

Erros e Soluções

 

 

 

 

Configurando o Gesior

 

 

Com essa configuração irá aparecer o vip status do player no site e será possível vender vip pelo site.

Se eu esqueci de alguma coisa é só avisar.

 

accountmanagement.php

Depois de:

 


if(!$account_logged->isPremium())
$account_status = '<b><font color="red">Free Account</font></b>';
else
$account_status = '<b><font color="green">Premium Account, '.$account_logged->getPremDays().' days left</font></b>';
 

 

Adicione:

 


if(!$account_logged->isVip())
$account_vip_status = '<b><font color="red">Not Vip Account</font></b>';
else
$account_vip_status = '<b><font color="green">Vip Account, '.$account_logged->getVipDays().' days left</font></b>';
 

 

Depois de:

 


<td class="LabelV" >Account Status:</td><td>'.$account_status.'</td></tr><tr style="background-color:'.$config['site']['darkborder'].';" >
 

 

Adicione:

 


<td class="LabelV" >Account Vip Status:</td><td>'.$account_vip_status.'</td></tr><tr style="background-color:'.$config['site']['darkborder'].';" >
 

 

 

pot/OTS_Account.php

Substitua:

 


private $data = array('email' => '', 'blocked' => false, 'rlname' => '','location' => '','page_access' => 0,'lastday' => 0,'premdays' => 0, 'created' => 0);
 

 

Por:

 


private $data = array('email' => '', 'blocked' => false, 'rlname' => '','location' => '','page_access' => 0,'lastday' => 0,'premdays' => 0, 'created' => 0, 'viptime' => 0);
 

 

Substitua:

 


$this->data = $this->db->query('SELECT ' . $this->db->fieldName('id') . ', ' . $this->db->fieldName('name') . ', ' . $this->db->fieldName('password') . ', ' . $this->db->fieldName('email') . ', ' . $this->db->fieldName('blocked') . ', ' . $this->db->fieldName('rlname') . ', ' . $this->db->fieldName('location') . ', ' . $this->db->fieldName('page_access') . ', ' . $this->db->fieldName('premdays') . ', ' . $this->db->fieldName('lastday') . ', ' . $this->db->fieldName('created') . ' FROM ' . $this->db->tableName('accounts') . ' WHERE ' . $this->db->fieldName('id') . ' = ' . (int) $id)->fetch();
 

 

Por:

 


$this->data = $this->db->query('SELECT ' . $this->db->fieldName('id') . ', ' . $this->db->fieldName('name') . ', ' . $this->db->fieldName('password') . ', ' . $this->db->fieldName('email') . ', ' . $this->db->fieldName('blocked') . ', ' . $this->db->fieldName('rlname') . ', ' . $this->db->fieldName('location') . ', ' . $this->db->fieldName('page_access') . ', ' . $this->db->fieldName('premdays') . ', ' . $this->db->fieldName('viptime') . ', ' . $this->db->fieldName('lastday') . ', ' . $this->db->fieldName('created') . ' FROM ' . $this->db->tableName('accounts') . ' WHERE ' . $this->db->fieldName('id') . ' = ' . (int) $id)->fetch();
 

 

Substitua:

 


$this->db->query('UPDATE ' . $this->db->tableName('accounts') . ' SET ' . $this->db->fieldName('password') . ' = ' . $this->db->quote($this->data['password']) . ', ' . $this->db->fieldName('email') . ' = ' . $this->db->quote($this->data['email']) . ', ' . $this->db->fieldName('blocked') . ' = ' . (int) $this->data['blocked'] . ', ' . $this->db->fieldName('rlname') . ' = ' . $this->db->quote($this->data['rlname']) . ', ' . $this->db->fieldName('location') . ' = ' . $this->db->quote($this->data['location']) . ', ' . $this->db->fieldName('page_access') . ' = ' . (int) $this->data['page_access'] . ', ' . $this->db->fieldName('premdays') . ' = ' . (int) $this->data['premdays'] . ', ' . $this->db->fieldName('lastday') . ' = ' . (int) $this->data['lastday'] . ' WHERE ' . $this->db->fieldName('id') . ' = ' . $this->data['id']);
 

 

Por:

 


$this->db->query('UPDATE ' . $this->db->tableName('accounts') . ' SET ' . $this->db->fieldName('password') . ' = ' . $this->db->quote($this->data['password']) . ', ' . $this->db->fieldName('email') . ' = ' . $this->db->quote($this->data['email']) . ', ' . $this->db->fieldName('blocked') . ' = ' . (int) $this->data['blocked'] . ', ' . $this->db->fieldName('rlname') . ' = ' . $this->db->quote($this->data['rlname']) . ', ' . $this->db->fieldName('location') . ' = ' . $this->db->quote($this->data['location']) . ', ' . $this->db->fieldName('page_access') . ' = ' . (int) $this->data['page_access'] . ', ' . $this->db->fieldName('premdays') . ' = ' . (int) $this->data['premdays'] . ', ' . $this->db->fieldName('viptime') . ' = ' . (int) $this->data['viptime'] . ', ' . $this->db->fieldName('lastday') . ' = ' . (int) $this->data['lastday'] . ' WHERE ' . $this->db->fieldName('id') . ' = ' . $this->data['id']);
 

 

Depois de:

 


public function getPremDays()
{
if( !isset($this->data['premdays']) || !isset($this->data['lastday']) )
{
	throw new E_OTS_NotLoaded();
}

return $this->data['premdays'] - (date("z", time()) + (365 * (date("Y", time()) - date("Y", $this->data['lastday']))) - date("z", $this->data['lastday']));
}
 

 

Adicione:

 


public function getVipDays()
{
if( !isset($this->data['viptime']) || !isset($this->data['lastday']) )
{
	throw new E_OTS_NotLoaded();
}

return ceil(($this->data['viptime'] - time()) / (24*60*60));
}
 

 

Depois de:

 


public function isPremium()
{
return ($this->data['premdays'] - (date("z", time()) + (365 * (date("Y", time()) - date("Y", $this->data['lastday']))) - date("z", $this->data['lastday'])) > 0);
}
 

 

Adicione:

 


public function isVip()
{
return ceil(($this->data['viptime'] - time()) / (24*60*60)) > 0;
}
 

 

 

characters.php

Substitua:

 


if($config['site']['show_vip_status'])
{
$id = $player->getCustomField("id");
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=10%>Vip Status:</TD>';
$vip = $SQL->query('SELECT * FROM player_storage WHERE player_id = '.$id.' AND `key` = '.$config['site']['show_vip_storage'].';')->fetch();
if($vip == false) {
	$main_content .= '<TD><span class="red"><B>NOT VIP</B></TD></TR>';
}
else
{
	$main_content .= '<TD><span class="green"><B>VIP</B></TD></TR>';
}
$comment = $player->getComment();
$newlines   = array("\r\n", "\n", "\r");
$comment_with_lines = str_replace($newlines, '<br />', $comment, $count);
if($count < 50)
	$comment = $comment_with_lines;
if(!empty($comment))
{
	if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
	$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD VALIGN=top>Comment:</TD><TD>'.$comment.'</TD></TR>';
}
}
 

 

Por:

 


if($config['site']['show_vip_status'])
{
$id = $player->getCustomField("id");
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=10%>Account Vip Status:</TD>';
if(!$account->isVip()) {
	$main_content .= '<TD><span class="red"><B>NOT VIP</B></TD></TR>';
}
else
{
	$main_content .= '<TD><span class="green"><B>VIP</B></TD></TR>';
}
$comment = $player->getComment();
$newlines   = array("\r\n", "\n", "\r");
$comment_with_lines = str_replace($newlines, '<br />', $comment, $count);
if($count < 50)
	$comment = $comment_with_lines;
if(!empty($comment))
{
	if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
	$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD VALIGN=top>Comment:</TD><TD>'.$comment.'</TD></TR>';
}
}
 

 

 

shopsystem.php (+Créditos ao GM Bekman)

Substitua:

 


if($buy_offer['type'] == 'pacc')
{
$player_premdays = $buy_player_account->getCustomField('premdays');
$player_lastlogin = $buy_player_account->getCustomField('lastday');
$save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_pacc').' (id, to_name, to_account, from_nick, from_account, price, pacc_days, trans_state, trans_start, trans_real) VALUES (NULL, '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).',  '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['days']).', \'realized\', '.$SQL->quote(time()).', '.$SQL->quote(time()).');';
$SQL->query($save_transaction);
$buy_player_account->setCustomField('premdays', $player_premdays+$buy_offer['days']);
$account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
$user_premium_points = $user_premium_points - $buy_offer['points'];
if($player_premdays == 0)
{
	$buy_player_account->setCustomField('lastday', time());
}
$main_content .= '<h2>PACC added!</h2><b>'.$buy_offer['days'].' days</b> of Premium Account added to account of player <b>'.$buy_player->getName().'</b> for <b>'.$buy_offer['points'].' premium points</b> from your account.<br />Now you have <b>'.$user_premium_points.' premium points</b>.<br /><a href="index.php?subtopic=shopsystem">GO TO MAIN SHOP SITE</a>';
}
 

 

Por:

 


if($buy_offer['type'] == 'pacc')
{
$player_viptime = $buy_player_account->getCustomField('viptime');
$player_lastlogin = $buy_player_account->getCustomField('lastday');
$save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_pacc').' (id, to_name, to_account, from_nick, from_account, price, pacc_days, trans_state, trans_start, trans_real) VALUES (NULL, '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).',  '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['days']).', \'realized\', '.$SQL->quote(time()).', '.$SQL->quote(time()).');';
$SQL->query($save_transaction);

if($player_viptime > 0)
	$buy_player_account->setCustomField('viptime', $player_viptime + ($buy_offer['days'] * 24 * 60 * 60));
else
	$buy_player_account->setCustomField('viptime', time() + ($buy_offer['days'] * 24 * 60 * 60));

$account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
$user_premium_points = $user_premium_points - $buy_offer['points'];
if($player_viptime == 0)
{
	$buy_player_account->setCustomField('lastday', time());
}
$main_content .= '<h2>VIP Days added!</h2><b>'.$buy_offer['days'].' days</b> of Vip Account added to account of player <b>'.$buy_player->getName().'</b> for <b>'.$buy_offer['points'].' premium points</b> from your account.<br />Now you have <b>'.$user_premium_points.' premium points</b>.<br /><a href="index.php?subtopic=shopsystem">GO TO MAIN SHOP SITE</a>';
}
 

 

 

 

Links Úteis

 

 

01- [Gesior Acc] Vendedo Vip Pelo Pacc

Créditos: GM Bekman

 

02- Double Exp Para Vip

Créditos: Vodkart

 

03- Outfits Só Para Jogadores Vips

Créditos: Vodkart

Perfeito, irei usar ^^

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...