converting and removing

Started by :P, Sep 13, 2015, 05:03 PM

Previous topic - Next topic

MacTavish

Post your reward command then we will be able to solve it

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

MacTavish

#16
As i wondered that you are trying to create a reward cmd but occur some problem so i decided to create it for you Try it

else if (cmd =="reward")
{
if(!text) MessagePlayer("syntax: /reward <nick/id> <amount> <reason>",player);
else
{
local plr = GetPlayer(GetTok(text, " ",1)), rew = GetTok(text, " ",2), reason = GetTok(text, " ",3 NumTok(text, " "));
if (!plr) MessagePlayer("invalid nick/id",player);
else if(!rew) MessagePlayer("Reward not specified",player);
else if(!IsNum(rew)) MessagePlayer("Reward must be integer/number",player);
else
{
if(!reason) reason = "None";
IncCash(plr, rew.tointeger());
AnnounceAll("Admin "+player.Name+" Given Reward of "+rew.tointeger()+"$ to "+plr.Name+", Reason: "+reason);
}
}
}


updated: added IncCash, added Reason

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

:P

SLC is a good scripter but he always use bad words for abusing players :P

:P

if you can solve this bug so will much good or not so no problem
else if ( cmd == "reward" )
{
    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 ) ePrivMessage( "Unknown Player..", player );
else
{
   local mon = GetTok( text, " ", 2);
   if (!IsNum(mon)) ePrivMessage("Amount Must Be In Numbers..",player);
   else
   {
  Message("[#007fff]Admin [#f0e130]" + player.Name + " [#007fff]Awarded [#00ff00]" + plr.Name + "[#007fff] with: [#ff033e]" + mon + " [#007fff]c@$h.");
               IncCash( plr, mon.tointeger() );
   {
   local reason = GetTok( text, " ", 3, NumTok( text, " " ) );
   if ( reason == null ) reason = "None"
   Announce( "** Admin " + player.Name + " has rewarded " + mon + " for Reason " + reason, 3 );
}
}
}
}[code]
SLC is a good scripter but he always use bad words for abusing players :P

MacTavish

#19
Quote from: xxkillerxx on Sep 16, 2015, 12:44 PMif you can solve this bug so will much good or not so no problem
else if ( cmd == "reward" )
{
    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 ) ePrivMessage( "Unknown Player..", player );
else
{
   local mon = GetTok( text, " ", 2);
   if (!IsNum(mon)) ePrivMessage("Amount Must Be In Numbers..",player);
   else
   {
  Message("[#007fff]Admin [#f0e130]" + player.Name + " [#007fff]Awarded [#00ff00]" + plr.Name + "[#007fff] with: [#ff033e]" + mon + " [#007fff]c@$h.");
               IncCash( plr, mon.tointeger() );
   {
   local reason = GetTok( text, " ", 3, NumTok( text, " " ) );
   if ( reason == null ) reason = "None"
   Announce( "** Admin " + player.Name + " has rewarded " + mon + " for Reason " + reason, 3 );
}
}
}
}[code]

There is no bug but it would be nice if you use that i posted because that is far better than this one, i updated cmd you can copy again

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

:P

will you update your cmds to add reason please
SLC is a good scripter but he always use bad words for abusing players :P

KAKAN

Use this one:-
else if (cmd =="reward")
{
if(!text) MessagePlayer("syntax: /reward <nick/id> <amount>",player);
else
{
local plr = GetPlayer(GetTok(text, " ",1)), rew = GetTok(text, " ",2);
if (!plr) MessagePlayer("invalid nick/id",player);
else if(!rew) MessagePlayer("Reward not specified",player);
else if(!IsNum(rew)) MessagePlayer("Reward must be integer/number",player);
local reason = GetTok( text, " ", 3 NumTok( text, " " ) );
if(!reason) reason = "None";
else
{
IncCash(plr, rew.tointeger());
AnnounceAll("Admin "+player.Name+" Given Reward of
"+rew.tointeger()+"$ to "+plr.Name+". Reason: " + reason);
}
}
}
oh no

:P

SLC is a good scripter but he always use bad words for abusing players :P

KAKAN

oh no

:P

line # 84 dofile( "Cmds.nut" );
SLC is a good scripter but he always use bad words for abusing players :P

Mashreq

Mistakely KAKAN has pressed his enter key while typing the text of AnnounceAll which made the message to separate as 2 lines.
Change your
AnnounceAll("Admin "+player.Name+" Given Reward of
"+rew.tointeger()+"$ to "+plr.Name+". Reason: " + reason);
to
AnnounceAll("Admin "+player.Name+" Given Reward of "+rew.tointeger()+"$ to "+plr.Name+". Reason: " + reason);

.

const BELIEBER = "YOU NO
GET IT!";
.

MacTavish


Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

:P

thanks to mashreq    kakan  kusnangi
SLC is a good scripter but he always use bad words for abusing players :P