Raised This Month: $ Target: $400
 0% 

Error CSTRIKE


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 12-07-2011 , 10:20   Error CSTRIKE
Reply With Quote #1

Code:
L 12/07/2011 - 13:19:46: [CSTRIKE] Player out of range (85809473)
L 12/07/2011 - 13:19:46: [AMXX] Run time error 10 (plugin "bad_camper.amxx") (native "cs_get_user_team") - debug not enabled!
L 12/07/2011 - 13:19:46: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
Because have this errors in this code:

PHP Code:
public check_camping(id)
{    
    
/* don't check, if the plugin is disabled */
    
if(cs_get_user_team(id) == CS_TEAM_T) return; 
Full code:
PHP Code:
public check_camping(id)
{    
    
/* don't check, if the plugin is disabled */
    
if(cs_get_user_team(id) == CS_TEAM_T) return;    
    new 
punishmentFlags get_pcvar_num(g_cvarPunish);
    if (
punishmentFlags == 0) return;
    
    
/* don't check, if there is only one player on server */
    
new players[32], playerCnt;
    
get_players(playersplayerCnt"ch");    // don't include bots or hltv
    
if (playerCnt == && !(get_pcvar_num(g_cvarDebug) && DBG_METER_ON_1)) return;

    
/* determine acceptable camping values */
    
new allowCampValue get_pcvar_num(g_cvarAllow);
    new 
s_allowCampValue[8];
    new 
bool:allowCampByRatio;

    if (
allowCampValue 0)
    {
        
get_pcvar_string(g_cvarAllows_allowCampValue7);
        
allowCampByRatio = (contain(s_allowCampValue"%") ==-1) ? false true;
        
allowCampValue = (allowCampByRatio) ? clamp(allowCampValue1100) : clamp(allowCampValue132);
    }

    
/* determine if either team is allowed to camp */
    
new bool:allowTeamCamp[3] = {false, ...}; // using elements 1 and 2 to correspond to the values for TEAM1 and TEAM2
    
new playerCnt_team1playerCnt_team2teamIDid;

    
get_players(playersplayerCnt"h"); // don't include hltv
    
if (playerCnt >= get_pcvar_num(g_cvarMinPlayers))
    {
        
// based on their objective ...
        
if (!get_pcvar_num(g_cvarCheckAll) && g_cstrike)
        {
            if (!
g_mapHasBomb)
                
allowTeamCamp[TEAM1] = true;
            else if (
g_bombPlanted)
                
allowTeamCamp[TEAM1] = true;
            else
                
allowTeamCamp[TEAM2] = true;
        }

        
// ... and based on calculated camp allowance
        
if (allowCampValue 0)
        {
            
// get living player counts for each team
            
get_players(playersplayerCnt"ah");    // skip dead players and hltv
            
for (new playerIdx 0playerIdx playerCnt; ++playerIdx)
            {
                
id players[playerIdx];
                
teamID get_user_team(id);
                if (
teamID == TEAM1)
                    
playerCnt_team1++;
                else if (
teamID == TEAM2)
                    
playerCnt_team2++;
            }

            if (
allowCampByRatio)
            {
                
// allow camp per ratio of players on player's team to players on other team
                
if (!allowTeamCamp[TEAM1]) allowTeamCamp[TEAM1] = allowCampValue >= percent(playerCnt_team1playerCnt_team2);
                if (!
allowTeamCamp[TEAM2]) allowTeamCamp[TEAM2] = allowCampValue >= percent(playerCnt_team2playerCnt_team1);
            }
            else
            {
                
// allow camp per straight player count
                
if (!allowTeamCamp[TEAM1]) allowTeamCamp[TEAM1] = (allowCampValue >= playerCnt_team1);
                if (!
allowTeamCamp[TEAM2]) allowTeamCamp[TEAM2] = (allowCampValue >= playerCnt_team2);
            }
        }
    }

    
/* handle each player's camping needs */
    
new stdDevcampTolerance;
    new 
prevMeterbool:punishCamperFloat:punishPercentage;
    new 
announceCampStatus get_pcvar_num(g_cvarAnnounce);

    
get_players(playersplayerCnt"ah");    // skip dead players and hltv
    
for (new playerIdx 0playerIdx playerCnt; ++playerIdx)
    {
        
id players[playerIdx];
        
        
// pause the meter (don't cycle coords) if needed
        
if (g_playerFlags[id] & METER_PAUSE) continue;
        
        
// insert the current location of the player
        
coords_insert(idCOORDTYPE_BODY);
        
        
// ignore the meter if the player can legally camp or the player's meter is being ignored
        
teamID get_user_team(id);
        if (
allowTeamCamp[teamID] || g_playerFlags[id] & METER_IGNORE) continue;

        
// ignore if this player meets the immunity requirements
        
if (has_flag(idg_immunityFlags))
        {
            
// insert the current coords of where the player's shot would hit, i.e. where the player is looking
            
coords_insert(idCOORDTYPE_EYES);

            if (
standing_still(id) && !looking_around(id) && g_meter[id] >= 65 && g_meter[id] < 80) continue;
        }

        
// grab the standard deviation from the player coords
        
stdDev coords_stdv(id);

        
// grab the camping tolerance based on current objective
        
campTolerance = (!g_mapHasBomb || g_bombPlanted) ? TOLERANCE_ATTACKING TOLERANCE_DEFENDING;
        
        
// grab the current meter percentage
        
prevMeter g_meter[id];
        
        
// add new percentage points to the meter
        
g_meter[id] += (campTolerancestdDev) / get_pcvar_num(g_cvarLimit);

        
// ensure the meter falls within bounds        
        
g_meter[id] = clamp(g_meter[id], 0100);

        
// if the meter is trending down, give the player some love
        
if (g_meter[id] < prevMeter)
        {
            if (
g_meter[id] < 80)
            {
                
// help the meter find it's way down
                
g_meter[id]-= (prevMeterg_meter[id]) / 3;
                
                if (
prevMeter >= 80)
                {
                    
// ensure player isn't still being punished
                    
punish_stop_all(id);
                    
                    
// announce that the player is no longer camping
                    
if (announceCampStatus && g_playerFlags[id] & CAMPER_ANNOUNCEDcamper_announcement(idfalse);
                }
            }
        }

        
// determine how severe the punishment should be, if at all
        
punishCamper true// now prove me wrong
        
if (g_meter[id] == 100)         punishPercentage 1.00;
        else if (
g_meter[id] >= 90punishPercentage 0.50;
        else if (
g_meter[id] >= 80punishPercentage 0.10;
        else 
punishCamper false;
        
        
// punish the vile camper
        
if (punishCamper)
        {
            if (
punishmentFlags PUNISH_SLAP)     punish_slap(idpunishPercentage);
            if (
punishmentFlags PUNISH_HEALTHpunish_health_reduction(idpunishPercentage);
            if (
punishmentFlags PUNISH_BLIND)  punish_blind(idpunishPercentage);
            if (
punishmentFlags PUNISH_SOUND)  punish_sound(idpunishPercentage);
            if (
punishmentFlags PUNISH_MONEY)  punish_money_reduction(idpunishPercentage);
            if (
punishmentFlags PUNISH_SNARKSpunish_snark_attack(idpunishPercentage);

            
// announce that the player is camping
            
if (g_meter[id] >= 90 && !(g_playerFlags[id] & CAMPER_ANNOUNCED)) camper_announcement(idtrue);
        }

        
// let them know how long they've camped
        
meter_display(id);
    }

__________________

Last edited by kramesa; 12-07-2011 at 10:25.
kramesa is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 12-07-2011 , 10:21   Re: Error CSTRIKE
Reply With Quote #2

Code:
[AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
__________________
You can do anything you set your mind to, man.

Devil259 is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 12-07-2011 , 10:33   Re: Error CSTRIKE
Reply With Quote #3

Ok! But dont works the plugin only for CTs... This is Bad Camper
__________________
kramesa is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 12-07-2011 , 10:48   Re: Error CSTRIKE
Reply With Quote #4

function check_camping has no index. You have to loop throught all players and get his team.
__________________
You can do anything you set your mind to, man.

Devil259 is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 12-07-2011 , 11:03   Re: Error CSTRIKE
Reply With Quote #5

Quote:
Originally Posted by Devil259 View Post
function check_camping has no index. You have to loop throught all players and get his team.
Can you make for me?
__________________
kramesa is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 12-07-2011 , 11:19   Re: Error CSTRIKE
Reply With Quote #6

Code:
/* don't check, if there is only one player on server */ new players[32], playerCnt, id get_players(players, playerCnt, "ch");    // don't include bots or hltv for( new i = 0; i < playerCnt; i++ ) {     id = players[ i ]     if( cs_get_user_team( id ) == CS_TEAM_T ) return; }
__________________
You can do anything you set your mind to, man.


Last edited by Devil259; 12-07-2011 at 11:20.
Devil259 is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 12-07-2011 , 11:33   Re: Error CSTRIKE
Reply With Quote #7

Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

a.sma(205) : error 001: expected token: ";", but found "-identifier-"
a.sma(210) : error 001: expected token: ";", but found "if"
a.sma(226) : error 021: symbol already defined: "id"
a.sma(386) : warning 217: loose indentation
a.sma(393) : warning 217: loose indentation
a.sma(466) : warning 217: loose indentation
a.sma(505) : warning 217: loose indentation
a.sma(827) : warning 204: symbol is assigned a value that is never used: "g_cvarDebug"

3 Errors.
Could not locate output file a.amx (compile failed).


ERROR: Your plugin failed to compile, see above.
__________________

Last edited by kramesa; 12-07-2011 at 11:33.
kramesa is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-07-2011 , 20:46   Re: Error CSTRIKE
Reply With Quote #8

Perhaps you need to find a dictionary to find out what "full code" means. You've been here long enough to know what you post so just do it already. Help us help you.

Post the plugin as an attachment.
__________________

Last edited by fysiks; 12-07-2011 at 20:46.
fysiks 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 12:01.


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