when i ban/kick/drown some one its shows same for example
KAKAN drown KAKAN not showing the admin name why thats problem in all commands
i will show u 1 cmds and function
function Drown( player, admin, reason )
{
Message( " [#4682B4][Info][#FFFFFF]Drown:[ " + player.Name + " ] by Admin:[ " + admin + " ] Reason:[ " + reason + " ]" );
player.Pos = Vector( -597.7496,-1858.9531,28.1291 );
player.Health = 0;
}
else if ( cmd == "drown" )
{
if ( !text ) MessagePlayer( " [#4682B4][Syntax][#FFFFFF], /" + cmd + " <Nick/ID> <Reason>", player );
local player = GetPlayer( GetTok( text, " ", 1 ) );
if ( !player ) MessagePlayer( " [#4682B4][Error][#FFFFFF]Unknown Player..", player );
else
{
local reason = GetTok( text, " ", 2, NumTok( text, " " ) );
if ( reason == null ) reason = "None";
Drown( player, player, reason );
}
}
Are you trying to script only for an educational experience, or do you plan to launch a server?
Quote from: aXXo on May 23, 2016, 09:07 PMAre you trying to script only for an educational experience, or do you plan to launch a server?
dude i love to learn scripting and its launched but announced by my brother soon i will announce by myself he did not designed well :D
Quote from: Hercules on May 23, 2016, 09:11 PMQuote from: aXXo on May 23, 2016, 09:07 PMAre you trying to script only for an educational experience, or do you plan to launch a server?
dude i love to learn scripting and its launched but announced by my brother soon i will announce by myself he did not designed well :D
Why so noob english?
Well, you repeat the same player instance using local, that's the problem.
Change the local player to plr and accordingly do all the shits :P
function Drown( player, admin, reason )
{
Message( " [#4682B4][Info][#FFFFFF]Drown:[ " + player.Name + " ] by Admin:[ " + admin + " ] Reason:[ " + reason + " ]" );
player.Pos = Vector( -597.7496,-1858.9531,28.1291 );
player.Health = 0;
}
else if ( cmd == "drown" )
{
if ( !text ) MessagePlayer( " [#4682B4][Syntax][#FFFFFF], /" + cmd + " <Nick/ID> <Reason>", player );
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer( " [#4682B4][Error][#FFFFFF]Unknown Player..", player );
else
{
local reason = GetTok( text, " ", 2, NumTok( text, " " ) );
if ( reason == null ) reason = "None";
Drown( plr, player, reason );
}
}
Quote from: Hercules on May 23, 2016, 08:48 PMlocal player = GetPlayer( GetTok( text, " ", 1 ) );
Drown( player, player, reason );
That's where you made a mistake. Replace those lines with these two lines
local plr = GetPlayer( GetTok( text, " ", 1 ) );
Drown( plr, player, reason );