Raised This Month: $51 Target: $400
 12% 

new error message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-17-2023 , 04:13   new error message
Reply With Quote #1

Code:
L 05/17/2023 - 04:11:03: Client index 1137306778 is invalid
L 05/17/2023 - 04:11:03: [AMXX] Displaying debug trace (plugin "NewCommands.amxx", version "1.0")
L 05/17/2023 - 04:11:03: [AMXX] Run time error 10: native error (native "client_print_color")
L 05/17/2023 - 04:11:03: [AMXX]    [0] NewCommands.sma::PrintTeleport (line 1345)
L 05/17/2023 - 04:11:03: [AMXX]    [1] NewCommands.sma::CmdTeleport (line 755)
L 05/17/2023 - 04:11:03: [AMXX]    [2] NewCommands.sma::CmdTeleport (line 753)
L 05/17/2023 - 04:11:03: [AMXX]    [3] NewCommands.sma::CommandSelector (line 224)
L 05/17/2023 - 04:11:03: [AMXX]    [4] NewCommands.sma::HandleSay (line 195)
PHP Code:
client_print_color(idprint_team_default,
(id))) crashes my server if i write
!teleport name 400 100 40

Last edited by Fuck For Fun; 05-19-2023 at 16:59.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
lexzor
Veteran Member
Join Date: Nov 2020
Old 05-19-2023 , 07:28   Re: new error message
Reply With Quote #2

the error message is not new, its old as the earth

with the given code, we can't indentify the error.

check if the player index is between 0 and 33 and if the user is connected

doing this you will avoid this type of error
lexzor is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-19-2023 , 11:15   Re: new error message
Reply With Quote #3

Quote:
Originally Posted by lexzor View Post
the error message is not new, its old as the earth

with the given code, we can't indentify the error.

check if the player index is between 0 and 33 and if the user is connected

doing this you will avoid this type of error
this it the public of it
PHP Code:
// Command: Teleport.
CmdTeleport(clientparam[])
{
    
// check param[] is none.
    
if (!CheckUsage(clientTELEPORTparam))
        return;
        
    
// Split parameter.
    
new fromTarget[32], toTarget[32];
    
argbreak(paramfromTargetcharsmax(fromTarget), toTargetcharsmax(toTarget));

    new 
players[32];
    new 
fPlayer;
    new 
tPlayer;
    new 
pnum 0;
    new 
Float:origin[3], Float:vAngle[3];
    new 
cOriginX[5],cOriginY[5],cOriginZ[5];
    if (
parse(toTargetcOriginXcharsmax(cOriginX), cOriginYcharsmax(cOriginY), cOriginZcharsmax(cOriginZ)) == 3)
    {
        
origin[0] = str_to_float(cOriginX);
        
origin[1] = str_to_float(cOriginY);
        
origin[2] = str_to_float(cOriginZ);
    } else
    {
        
// Get <To:target> player
        
if (GetSingleTargetPlayer(clienttoTargettPlayerfalseALIVE_ONLY))
        {
            
// Get <To:target> player location
            
GetTeleportLocation(tPlayeroriginvAngle);
        }
        
/*else
        {
            client_print_color(client, print_team_default, "%s Error: Missing or invalid destination target.", PREFIX);
            return;
        }*/
    
}

    
// Get <from:@xxx> player
    
if (GetMultiTargetPlayers(clientfromTargetplayerspnumtrueALIVE_ONLY))
    {
        
// Teleporting <from:@xxx>
        
for(new 0pnumi++)
        {
            if (
is_user_alive(players[i]))
                
doTeleport(players[i], originvAngle);
        }

        
// Print
        
if (pnum)
            
PrintTeleport(0fromTargettPlayerorigin);

        
// End
        
return;
    }

    
// Get <from:target> player
    
if (GetSingleTargetPlayer(clientfromTargetfPlayertrueALIVE_ONLY))
    {
        
// Teleporting <from:target> player
        
if (is_user_alive(fPlayer))
        {
            
doTeleport(fPlayeroriginvAngle);
            
// Print
            
PrintTeleport(0fromTargettPlayerorigin);
        }
        
// End
        
return;
    }
}

//    Get Teleport Location.
GetTeleportLocation(idFloat:origin[3], Float:vAngle[3])
{
    
pev(idpev_originorigin);
    
pev(idpev_v_anglevAngle);
}

//    Teleporting.
doTeleport(id, const Float:origin[3], const Float:vAngle[3])
{
    new 
Float:toVector[3];

    
// Check Stuck.
    
FindEmptyLocation(origintoVector100.0);

    
// Teleport.
    
engfunc(EngFunc_SetOriginidtoVector);
    
set_pev(idpev_v_anglevAngle);
    
set_pev(idpev_fixangle1);

    
UTIL_UnstickPlayer(idSTART_DISTANCEMAX_ATTEMPTS);

PHP Code:
bool:GetSingleTargetPlayer(clienttarget[], &playerCheckHigherAdminIsAlive)
{
    
trim(target);

    
player GetTargetPlayer(target);
   
    if (!
player)
    {
        
client_print_color(clientprint_team_default"%s ^3Error^1: You must write a valid player."PREFIX);
        return 
false;
    }

    if (
CheckHigherAdmin)
        if (
IsHigherAdmin(clientplayer))
        {
            
player 0;
            
client_print_color(clientprint_team_default"%s ^3Error:^1 You can not use this command on high admin"PREFIXplayer);
            return 
false;
        }

    switch(
IsAlive)
    {
        case 
ALIVE_ONLY:
            if (!
is_user_alive(player))
            {
                
player 0;
                
client_print_color(clientprint_team_default"%s ^3Error^1: This action could not perform on^4 alive client^1."PREFIX);
                return 
false;
            }
        case 
DEAD_ONLY:
            if (
is_user_alive(player))
            {
                
player 0;
                
client_print_color(clientprint_team_default"%s ^3Error^1: This action could not perform on^4 dead client^1."PREFIX);
                return 
false;
            }
    }

    return 
true;

PHP Code:
PrintTeleport(idtarget[], positionFloat:origin[3])
{
    
trim(target);
    if (
target[0] == '@')
    {
        if (
is_user_connected(position))
        {
            if (
equali(target"@all"))
                
client_print_color(idprint_team_default"%s ^3everyone ^1has teleport to ^3%n. ^1(Origin:%.2f, %.2f, %.2f)",        PREFIXpositionorigin[0], origin[1], origin[2]);
            else if(
equali(target"@admin"))
                
client_print_color(idprint_team_default"%s ^3Admins ^1has teleport to ^3%n. ^1(Origin:%.2f, %.2f, %.2f)",         PREFIXpositionorigin[0], origin[1], origin[2]);
            else if(
equali(target"@ct"))
                
client_print_color(idprint_team_default"%s ^3CT Team ^1has teleport to ^3%n. ^1(Origin:%.2f, %.2f, %.2f)",         PREFIXpositionorigin[0], origin[1], origin[2]);
            else if(
equali(target"@t"))
                
client_print_color(idprint_team_default"%s ^3Terrorist Team ^1has teleport to ^3%n. ^1(Origin:%.2f, %.2f, %.2f)",PREFIXpositionorigin[0], origin[1], origin[2]);
            else
            {
                new 
player GetTargetPlayer(target);
                
client_print_color(idprint_team_default"%s ^3%n ^1has teleport to ^3%n. ^1(Origin:%.2f, %.2f, %.2f)",             PREFIXplayerpositionorigin[0], origin[1], origin[2]);
            }
        }
        else
        {
            if (
equali(target"@all"))
                
client_print_color(idprint_team_default"%s ^3everyone ^1has teleported to ^3Origin.(%.2f, %.2f, %.2f)",        PREFIXorigin[0], origin[1], origin[2]);
            else if(
equali(target"@admin"))
                
client_print_color(idprint_team_default"%s ^3Admins ^1has teleported to ^3Origin.(%.2f, %.2f, %.2f)",         PREFIXorigin[0], origin[1], origin[2]);
            else if(
equali(target"@ct"))
                
client_print_color(idprint_team_default"%s ^3CT Team ^1has teleported to ^3Origin.(%.2f, %.2f, %.2f)",         PREFIXorigin[0], origin[1], origin[2]);
            else if(
equali(target"@t"))
                
client_print_color(idprint_team_default"%s ^3Terrorist Team ^1has teleported to ^3Origin.(%.2f, %.2f, %.2f)",PREFIXorigin[0], origin[1], origin[2]);
            else
            {
                new 
player GetTargetPlayer(target);
                
client_print_color(idprint_team_default"%s ^3%n ^1has teleported to ^3Origin.(%.2f, %.2f, %.2f)",             PREFIXplayerorigin[0], origin[1], origin[2]);
            }
        }
        return;
    }
    else
    {
        if (
is_user_connected(position))
        {
            new 
player GetTargetPlayer(target);
            
client_print_color(idprint_team_default"%s ^3%n ^1has teleport to ^3%n. ^1(Origin:%.2f, %.2f, %.2f)",                     PREFIXplayerorigin[0], origin[1], origin[2]);
        }        
        else
        {
            new 
player GetTargetPlayer(target);
            
client_print_color(idprint_team_default"%s ^3%n ^1has teleported to ^3Origin.(%.2f, %.2f, %.2f)",                     PREFIXplayerorigin[0], origin[1], origin[2]);
        }        
    }
    return;


Last edited by Fuck For Fun; 05-19-2023 at 12:48.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-19-2023 , 12:21   Re: new error message
Reply With Quote #4

i think i have to change
Quote:
if (is_user_connected(position))
if i change position to ID , the teleported to %n not will show

EDIT: with (id)
PHP Code:
[CmdCheezPuff has teleported to Origin.(801.16724.0552.03)
[
CmdCheezPuff has teleported to Origin.(550.76727.8352.03)
[
CmdErrorYou must write a valid player.
[
CmdCheezPuff has teleported to Origin.(0.000.000.00)
[
Cmdeveryone has teleported to Origin.(-84.53, -51.2836.03)
[
CmdCheezPuff has teleported to Origin.(0.000.00100.00
PHP Code:
client_print_color(idprint_team_default,
(id))) crashes my server if i write
!teleport name 400 100 40

Last edited by Fuck For Fun; 05-19-2023 at 17:01.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-19-2023 , 17:36   Re: new error message
Reply With Quote #5

Upload the code
so the code based on some function
!teleport name value[origin]
!teleport name toTarget
!teleport @all toTarget
!teleport self self - need block it or pass origin
need block check and more

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

#define    PREFIX            "^4[Cmd]^1"
#define START_DISTANCE  32
#define MAX_ATTEMPTS    128
#define GetPlayerHullSize(%1)  ((pev(%1, pev_flags) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN)

enum _:ALIVE_MODE
{
    
ALL,
    
ALIVE_ONLY,
    
DEAD_ONLY,
};

enum _:CMD_STRUCT
{
    
CMD_NAME    [32],
    
CMD_INCHAT    [32],
    
CMD_SRV        [32],
    
CMD_USAGE    [128],
    
CMD_LEVEL,
};

enum _:Commands
{
    
TELEPORT
}

new const 
CommandsList[Commands][CMD_STRUCT] = 
{

    {
"Teleport",    "teleport",    """<^3From:@all/@t/@ct/@admin/target^1> <^3To:target/origin:X Y Z^1>",    ADMIN_KICK},    // !teleport     - flag c (VIP+)
}

new const 
HigherLevel[] =
{   
// low to high
    
ADMIN_KICK,         // VIP
    
ADMIN_BAN,          // Admin
    
ADMIN_LEVEL_C,      // SuperAdmin
    
ADMIN_RESERVATION,  // Manager
    
ADMIN_IMMUNITY,     // Owner
};

new 
gCmdPointer[Commands];

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_clcmd("say""HandleSay");
    
register_clcmd("say_team""HandleSay");

    for (new 
0Commandsi++)
    {
        if (
strlen(CommandsList[i][CMD_SRV]) > 0)
        
gCmdPointer[i] = get_cvar_pointer(CommandsList[i][CMD_SRV]);
    }
}

// Say Command Handler.
public HandleSay(client)
{
    new 
said[32];
    new 
param[32];
    new 
szMessage[charsmax(said) + charsmax(param) + 2];
   
    
read_argv(1szMessagecharsmax(szMessage));
    
argbreak(szMessagesaidcharsmax(param), paramcharsmax(param));
 
    for (new 
0Commandsi++)
    {
        if (
equali(said[1], CommandsList[i][CMD_INCHAT]))
        {
            if (!(
get_user_flags(client) & CommandsList[i][CMD_LEVEL]))
            {
                
client_print_color(clientprint_team_default"%s ^3Error^1: You don't have Access Level."PREFIX);
                break;
            }
            
CommandSelector(iclientparam); // // Pass the command / don't need to modify the loop itself.
            
return PLUGIN_HANDLED;
        }
    }
    return 
PLUGIN_CONTINUE;
}

// Say Command Handler (Selector).
CommandSelector(cmdclientparam[])
{
    switch(
cmd)
    {
        case 
TELEPORT:    CmdTeleport    (clientparam);
    }
}

// Check Higher Admin (id < target).
bool:IsHigherAdmin(idtarget)
{
    
// my flags
    
new mFlags get_user_flags(id);
    
// target flags
    
new tFlags get_user_flags(target);
 
    new 
mLevel 1;
    new 
tLevel 1;
 
    for (new 
0sizeof(HigherLevel); i++)
    {
        if (
mFlags HigherLevel[i])
        
mLevel *= 10;
       
        if (
tFlags HigherLevel[i])
        
tLevel *= 10;
    }
 
    if (
tLevel mLevel)
    {
        return 
true;
    }
   
    return 
false;
}

/*
    Get Player Index for one target.
 */
bool:GetSingleTargetPlayer(clienttarget[], &playerCheckHigherAdminIsAlive)
{
    
trim(target);

    
player GetTargetPlayer(target);
   
    if (!
player)
    {
        
client_print_color(clientprint_team_default"%s ^3Error^1: You must write a valid player."PREFIX);
        return 
false;
    }

    if (
CheckHigherAdmin)
        if (
IsHigherAdmin(clientplayer))
        {
            
player 0;
            
client_print_color(clientprint_team_default"%s ^3Error:^1 You can not use this command on high admin"PREFIXplayer);
            return 
false;
        }

    switch(
IsAlive)
    {
        case 
ALIVE_ONLY:
            if (!
is_user_alive(player))
            {
                
player 0;
                
client_print_color(clientprint_team_default"%s ^3Error^1: This action could not perform on^4 alive client^1."PREFIX);
                return 
false;
            }
        case 
DEAD_ONLY:
            if (
is_user_alive(player))
            {
                
player 0;
                
client_print_color(clientprint_team_default"%s ^3Error^1: This action could not perform on^4 dead client^1."PREFIX);
                return 
false;
            }
    }

    return 
true;
}
GetTargetPlayer(target[])
{
    
trim(target);

    new 
player find_player("al"target);
    if (!
player)
    {
        
player find_player("bl"target);
        if (
player)
        {
            if (
player == find_player("bjl"target))
            {
                return 
player;
            }
        }
        return 
0;
    }
    return 
player;
}
// Check Parameter None.
bool:CheckUsage(clientcmdparam[])
{
    if (!
param[0])
    {
        
client_print_color(clientprint_team_default"%s Usage: '^4!%s ^1%s'"PREFIXCommandsList[cmd][CMD_NAME], CommandsList[cmd][CMD_USAGE]);
        return 
false;        
    }
    return 
true;
}

// Command: Teleport.
CmdTeleport(clientparam[])
{
    
// check param[] is none.
    
if (!CheckUsage(clientTELEPORTparam))
        return;
        
    
// Split parameter.
    
new fromTarget[32], toTarget[32];
    
argbreak(paramfromTargetcharsmax(fromTarget), toTargetcharsmax(toTarget));

    new 
players[32];
    new 
fPlayer;
    new 
tPlayer;
    new 
pnum 0;
    new 
Float:origin[3], Float:vAngle[3];
    new 
cOriginX[5],cOriginY[5],cOriginZ[5];
    if (
parse(toTargetcOriginXcharsmax(cOriginX), cOriginYcharsmax(cOriginY), cOriginZcharsmax(cOriginZ)) == 3)
    {
        
origin[0] = str_to_float(cOriginX);
        
origin[1] = str_to_float(cOriginY);
        
origin[2] = str_to_float(cOriginZ);
    } else
    {
        
// Get <To:target> player
        
if (GetSingleTargetPlayer(clienttoTargettPlayerfalseALIVE_ONLY))
        {
            
// Get <To:target> player location
            
GetTeleportLocation(tPlayeroriginvAngle);
        }
        
/*else
        {
            client_print_color(client, print_team_default, "%s Error: Missing or invalid destination target.", PREFIX);
            return;
        }*/
    
}

    
// Get <from:@xxx> player
    
if (GetMultiTargetPlayers(clientfromTargetplayerspnumtrueALIVE_ONLY))
    {
        
// Teleporting <from:@xxx>
        
for(new 0pnumi++)
        {
            if (
is_user_alive(players[i]))
                
doTeleport(players[i], originvAngle);
        }

        
// Print
        
if (pnum)
            
PrintTeleport(0fromTargettPlayerorigin);

        
// End
        
return;
    }

    
// Get <from:target> player
    
if (GetSingleTargetPlayer(clientfromTargetfPlayertrueALIVE_ONLY))
    {
        
// Teleporting <from:target> player
        
if (is_user_alive(fPlayer))
        {
            
doTeleport(fPlayeroriginvAngle);
            
// Print
            
PrintTeleport(0fromTargettPlayerorigin);
        }
        
// End
        
return;
    }
}

//    Get Teleport Location.
GetTeleportLocation(idFloat:origin[3], Float:vAngle[3])
{
    
pev(idpev_originorigin);
    
pev(idpev_v_anglevAngle);
}

//    Teleporting.
doTeleport(id, const Float:origin[3], const Float:vAngle[3])
{
    new 
Float:toVector[3];

    
// Check Stuck.
    
FindEmptyLocation(origintoVector100.0);

    
// Teleport.
    
engfunc(EngFunc_SetOriginidtoVector);
    
set_pev(idpev_v_anglevAngle);
    
set_pev(idpev_fixangle1);

    
UTIL_UnstickPlayer(idSTART_DISTANCEMAX_ATTEMPTS);
}
/*
    Teleport Location.
    Check Stuck Logic.
    Get the coordinates without obstacles within the range from the target coordinates.
 */
FindEmptyLocation(const Float:from[3], Float:Origin[3], Float:Radius)
{
    
Origin from;
    
    while (
PointContents(Origin) != CONTENTS_EMPTY && PointContents(Origin) != CONTENTS_SKY)
    {
        for(new 
Count;Count 2;Count++)
            
Origin[Count] = from[Count] + random_float(-Radius,Radius);
    }
}
UTIL_UnstickPlayer(const id, const i_StartDistance,const i_MaxAttempts)
{
    
// --| Not alive, ignore.
    
if (!is_user_alive(id))
        return -
1;
 
    static 
Float:vf_OriginalOrigin[3], Float:vf_NewOrigin[3];
    static 
i_Attemptsi_Distance;
 
    
// --| Get the current player's origin.
    
pev idpev_originvf_OriginalOrigin );
 
    
i_Distance i_StartDistance;
 
    while ( 
i_Distance 1000 )
    {
        
i_Attempts i_MaxAttempts;
 
        while (
i_Attempts--)
        {
            for(new 
03i++)
                
vf_NewOrigin[i] = random_float(vf_OriginalOrigin[i] - i_Distancevf_OriginalOrigin[i] + i_Distance);
 
            
engfunc(EngFunc_TraceHullvf_NewOriginvf_NewOriginDONT_IGNORE_MONSTERSGetPlayerHullSize(id), id0);
 
            
// --| Free space found.
            
if (get_tr2(0TR_InOpen) && !get_tr2(0TR_AllSolid) && !get_tr2(0TR_StartSolid))
            {
                
// --| Set the new origin .
                
engfunc EngFunc_SetOriginidvf_NewOrigin );
                return 
1;
            }
        }
        
i_Distance += i_StartDistance;
    }
    
// --| Could not be found.
    
return 0;
}

PrintTeleport(idtarget[], positionFloat:origin[3])
{
    
trim(target);
    if (
target[0] == '@')
    {
        if (
is_user_connected(position))
        {
            if (
equali(target"@all"))
                
client_print_color(idprint_team_default"%s ^3everyone ^1has teleport to ^3%n. ^1(Origin:%.2f, %.2f, %.2f)",        PREFIXpositionorigin[0], origin[1], origin[2]);
            else if(
equali(target"@admin"))
                
client_print_color(idprint_team_default"%s ^3Admins ^1has teleport to ^3%n. ^1(Origin:%.2f, %.2f, %.2f)",         PREFIXpositionorigin[0], origin[1], origin[2]);
            else if(
equali(target"@ct"))
                
client_print_color(idprint_team_default"%s ^3CT Team ^1has teleport to ^3%n. ^1(Origin:%.2f, %.2f, %.2f)",         PREFIXpositionorigin[0], origin[1], origin[2]);
            else if(
equali(target"@t"))
                
client_print_color(idprint_team_default"%s ^3Terrorist Team ^1has teleport to ^3%n. ^1(Origin:%.2f, %.2f, %.2f)",PREFIXpositionorigin[0], origin[1], origin[2]);
            else
            {
                new 
player GetTargetPlayer(target);
                
client_print_color(idprint_team_default"%s ^3%n ^1has teleport to ^3%n. ^1(Origin:%.2f, %.2f, %.2f)",             PREFIXplayerpositionorigin[0], origin[1], origin[2]);
            }
        }
        else
        {
            if (
equali(target"@all"))
                
client_print_color(idprint_team_default"%s ^3everyone ^1has teleported to ^3Origin.(%.2f, %.2f, %.2f)",        PREFIXorigin[0], origin[1], origin[2]);
            else if(
equali(target"@admin"))
                
client_print_color(idprint_team_default"%s ^3Admins ^1has teleported to ^3Origin.(%.2f, %.2f, %.2f)",         PREFIXorigin[0], origin[1], origin[2]);
            else if(
equali(target"@ct"))
                
client_print_color(idprint_team_default"%s ^3CT Team ^1has teleported to ^3Origin.(%.2f, %.2f, %.2f)",         PREFIXorigin[0], origin[1], origin[2]);
            else if(
equali(target"@t"))
                
client_print_color(idprint_team_default"%s ^3Terrorist Team ^1has teleported to ^3Origin.(%.2f, %.2f, %.2f)",PREFIXorigin[0], origin[1], origin[2]);
            else
            {
                new 
player GetTargetPlayer(target);
                
client_print_color(idprint_team_default"%s ^3%n ^1has teleported to ^3Origin.(%.2f, %.2f, %.2f)",             PREFIXplayerorigin[0], origin[1], origin[2]);
            }
        }
        return;
    }
    else
    {
        if (
is_user_connected(position))
        {
            new 
player GetTargetPlayer(target);
            
client_print_color(idprint_team_default"%s ^3%n ^1has teleport to ^3%n. ^1(Origin:%.2f, %.2f, %.2f)",                     PREFIXplayerorigin[0], origin[1], origin[2]);
        }        
        else
        {
            new 
player GetTargetPlayer(target);
            
client_print_color(idprint_team_default"%s ^3%n ^1has teleported to ^3Origin.(%.2f, %.2f, %.2f)",                     PREFIXplayerorigin[0], origin[1], origin[2]);
        }        
    }
    return;
}
bool:GetMultiTargetPlayers(clienttarget[], players[32], &pnumCheckHigherAdminIsAlive ALL)
{
    new 
tmpPlayers[32];
    new 
tmpNum 0;
    new 
isAdmin  false;
    new 
isTarget true;
    
pnum 0;

    
trim(target);
    if (
target[0] == '@')
    {
        
// @all
        
if (equali(target"@all"))
        {
            
get_players(tmpPlayerstmpNum"h");
        }
        else
        
// @admin
        
if (equali(target"@admin"))
        {
            
get_players(tmpPlayerstmpNum"h");
            
isAdmin true;
        }
        else
        
// @ct
        
if (equali(target"@ct"))
        {
            
get_players(tmpPlayerstmpNum"eh""CT");
        }
        else
        
// @t
        
if (equali(target"@t"))
        {
            
get_players(tmpPlayerstmpNum"eh""T");
        }

        for (new 
0tmpNumi++)
        {
            
isTarget true;
            if (
CheckHigherAdmin)
                if (
IsHigherAdmin(clienttmpPlayers[i]))
                    continue;

            if (
isAdmin)
            {
                
isTarget false;
                
// Higher Admin Loops.
                
for (new 0sizeof(HigherLevel); n++)
                {
                    
// Is Higher Admin?
                    
if (get_user_flags(tmpPlayers[i]) & HigherLevel[n])
                    {
                        
isTarget true;
                        break;
                    }
                }
            }

            if (
isTarget)
            {
                switch(
IsAlive)
                {
                    case 
ALL:
                    {
                        
players[pnum++] = tmpPlayers[i];
                    }
                    case 
ALIVE_ONLY:
                    {
                        if (
is_user_alive(tmpPlayers[i]))
                            
players[pnum++] = tmpPlayers[i];
                    }
                    case 
DEAD_ONLY:
                    {
                        if (!
is_user_alive(tmpPlayers[i]))
                            
players[pnum++] = tmpPlayers[i];
                    }
                }
            }
        }
        if (
tmpNum <= 0)
        {
            
client_print_color(clientprint_team_default"%s ^3Error^1: Not Found Players."PREFIX);
            return 
true;
        }
    }
    return (
pnum 0);

Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
metal_upa
Senior Member
Join Date: Jun 2016
Old 05-22-2023 , 04:58   Re: new error message
Reply With Quote #6

I believe the 2nd parameter in client_print_color(x, x) is out of bound, you can try something like this:
the code
metal_upa is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 05-22-2023 , 05:51   Re: new error message
Reply With Quote #7

Quote:
Originally Posted by metal_upa View Post
I believe the 2nd parameter in client_print_color(x, x) is out of bound,
the code
what?

https://www.amxmodx.org/api/amxmodx/client_print_color

do you guys even read the documentation for a native?

second parameter it is used for different team color messages

if you send a message through client_print_color and the second parameter is print_team_default, the team color will be red for players that are playing at tero and blue for ct.

PHP Code:
enum
{
    
print_team_default 0,
    
print_team_grey = -1,
    
print_team_red = -2,
    
print_team_blue = -3,
}; 
Code:
Usage examples: client_print_color(id, print_team_red, "^4Green ^3Red ^1Default")
client_print_color(id, id2, "^4Green ^3id2's team color, ^1Default")

Last edited by lexzor; 05-22-2023 at 05:54.
lexzor is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-23-2023 , 12:49   Re: new error message
Reply With Quote #8

Quote:
Originally Posted by lexzor View Post
what?

https://www.amxmodx.org/api/amxmodx/client_print_color

do you guys even read the documentation for a native?

second parameter it is used for different team color messages

if you send a message through client_print_color and the second parameter is print_team_default, the team color will be red for players that are playing at tero and blue for ct.

PHP Code:
enum
{
    
print_team_default 0,
    
print_team_grey = -1,
    
print_team_red = -2,
    
print_team_blue = -3,
}; 
Code:
Usage examples: client_print_color(id, print_team_red, "^4Green ^3Red ^1Default")
client_print_color(id, id2, "^4Green ^3id2's team color, ^1Default")
I haven't touched it for a long time, so I'm trying to catch up on the error because the code was built in 2019
Quote:
L 05/17/2023 - 04:11:03: Client index 1137306778 is invalid
L 05/17/2023 - 04:11:03: [AMXX] Displaying debug trace (plugin "NewCommands.amxx", version "1.0")
L 05/17/2023 - 04:11:03: [AMXX] Run time error 10: native error (native "client_print_color")
L 05/17/2023 - 04:11:03: [AMXX] [0] NewCommands.sma:rintTeleport (line 1345)
L 05/17/2023 - 04:11:03: [AMXX] [1] NewCommands.sma::CmdTeleport (line 755)
L 05/17/2023 - 04:11:03: [AMXX] [2] NewCommands.sma::CmdTeleport (line 753)
L 05/17/2023 - 04:11:03: [AMXX] [3] NewCommands.sma::CommandSelector (line 224)
L 05/17/2023 - 04:11:03: [AMXX] [4] NewCommands.sma::HandleSay (line 195)
So what is the path of the parameter for id, position how can this be arranged
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-31-2023 , 14:29   Re: new error message
Reply With Quote #9

any?
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
lexzor
Veteran Member
Join Date: Nov 2020
Old 05-31-2023 , 16:11   Re: new error message
Reply With Quote #10

check if user is connected before
lexzor is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:27.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode