Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - HTC

#1
These problems will be corrected and on some days the server will be posted again
#2
HTC & Clan TOR - [0.4] Warchief v2.0

Build: 10156 (Update 25/07/2015)

Language: Portuguese-BR (The English version will be available soon)

Version [0.4] Warchief 2.0 additional controls and systems* MatheuS (Country Detector, mute, unmute) - sseebbyy (Nitrous Oxide Systems) - Banaqs (Vehicle Fix Function) - JaVeD (News System) - ADM Script v1.0 (Command format: Kick and Killp) - Diego (Ban and Unban) - Beztone (Command format: Setmon) - George (Gotoloc and Saveloc) - Ksna's Cops and Robbers (Special commands)

Updates will be released to fix bugs that still exist in this version

REMOVED - INSECURE
#3
Quote from: Beztone on Jul 22, 2015, 05:36 AMelse if ( cmd =="setmon" )
{
if (!text) MessagePlayer("Syntax - /setmon <nick/id> <amount>",player);
else
{
local plr = GetPlayer( GetTok(text," ",1)), mon = GetTok(text," ",2);
if (!plr) MessagePlayer("Invalid Player",player);
else if (!mon) MessagePlayer("Money not specified",player);
else if (!IsNum(mon)) MessagePlayer("Money must be in number",player);
else
{
status[plr.ID].Cash += mon.tointeger();
player.Cash = status[plr.ID].Cash;
Message("Admin "+player.Name+" Has given "+mon+" $ to "+plr.Name+"");
}
}
}


Try it Untested


Thanks, it worked!
#4
The whole problem is here:

PrivMessage(" Admin " + player.Name + " Set Money Of " + plr.Name + " To: " + mon + ".",player);

>>> + mon + <<<
#5
How to fix?

Command:
                 else if ( cmd == "setmon" )
       {
          if ( IsNoob( player, cmd ) ) return 0;
         else if ( !text ) ePrivMessage( "Syntax, /c " + cmd + " <Nick/ID> <Money> ", player );
         local plr = GetPlayer( GetTok( text, " ", 1 ) );
         if ( !plr ) PrivMessage( "Unknown Player..", player );
         else
         {
            local mon = GetTok( text, " ", 2);
            if (!IsNum(mon)) ePrivMessage("Amount Must Be In Numbers..",player);
            else
            {
            PrivMessage(" Admin " + player.Name + " Set Money Of " + plr.Name + " To: " + mon + ".",player);
               IncCash( plr, mon.tointeger() );
            }
         }
         }
Erro:

[SCRIPT]  OnPlayerCommand Error: parameter 1 has an invalid type 'null' ; expected: 'string'
[SCRIPT]  OnPlayerCommand Error: parameter 1 has an invalid type 'string' ; expected: 'instance'