Raised This Month: $ Target: $400
 0% 

PLS HELP ME !!!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
teckins
Member
Join Date: Aug 2011
Old 01-03-2012 , 19:51   PLS HELP ME !!!
Reply With Quote #1

Hey guys,

I made a plugin with help from frag awards the code is the following

Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fun>
#include <hamsandwich>

#define PLUGIN  "Awards_System_A"
#define VERSION "2.0"
#define AUTHOR  "Teckins with help from Eskemo and Acid"

#define DISPLAY_MSG

new const itemcvar[6][] = {
    "amx_frag_gravitycost",
    "amx_frag_speedcost",
    "amx_frag_stealthcost",
    "amx_frag_revivecost",
    "amx_frag_healthcost",
    "amx_frag_invisibilitycost"
};

new const itemname[6][] = {
    "low gravity",
    "speed",
    "stealth",
    "revive",
    "health",
    "invisibility"
};

new powerpurchase[33];

public plugin_init()

RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1);

{
    register_plugin(PLUGIN, VERSION, AUTHOR);
    
    register_cvar("amx_frag",  "1");
    register_cvar(itemcvar[0], "3");
    register_cvar(itemcvar[1], "6");
    register_cvar(itemcvar[2], "5");
    register_cvar(itemcvar[3], "2");
    register_cvar(itemcvar[4], "5");
    
    register_menucmd(register_menuid("Awards_System"), 1023, "pickoption");
    
    register_clcmd("say /shop", "showMENU");
    register_clcmd("say_team shop", "showMENU");
    register_concmd("awards", "showMENU");
    
    register_event("ResetHUD", "eRespawn", "b");
    register_event("CurWeapon" , "speedb" , "be" , "1=1");
}

public fwHamPlayerSpawnPost(iPlayer,id) {
        if (is_user_alive(iPlayer)) {
  client_print(id, print_chat, "Your invisibilty has been reset");
  set_user_rendering(i, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 100);
        }
}


public client_connect(id)
{
    powerpurchase[id] = 0;
}

#if defined DISPLAY_MSG
public client_putinserver(id)
{
    if (is_user_bot(id))
        return;
    
    set_task(25.0, "inform", id);
}
#endif

#if defined DISPLAY_MSG
public inform(id)
{
    client_print(id, print_chat, "[SG]: This server is running Dr Shop by Teckins with help from Eskemo");
    client_print(id, print_chat, "[SG]: Type /shop to start buying!"); 
    return PLUGIN_HANDLED;
}
#endif

public showMENU(id)
{
    new menu[192];
    new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_9;
    
    format(menu, 191, "Deathrun Shop^n^n1. Gravity^n2. Speed^n3. Stealth^n4. Revive^n5. Health^n6. Invisibility^n^n0. Exit");
    show_menu(id,keys,menu,_,"Awards_System");
    return PLUGIN_HANDLED;
}

public pickoption(id, key)
{
    if(!get_cvar_num("amx_frag"))
    {
        client_print(id, print_chat, "[SG]: Sorry, the plugin is Currently off!");
        
        return PLUGIN_HANDLED;
    }
    else if(!is_user_alive(id))
    {
        client_print(id, print_chat, "[SG]: You must be alive to purchase this item!");
        
        return PLUGIN_HANDLED;
    }
    else if(powerpurchase[id])
    {
        client_print(id, print_chat, "[SG]: You already purchased a different skill!");
        
        return PLUGIN_HANDLED;
    }
    
    new frags = get_user_frags(id);
    new cost = get_cvar_num(itemcvar[key]);
    
    if(cost >= frags)
    {
        client_print(id, print_chat, "[SG]: You don't have enough frags!");
        
        return PLUGIN_HANDLED;
    }
    
    set_user_frags(id, frags - cost);
    
    
    client_print(id, print_chat, "[SG]: You purchased %s for %i frags!", itemname[key], cost);
    
    switch(key + 1)
    {
        case 1:
        {
            set_user_gravity(id, 0.4);
        }
        case 2:
        {
            new Float:speed = get_user_maxspeed(id) + 680.0;
            set_user_maxspeed(id, speed);
        }
        case 3:
        {
            set_user_rendering(id, kRenderFxNone, 50, 50, 50, kRenderTransAdd, 50);
            set_user_footsteps(id, 1);
        }
        case 4:
        {
            // What is this go find a tut on how to revive people -.-
            //set_user_revive(id, amx_revive %s(id));
        }
        case 5:
        {
            set_user_health(id, get_user_health(id) + 50);
        }
        
        case 6:
        {
            set_user_rendering(i, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 20);

        }
    }
    
    return PLUGIN_HANDLED;
    
    powerpurchase[id] = key + 1;
    
    return PLUGIN_HANDLED;
}

public speedb(id)
{
    if(powerpurchase[id] == 2)
    {
        new Float:speed = get_user_maxspeed(id) + 680.0;
        set_user_maxspeed(id, speed);
    }
}

public eRespawn(id)
{ // Reset Purchase
    switch(powerpurchase[id])
    {
        case 1:
        {
            
            client_print(id, print_chat, "[SG]: Gravity set back to normal!");
        }
        case 2:
        {
            
            client_print(id, print_chat, "[SG]: Speed set back to normal!");
        }
        case 3:
        {
            set_user_rendering(id,kRenderFxNone,255,255,255, kRenderNormal,16);
            set_user_footsteps(id,0);
            
            client_print(id, print_chat, "[SG]: Stealth level set back to normal!");
        }
        case 4:
        {
            
            client_print(id, print_chat, "[SG]: You Used Points To Revive");
            
        }
        case 5:
        {
            
            client_print(id, print_chat, "[SG]: Invisibility Has been Turned Off");
        }
        
        
        powerpurchase[id] = true;
        
    }
    return PLUGIN_HANDLED;
}
The error is :

Code:
 drshop.sma(37) : error 055: start of function body without function header
drshop.sma(40) : error 021: symbol already defined: "register_cvar"
drshop.sma(47) : error 021: symbol already defined: "register_menucmd"
drshop.sma(49) : error 021: symbol already defined: "register_clcmd"
drshop.sma(53) : error 021: symbol already defined: "register_event"
drshop.sma(60) : error 017: undefined symbol "i"
drshop.sma(60) : warning 215: expression has no effect
drshop.sma(60) : warning 215: expression has no effect
drshop.sma(60) : warning 215: expression has no effect
drshop.sma(60) : warning 215: expression has no effect
drshop.sma(60) : warning 215: expression has no effect
drshop.sma(60) : warning 215: expression has no effect
drshop.sma(60) : error 001: expected token: ";", but found ")"
drshop.sma(60) : error 029: invalid expression, assumed zero
drshop.sma(60) : fatal error 107: too many error messages on one line


If someone can Please PLEASE I beg you to fix this code to make everything work Please thanks

Last edited by teckins; 01-03-2012 at 22:42.
teckins is offline
eskemo
Senior Member
Join Date: Dec 2008
Location: Australia
Old 01-03-2012 , 20:01   Re: PLS HELP ME !!!
Reply With Quote #2

From 25 errors to 5 errors fix rest your self or someone else might do

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

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <nvault>
#include <hamsandwich>
#include <fakemeta>

/* Admin level for access menu */

#define ADMIN_ACCESS_CMD    ADMIN_IMMUNITY 

#define PLUGIN "Dr Shop for SG"
#define VERSION "1.0"
#define AUTHOR "Teckins"

// fixed whats directly under this forgot a few on end.
new gDrShopOngHealthCostgArmorCost,gSpeedCostgGravityCostgSpeedCvargGravityCvargHealthPointCvargArmorPointCvargAdvertiseCvargKillerPointsCvargSuiciderPointsCvargSavePlayerPoints;

new 
HasHealth33 ];
new 
HasArmor33 ];
new 
HasSpeed33 ];
new 
HasGravity33 ];
new 
gName32 char ];
new 
gSteamID32 ];
new 
vKey64 ];
new 
vData64 ];
new 
gKillerPoints33 ];


public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_cvar"drshop_version"VERSIONFCVAR_SERVER FCVAR_SPONLY );
    
    
register_logevent"logevent_round_start"2"1=Round_Start" );
    
register_event"DeathMsg""Hook_Deathmessage""a" );
    
register_event"CurWeapon""HookCurWeapon""be""1=1" );
    
    
register_concmd"amx_set_points""cmdSetPoints"ADMIN_ACCESS_CMD"<name/@all> <points> - sets points to a player" );
    
    
register_concmd"amx_reset_points""cmdResetPoints"ADMIN_ACCESS_CMD"<name/@all> - resets player/players points" );
    
    
register_clcmd"say /shop""DeathrunShop" );
    
register_clcmd"say_team /shop""DeathrunShop" );
    
    
register_clcmd"say /mypoints""ShowPoints" );
    
register_clcmd"say_team /mypoints""ShowPoints" );
    
    
gDrShopOn register_cvar"amx_shop""1" );
    
gHealthCost register_cvar"deathrun_health_cost""30" );
    
gArmorCost register_cvar"deathrun_armor_cost""15" );
    
gSpeedCost register_cvar"deathrun_speed_cost""39" );
    
gGravityCost register_cvar"deathrun_gravity_cost""41" );
    
gGravityCvar register_cvar"deathrun_gravity_power""0.7" );
    
gAdvertiseCvar register_cvar"deathrun_advertise_message""1" );
    
gHealthPointCvar register_cvar"deathrun_health_points""255" );
    
gArmorPointCvar register_cvar"deathrun_armor_points""400" );
    
gKillerPointsCvar register_cvar"deathrun_killer_bonuspoints""5" );
    
gSuiciderPointsCvar register_cvar"deathrun_suicider_loose_points""3" );
    
gSavePlayerPoints register_cvar"amx_save_points""1" );
    
    
register_dictionary"DeathrunShopLang.txt" );
// You forgot this.

public plugin_cfg()
    
new 
iCfgDir32 ], iFile192 ];

get_configsdiriCfgDircharsmaxiCfgDir) );
formatexiFilecharsmaxiFile ), "%s/DeathrunShop_Cfg.cfg"iCfgDir );
if( !
file_existsiFile ) )
    
server_print"[DrShop] %L"LANG_SERVER"DRSHOP_SVPRINT"iFile );
write_fileiFile" ", -);

server_print"[DrShop] %L"LANG_SERVER"DRSHOP_SVPRINT_DONE"iFile );
server_cmd"exec %s"iFile );

server_cmd"sv_maxspeed 99999999.0" );
}
public 
client_connectid )

{

HasHealthid ] = false;
HasArmorid] = false;
HasSpeedid ] = false;
HasGravityid ] = false;

load_client_pointsid );


public 
client_disconnectid )
{
HasHealthid ] = false;
HasArmorid] = false;
HasSpeedid ] = false;
HasGravityid ] = false;

if( 
get_pcvar_numgSavePlayerPoints ) != && !is_user_botid ) )
    
    
save_client_pointsid );
    
    
    
    public 
client_putinserverid )
    {
        if( 
get_pcvar_numgAdvertiseCvar ) != )
        {
            
/* --| Need to set task, 7 default because need to wait for player choosing a team or something */
            
set_taskget_pcvar_floatgAdvertiseTimeCvar ), "ShowPlayerInfo"id );
            
        }
        
        if( 
get_pcvar_numgDrShopOn ) != )
        {
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_DISABLED" );
            return 
PLUGIN_HANDLED;
        }
        
        
/* --| If player is dead, cant buy items :) */
        
if( !is_user_aliveid ) )
        {
            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_ONLY_ALIVE" );
            return 
PLUGIN_HANDLED;
        }
        
        
/* --| Menu */
        
new szText555 char ];
        
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_MENU_TITLE"VERSIONgKillerPointsid ] );
        
        new 
menu menu_createszText"shop_handler" );
        
        
        * --| 
Menu item 1 */
        
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_4"get_pcvar_numgHealthPointCvar ), get_pcvar_numgHealthCost ) );
        
menu_additemmenuszText"4");
        
        
/* --| Menu item 2 */
        
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_5"get_pcvar_numgArmorPointCvar ), get_pcvar_numgArmorCost ) );
        
menu_additemmenuszText"5");
        
        
/* --| Menu item 3 */
        
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_6"get_pcvar_numgSpeedCost ) );
        
menu_additemmenuszText"6");
        
        
/* --| Menu item 4 */
        
formatexszTextcharsmaxszText ), "%L"id"DRSHOP_ITEM_7"get_pcvar_numgGravityCost ) );
        
menu_additemmenuszText"7");
        
        
menu_setpropmenuMPROP_EXITMEXIT_ALL );
        
        
/* --| Show the menu, with current page 0 */
        
menu_displayidmenu);
        
        return 
PLUGIN_CONTINUE;
        
        public 
shop_handleridmenuitem )
        {
            
/* --| If key is 0, let's close the menu */
            
if( item == MENU_EXIT )
            {
                
menu_destroymenu );
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Getting the menu information */
            
new data], iName64 ], accesscallback;
            
menu_item_getinfomenuitemaccessdatacharsmaxdata ), iNamecharsmaxiName ), callback );
            
            
/* --| Get menu keys */
            
new key str_to_numdata );
            
            
/* --| Here we find the player points */
            
new points gKillerPointsid ];
            
            switch( 
key )
            {
                
/* --| Menu item 1 */
                
case 1:
                {
                    
/* --| If already has item, show a damn print and return */
                    
if( HasHealthid ] )
                    {
                        
allready_haveid );
                        return 
PLUGIN_HANDLED;
                    }
                    
                    
/* --| If player does not have enough points, show a print and return */
                    
if( points get_pcvar_numgHealthCost ) )
                    {
                        
dont_haveid );
                        return 
PLUGIN_HANDLED;
                    }
                    
                    
/* --| Let's give the item, and do some stuff */ 
                    
set_user_healthidget_user_healthid ) + get_pcvar_numgHealthPointCvar ) );
                    
                    
client_printidprint_chat"[DrShop] %L"id"DRSHOP_HEALTH_ITEM"get_pcvar_numgHealthPointCvar ) );
                    
HasHealthid ] = true;
                    
                    
gKillerPointsid ] -= get_pcvar_numgHealthCost );
                    
emit_soundidCHAN_ITEMHEALTH_SOUNDVOL_NORM ATTN_NORM PITCH_NORM );
                    
menu_displayidmenu);
                }
                
                
/* --| Menu item 2 */
                
case 2:
                {
                    
/* --| If already has item, show a damn print and return */
                    
if( HasArmorid ] )
                    {
                        
allready_haveid );
                        return 
PLUGIN_HANDLED;
                    }
                    
                    
/* --| If player does not have enough points, show a print and return */
                    
if( points get_pcvar_numgArmorCost ) )
                    {
                        
dont_haveid );
                        return 
PLUGIN_HANDLED;
                    }
                    
                    
/* --| Let's give the item, and do some stuff */ 
                    
set_user_armoridget_user_armorid ) + get_pcvar_numgArmorPointCvar ) );
                    
                    
client_printidprint_chat"[DrShop] %L"id"DRSHOP_ARMOR_ITEM"get_pcvar_numgArmorPointCvar ) );    
                    
HasArmorid ] = true;
                    
                    
gKillerPointsid ] -= get_pcvar_numgArmorCost );
                    
emit_soundidCHAN_ITEMARMOR_SOUNDVOL_NORM ATTN_NORM PITCH_NORM );
                    
menu_displayidmenu);
                }
                
                
/* --| Menu item 3 */
                
case 3:
                {
                    
/* --| If already has item, show a damn print and return */
                    
if( HasSpeedid ] )
                    {
                        
allready_haveid );
                        return 
PLUGIN_HANDLED;
                    }
                    
                    
/* --| If player does not have enough points, show a print and return */
                    
if( points get_pcvar_numgSpeedCost ) )
                    {
                        
dont_haveid );
                        return 
PLUGIN_HANDLED;
                    }
                    
                    
/* --| Let's give the item, and do some stuff */ 
                    
set_user_maxspeedidget_pcvar_floatgSpeedCvar ) );
                    
                    
client_printidprint_chat"[DrShop] %L"id"DRSHOP_SPEED_ITEM" );
                    
HasSpeedid ] = true;
                    
                    
gKillerPointsid ] -= get_pcvar_numgSpeedCost );
                    
emit_soundidCHAN_ITEMPICKUP_SNDVOL_NORM ATTN_NORM PITCH_NORM );
                    
menu_displayidmenu);
                }
                
                
/* --| Menu item 4 */
                
case 4:
                {
                    
/* --| If already has item, show a damn print and return */
                    
if( HasGravityid ] )
                    {
                        
allready_haveid );
                        return 
PLUGIN_HANDLED;
                    }
                    
                    
/* --| If player does not have enough points, show a print and return */
                    
if( points get_pcvar_numgGravityCost ) )
                    {
                        
dont_haveid );
                        return 
PLUGIN_HANDLED;
                    }
                    
                    
/* --| Let's give the item, and do some stuff */ 
                    
set_user_gravityidget_pcvar_floatgGravityCvar ) );
                    
                    
client_printidprint_chat"[DrShop] %L"id"DRSHOP_GRAVITY_ITEM" );
                    
HasGravityid ] = true;
                    
                    
gKillerPointsid ] -= get_pcvar_numgGravityCost );
                    
emit_soundidCHAN_ITEMPICKUP_SNDVOL_NORM ATTN_NORM PITCH_NORM );
                    
menu_displayidmenu);
                    
                }
                
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Command for setting points | admin only ;/ */
            
public cmdSetPointsidlevelcid )
            {
                
/* --| If user doesn't have acces to command, return */
                
if( !cmd_accessidlevelcid) || !get_pcvar_numgDrShopOn ) )
                {
                    return 
PLUGIN_HANDLED
                }
                
                
/* --| Need to read the first argument */
                
new argument32 ];
                
read_argv1argumentcharsmaxargument ) );
                
                
/* --| Need to read second argument */
                
new give_points];
                
read_argv2give_pointscharsmaxgive_points ) );
                
                
/* --| We are getting the gift from second argument */
                
new gift str_to_numgive_points );
                
                new 
iPlayer32 ], iNumall;
                
get_playersiPlayeriNum"c" );
                
                
/* --| Lets see if argument 1 is @all */
                
if( equalargument"@all" ) )
                {
                    for( new 
iiNumi++ )
                    {
                        
/* --| Find the index :) */
                        
all iPlayer];
                        
                        
/* --| Set points to all */
                        
gKillerPointsall ] = gKillerPointsall ] + gift;
                        
                        
/* --| Show a print in chat */
                        
get_user_nameidgNamecharsmaxgName ) );
                        
client_print0print_chat"[DrShop] %L"LANG_PLAYER"DRSHOP_SHOW_ALLCMD"gNamegift );
                    }
                }
                
                else
                {
                    
/* --| Now, we find the target */
                    
new player cmd_targetidargument10 );
                    
                    
/* --| If is not a valid target, return */
                    
if( !player 
                    {
                        return 
PLUGIN_HANDLED;
                    }
                    
                    
                    
/* --| Get admin, and target name */
                    
new TargetName32 char ];
                    
get_user_nameplayerTargetNamecharsmaxTargetName ) );
                    
get_user_nameidgNamecharsmaxgName ) );    
                    
                    
/* --| Setting target points */
                    
gKillerPointsplayer ] = gKillerPointsplayer ] + gift;
                    
client_print0print_chat"[DrShop] %L"LANG_PLAYER"DRSHOP_SHOW_CMD"gNamegiftTargetName );
                }
                
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| Command for reseting points | admin only ;/ */
            
public cmdResetPointsidlevelcid )
            {
                
/* --| If user doesn't have acces to command, return */
                
                
if( !cmd_accessidlevelcid) || !get_pcvar_numgDrShopOn ) )
                {
                    return 
PLUGIN_HANDLED
                }
                
                
/* --| Need to read the first argument */
                
new argument32 ];
                
read_argv1argumentcharsmaxargument ) );
                
                new 
iPlayer32 ], iNumall;
                
get_playersiPlayeriNum"c" );
                
                
/* --| Lets see if argument 1 is @all */
                
if( equalargument"@all" ) )
                {
                    for( new 
iiNumi++ )
                    {
                        
/* --| Find the index :) */
                        
all iPlayer];
                        
                        
/* --| Set points to all */
                        
gKillerPointsall ] = 0;
                        
                        
/* --| Show a print in chat */
                        
get_user_nameidgNamecharsmaxgName ) );
                        
client_print0print_chat"[DrShop] %L"LANG_PLAYER"DRSHOP_SHOWRESET_ALLCMD"gName );
                    }
                }
                
                else
                {
                    
/* --| Now, we find the target */
                    
new player cmd_targetidargument10 );
                    
                    
/* --| If is not a valid target, return */
                    
if( !player 
                    {
                        return 
PLUGIN_HANDLED;
                    }
                    
                    
                    
/* --| Get admin, and target name */
                    
new TargetName32 char ];
                    
get_user_nameplayerTargetNamecharsmaxTargetName ) );
                    
get_user_nameidgNamecharsmaxgName ) );    
                    
                    
/* --| Setting target points */
                    
gKillerPointsplayer ] = 0;
                    
client_print0print_chat"[DrShop] %L"LANG_PLAYER"DRSHOP_SHOWRESET_CMD"gNameTargetName );
                }
                
                return 
PLUGIN_HANDLED;
            }
            
            
/* --| We need to find if player has performed a jump, and set some velocity */
            
public bacon_playerJumpingid )
            {
                
/* --| If plugin is on, and user has jetpack item */
                
if( get_pcvar_numgDrShopOn ) != && HasJetid ] )
                {
                    
/* --| Get user origins from feet */
                    
new iOrigin];
                    
get_user_originidiOrigin);
                    
                    
/* --| Modify origin a bit */
                    
iOrigin] -= 20;
                    
                    
/* --| Get player velocity */
                    
new Float:fVelocity];
                    
pevidpev_velocityfVelocity );
                    
                    
/* --| Modify velocity a bit */
                    
fVelocity] += 93;
                    
                    
/* --| Set the player velocity and add a flame effect, jetpack style */
                    
set_pevidpev_velocityfVelocity );
                    
create_flameiOrigin );
                }
            }    
            
            
/* --| We need to check is player has changed his weapon */
            
public HookCurWeaponid )
            {
                
/* --| If plugin is on, and user has speed item, let's set the speed again */
                
if( get_pcvar_numgDrShopOn ) != && HasSpeedid ] )
                {
                    
set_user_maxspeedidget_pcvar_floatgSpeedCvar ) );
                }
            }
            
            
/* --| Command for show points */    
            
public ShowPointsid )
            {
                
/* --| Set a hud message */
                
set_hudmessage255422120.030.8626.05.0 );
                
                
/* --| We show player points on hud */
                
show_hudmessageid"[DrShop] %L"id"DRSHOP_POINTS_INFO"gKillerPointsid ] );
                
                
/* --| We show player points on chat */
                
client_printidprint_chat"[DrShop] %L"id"DRSHOP_POINTS_INFO"gKillerPointsid ] );
                
                return 
PLUGIN_CONTINUE;
            }
            
            
/* --| Here we show player hud information about this god damn shop */
            
public ShowPlayerInfoid )
            {
                
/* --| Set a hud message */
                
set_hudmessage00255, -1.00.8206.012.0 );
                
                
/* --| Now we show the info message in hud channel */
                
show_hudmessageid"%L"id"DRSHOP_HUD_INFO" );
            }
            
            
/* --| If player has suicided by console */
            
public forward_killid )
            {
                
/* --| Check if plugin is on, and user is alive */
                
if( get_pcvar_numgDrShopOn ) == && is_user_aliveid ) )
                {
                    
/* --| Set player points with suicide cvar */
                    
client_printidprint_chat"[DrShop] %L"id"DRSHOP_SHOW_LOOSER"get_pcvar_numgSuiciderPointsCvar ) );
                    
gKillerPointsid ] -= get_pcvar_numgSuiciderPointsCvar );
                }
            }
            
            
/* --| Event for round start */        
            
public logevent_round_start()
            {
                
/* --| If plugin is on... */
                
if( get_pcvar_numgDrShopOn ) == )
                {
                    
/* --| I used this native because with get_maxplayers will recieve a damn error with invalid player id.. */
                    /* --| This is good because we can skip the damn bots */
                    
new iPlayers32 ], iNumiid;
                    
get_playersiPlayersiNum"c" );
                    
                    for( 
0iNumi++ )
                    {
                        
/* --| Find the index :) */
                        
id iPlayers];
                        
                        
HasHealthid ] = false;
                        
HasArmorid] = false;
                        
HasSpeedid ] = false;
                        
HasGravityid ] = false;
                        
                        
set_user_gravityid1.0 );    
                        
                        public 
Hook_Deathmessage()
                        {
                            
/* --| If plugin is on... */
                            
if( get_pcvar_numgDrShopOn ) == )
                            {
                                
/* --| Get the killer and attacker */
                                
new killer read_data);
                                new 
victim read_data);
                                
                                
/* --| If player has died with world / trigger_hurt */
                                
if( killer == victim )
                                {
                                    return 
PLUGIN_HANDLED;
                                }
                                
                                
/* --| Setting killer points when killed a enemy */
                                
gKillerPointskiller ] += get_pcvar_numgKillerPointsCvar );
                                
                                
HasHealthvictim ] = false;
                                
HasArmorvictim ] = false;
                                
HasSpeedvictim ] = false;
                                
HasGravityvictim ] = false;
                                
                                
set_user_gravityvictim1.0 );
                                
                                
remove_taskvictim );
                            }
                            
                            return 
PLUGIN_CONTINUE;
                        }
                        
                        
stock allready_haveid )
                        {
                            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_ALLREADY_HAVE" );
                        }    
                        
                        
/* --| Display a message in chat if player don't have enough points */
                        
stock dont_haveid )
                        {
                            
client_printidprint_chat"[DrShop] %L"id"DRSHOP_DONTHAVE_POINTS" );
                        }    
                        
                        
/* --| Saving player points */
                        
stock save_client_pointsindex )
                        {
                            
/* --| Open the vault file */
                            
gVault nvault_open"DeathrunShop_SavedPoints" );
                            
                            
/* --| If vault return -1, lets stop this shit */
                            
if( gVault == INVALID_HANDLE )
                            {
                                
set_fail_state"[DrShop] nValut ERROR: =-> Invalid-Handle" );
                            }
                            
                            
/* --| Get the player steamid */
                            
get_user_authidindexgSteamIDcharsmaxgSteamID ) );
                            
                            
/* --| Setting stuff on vault file, and close the file */
                            
formatexvKeycharsmaxvKey ), "%sPOINTS"gSteamID );
                            
formatexvDatacharsmaxvData ), "%d"gKillerPointsindex ] );
                            
nvault_setgVaultvKeyvData );
                            
nvault_closegVault );
                        }
                        
                        
/* --| Loading client points */
                        
stock load_client_pointsindex )
                        {
                            
/* --| Open the vault file */
                            
gVault nvault_open"DeathrunShop_SavedPoints" );
                            
                            
/* --| If vault return -1, lets stop this shit */
                            
if( gVault == INVALID_HANDLE )
                            {
                                
set_fail_state"[DrShop] nValut ERROR: =-> Invalid-Handle" );
                            }
                            
                            
/* --| Get the player steamid */
                            
get_user_authidindexgSteamIDcharsmaxgSteamID ) );
                            
                            
/* --| Get the player points, then, close the nvault vile */
                            
formatexvKeycharsmaxvKey ), "%sPOINTS"gSteamID );
                            
gKillerPointsindex ] = nvault_getgVaultvKey );
                            
nvault_closegVault );
                            
                            
set_pdata_intindexm_iNvg0m_iLinuxDiff );
                        } 
__________________


Free Australian FASTDL Server PM ME

Last edited by eskemo; 01-03-2012 at 20:09.
eskemo is offline
teckins
Member
Join Date: Aug 2011
Old 01-03-2012 , 20:24   Re: PLS HELP ME !!!
Reply With Quote #3

I tried on awards system can you pls check that thanks bro
teckins is offline
eskemo
Senior Member
Join Date: Dec 2008
Location: Australia
Old 01-03-2012 , 21:02   Re: PLS HELP ME !!!
Reply With Quote #4

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fun>

#define PLUGIN  "Awards_System_A"
#define VERSION "2.0"
#define AUTHOR  "-Acid-"

#define DISPLAY_MSG

new const itemcvar[6][] = {
    
"amx_frag_gravitycost",
    
"amx_frag_speedcost",
    
"amx_frag_stealthcost",
    
"amx_frag_revivecost",
    
"amx_frag_healthcost",
    
"amx_frag_invisibilitycost"
};

new const 
itemname[6][] = {
    
"low gravity",
    
"speed",
    
"stealth",
    
"revive",
    
"health",
    
"invisibility"
};

new 
powerpurchase[33];

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_cvar("amx_frag",  "1");
    
register_cvar(itemcvar[0], "3");
    
register_cvar(itemcvar[1], "6");
    
register_cvar(itemcvar[2], "5");
    
register_cvar(itemcvar[3], "2");
    
register_cvar(itemcvar[4], "5");
    
    
register_menucmd(register_menuid("Awards_System"), 1023"pickoption");
    
    
register_clcmd("say /shop""showMENU");
    
register_clcmd("say_team shop""showMENU");
    
register_concmd("awards""showMENU");
    
    
register_event("ResetHUD""eRespawn""b");
    
register_event("CurWeapon" "speedb" "be" "1=1");
}

public 
client_connect(id)
{
    
powerpurchase[id] = 0;
}

#if defined DISPLAY_MSG
public client_putinserver(id)
{
    if (
is_user_bot(id))
        return;
    
    
set_task(25.0"inform"id);
}
#endif

#if defined DISPLAY_MSG
public inform(id)
{
    
client_print(idprint_chat"[SG]: This server is running Awards_System By -Acid-");
    
client_print(idprint_chat"[A_S]: Type /shop to start buying!"); 
    return 
PLUGIN_HANDLED;
}
#endif

public showMENU(id)
{
    new 
menu[192];
    new 
keys MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_9;
    
    
format(menu191"Awards_System^n^n1. Gravity^n2. Speed^n3. Stealth^n4. Revive^n5. Health^n6. Invisibility^n^n0. Exit");
    
show_menu(id,keys,menu,_,"Awards_System");
    return 
PLUGIN_HANDLED;
}

public 
pickoption(idkey)
{
    if(!
get_cvar_num("amx_frag"))
    {
        
client_print(idprint_chat"[SG]: Sorry, the plugin is Currently off!");
        
        return 
PLUGIN_HANDLED;
    }
    else if(!
is_user_alive(id))
    {
        
client_print(idprint_chat"[SG]: You must be alive to purchase this item!");
        
        return 
PLUGIN_HANDLED;
    }
    else if(
powerpurchase[id])
    {
        
client_print(idprint_chat"[SG]: You already purchased a different skill!");
        
        return 
PLUGIN_HANDLED;
    }
    
    new 
frags get_user_frags(id);
    new 
cost get_cvar_num(itemcvar[key]);
    
    if(
cost >= frags)
    {
        
client_print(idprint_chat"[SG]: You don't have enough frags!");
        
        return 
PLUGIN_HANDLED;
    }
    
    
set_user_frags(idfrags cost);
    
    
    
client_print(idprint_chat"[SG]: You purchased %s for %i frags!"itemname[key], cost);
    
    switch(
key 1)
    {
        case 
1:
        {
            
set_user_gravity(id0.4);
        }
        case 
2:
        {
            new 
Float:speed get_user_maxspeed(id) + 680.0;
            
set_user_maxspeed(idspeed);
        }
        case 
3:
        {
            
set_user_rendering(idkRenderFxNone505050kRenderTransAdd50);
            
set_user_footsteps(id1);
        }
        case 
4:
        {
            
// What is this go find a tut on how to revive people -.-
            //set_user_revive(id, amx_revive %s(id));
        
}
        case 
5:
        {
            
set_user_health(idget_user_health(id) + 50);
        }
        
        case 
6:
        {
            
// This is not a render -.- this will not work. 
            // Go find a tut on rendering.
            //set_user_invisibility (id, amx_glow %s 0 0 0 0(id)  
        
}
    }
    
    return 
PLUGIN_HANDLED;
    
// Fix this line of code for now it will be commented. find a correct place for it.
    //powerpurchase[id] = key + 1;
    
    //This is not needed if u have a return PLUGIN_HANDLED a line above it
    //return PLUGIN_HANDLED;
}

public 
speedb(id)
{
    if(
powerpurchase[id] == 2)
    {
        new 
Float:speed get_user_maxspeed(id) + 680.0;
        
set_user_maxspeed(idspeed);
    }
}

public 
eRespawn(id)
// Reset Purchase
    
switch(powerpurchase[id])
    {
        case 
1:
        {
            
            
client_print(idprint_chat"[SG]: Gravity set back to normal!");
        }
        case 
2:
        {
            
            
client_print(idprint_chat"[SG]: Speed set back to normal!");
        }
        case 
3:
        {
            
set_user_rendering(id,kRenderFxNone,255,255,255kRenderNormal,16);
            
set_user_footsteps(id,0);
            
            
client_print(idprint_chat"[SG]: Stealth level set back to normal!");
        }
        case 
4:
        {
            
            
client_print(idprint_chat"[SG]: You Used Points To Revive");
            
        }
        case 
5:
        {
            
            
client_print(idprint_chat"[SG]: Invisibility Has been Turned Off");
        }
        
        
//its true or false fix this and rest of parts to the plugin that it handles.
        //powerpurchase[id] = true;
        
    
}
    return 
PLUGIN_HANDLED;

FIX THE PARTS WITH // infront like case 5 case 6 so on.


For invisibility set_user_rendering(i, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 0); then on round start do same line set_user_rendering(i, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 100);

Notice 0/100 are different as that's the percentage of invisibility that player is.
__________________


Free Australian FASTDL Server PM ME

Last edited by eskemo; 01-03-2012 at 21:05.
eskemo is offline
teckins
Member
Join Date: Aug 2011
Old 01-03-2012 , 21:05   Re: PLS HELP ME !!!
Reply With Quote #5

dude I had trouble with both of them the invisibility and revive I know about how to do amx_revive and amx_glow player 0 0 0 0 to turn them invisible what can I do to fix these? do you know any ideas about revive and glow ? pls and thanks
teckins is offline
eskemo
Senior Member
Join Date: Dec 2008
Location: Australia
Old 01-03-2012 , 21:09   Re: PLS HELP ME !!!
Reply With Quote #6

Add me on steam eskemo199511
__________________


Free Australian FASTDL Server PM ME
eskemo is offline
teckins
Member
Join Date: Aug 2011
Old 01-03-2012 , 21:34   Re: PLS HELP ME !!!
Reply With Quote #7

done hope you post the new code

Last edited by teckins; 01-03-2012 at 22:20.
teckins is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-03-2012 , 23:04   Re: PLS HELP ME !!!
Reply With Quote #8

Quote:
Originally Posted by eskemo View Post
Notice 0/100 are different as that's the percentage of invisibility that player is.
the values are 0-255

0 = Fully Invisible
255 = Normal
Doc-Holiday is offline
eskemo
Senior Member
Join Date: Dec 2008
Location: Australia
Old 01-04-2012 , 07:00   Re: PLS HELP ME !!!
Reply With Quote #9

Quote:
Originally Posted by Doc-Holiday View Post
the values are 0-255

0 = Fully Invisible
255 = Normal
Sorry i was unaware thank you.
__________________


Free Australian FASTDL Server PM ME
eskemo 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 13:45.


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