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

[Gesior AAC] Skull/frag remover in shop (TFS 0.3.5-6 & 0.4)

Helga

GZH
Joined
Feb 19, 2009
Messages
622
Reaction score
1
Location
Sweden
Since loads of people are asking about it, I'll post it here.

To get the skull and frags remover to work, you need to change the sql query in shopsystem.php

1. Go into shopsystem.php, find the line where the remove-skull sql query is. In widnet's fixed v6 it's on line 584. Search for this:
PHP:
$SQL->query('UPDATE players SET redskull=0, redskulltime=0 WHERE id='. $my_acc_id .';');

2. Now, delete that line and add those those two lines instead:
PHP:
$SQL->query('UPDATE killers SET unjustified=0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id='. $my_acc_id .');');
$SQL->query('UPDATE players SET skulltime=0, skull=0 WHERE id='. $my_acc_id .';');
The first line removes the frags, and the second line removes the skull. So you can use both or just one of them :)

Works well on TFS 0.3.5, 0.3.6 and 0.4

PS. If you can't find the sql-query code, then search for this line:
PHP:
elseif($buy_offer['type'] == 'redskull')
and you will se the $SQL->query a few lines below.

Edit: Sorry, I forgot to mention that the character needs to be offline, else the skull remover wont work, just the frags.
 
Last edited:
Try this:

PHP:
  elseif($buy_offer['type'] == 'redskull')
  {
  $my_acc_id = $buy_player->getCustomField('id');
  $dataget = $SQL->query('SELECT * FROM '.$SQL->tableName('players').' WHERE '.$SQL->fieldName('id').' = '.$my_acc_id.';')->fetch();
  if($dataget['online'] < '1') {
        $SQL->query('UPDATE players SET skull=0, skulltime=0 WHERE id='. $my_acc_id .';');
        $SQL->query('UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = '.$my_acc_id.');');
    $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
    $user_premium_points = $user_premium_points - $buy_offer['points'];
    $main_content .= '
      <h2>
        Skull Removed!
      </h2>
      <b>
        Your skull has been removed to the player '.$buy_player->getName().',
      <br>
      Now you have
        <b>
          '.$user_premium_points.' premium points
        </b>.
      <br>
      <a href="index.php?subtopic=shopsystem">
        GO TO MAIN SHOP SITE
      </a>';
  } else
  {
    $main_content .= '
    <b>
    '.$buy_player->getName().' has to be offline or have skull to complete transaction!.
    </b>
    <br>
    <a href="index.php?subtopic=shopsystem">
      GO BACK
    </a>';
  }
  }
 
Shouldn't $my_acc_id be replaced with $account_logged->getId()

no, $my_acc_id is the character they choose in the drop-down list, you don't remove the red skull from the account you are logged in at
 
Helga, you can create separately, a script to remove the frags and to remove black/red skull? Because i understand, your create a option to take out frag (if u have) and skull (if u have), but i like separately ;)

thx and very good script m8!

cheers!
 
Like this?
}
elseif($buy_offer['type'] == 'redskull')
{
//Obtener id ed la cuenta
$my_acc_id = $buy_player->getCustomField('id');
$dataget = $SQL->query('SELECT * FROM '.$SQL->tableName('players').' WHERE '.$SQL->fieldName('id').' = '.$my_acc_id.';')->fetch();
if($dataget['skull'] >= '1' AND $dataget['online'] >= '0' AND $dataget['skulltime'] > '0') {

$SQL->query('UPDATE killers SET unjustified=0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id='. $my_acc_id .');');
$SQL->query('UPDATE players SET skulltime=0, skull=0 WHERE id='. $my_acc_id .';');
$account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
$user_premium_points = $user_premium_points - $buy_offer['points'];
$main_content .= '
<h2>
Skull Removed!
</h2>
<b>
Your skull has been removed to the player '.$buy_player->getName().',
<br>
Now you have
<b>
'.$user_premium_points.' premium points
</b>.
<br>
<a href="index.php?subtopic=shopsystem">
GO TO MAIN SHOP SITE
 
Like this?
}
elseif($buy_offer['type'] == 'redskull')
{
//Obtener id ed la cuenta
$my_acc_id = $buy_player->getCustomField('id');
$dataget = $SQL->query('SELECT * FROM '.$SQL->tableName('players').' WHERE '.$SQL->fieldName('id').' = '.$my_acc_id.';')->fetch();
if($dataget['skull'] >= '1' AND $dataget['online'] >= '0' AND $dataget['skulltime'] > '0') {

$SQL->query('UPDATE killers SET unjustified=0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id='. $my_acc_id .');');
$SQL->query('UPDATE players SET skulltime=0, skull=0 WHERE id='. $my_acc_id .';');
$account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
$user_premium_points = $user_premium_points - $buy_offer['points'];
$main_content .= '
<h2>
Skull Removed!
</h2>
<b>
Your skull has been removed to the player '.$buy_player->getName().',
<br>
Now you have
<b>
'.$user_premium_points.' premium points
</b>.
<br>
<a href="index.php?subtopic=shopsystem">
GO TO MAIN SHOP SITE

but how to add it in to the shop -.- like:
INSERT INTO z_shop_offer (id, points, itemid1, count1, itemid2, count2, offer_type, offer_description, offer_name) VALUES(4, 10, 0, 12, 0, 0, 'redskull', 'Removes your redskull and frags', 'redskull remover');
 
Back
Top