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

[THC RPG] Total HardCore RPG


Post New Thread Reply   
 
Thread Tools Display Modes
TryNoob
BANNED
Join Date: Aug 2011
Old 01-29-2012 , 15:47   Re: [THC RPG] Total HardCore RPG
Reply With Quote #1351

Skill returns the weapon in the early rounds.

Code:
/*
 * ============================================================================
 *
 *  [THC RPG] Total HardCore RPG
 *
 *  File:          recovery.inc
 *  Type:          Upgrade
 *  Description:   
 *  Author:        
 *
 *  Copyright (C) 
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * ============================================================================
 */
  
#include <sdkhooks>
new Handle:Weapons[MAXPLAYERS+1];
/**
 * This module's identifier.
 */
new Module:g_modulerecovery;

new g_recoveryUpgradeConfigCache[UpgradeConfigs];

/**
 * Register this module.
 */
recovery_Register()
{
    // Define all the module's data as layed out by enum ModuleData in project.inc.
    new moduledata[ModuleData];
    
    moduledata[ModuleData_Disabled] = false;
    moduledata[ModuleData_Hidden] = false;
    strcopy(moduledata[ModuleData_FullName], MM_DATA_FULLNAME, "[OBT] Recovery Weapon");
    strcopy(moduledata[ModuleData_ShortName], MM_DATA_SHORTNAME, "recovery");
    strcopy(moduledata[ModuleData_Description], MM_DATA_DESCRIPTION, "Recovery Weapon");
    
    new Module:dependencies[MM_DATA_DEPENDENCIES];
    dependencies[0] = g_moduleCore;
    dependencies[1] = INVALID_MODULE;
    moduledata[ModuleData_Dependencies] = dependencies;

    new Module:interlocks[MM_DATA_INTERLOCKS];
    interlocks[0] = INVALID_MODULE;
    moduledata[ModuleData_Interlocks] = interlocks;

    moduledata[ModuleData_TeamLock] = 0;
    moduledata[ModuleData_MaxLevel] = 1;
    moduledata[ModuleData_Cost] = 25;
    moduledata[ModuleData_iCost] = 10;

    // Send this array of data to the module manager.
    g_modulerecovery = ModuleMgr_Register(moduledata);

    // Now register the events we're going to use.
    #if defined EVENT_MANAGER
        EventMgr_RegisterEvent(g_modulerecovery, "Event_OnEventsRegister", "recovery_OnEventsRegister");
    #endif  
  
    // Register config file(s) that this module will use.
    #if defined CONFIG_MANAGER
        ConfigMgr_Register(g_modulerecovery, "recovery_OnConfigReload", "configs/thc_rpg/recovery.txt");
    #endif
}

/**
 * Register all events here.
 */
public recovery_OnEventsRegister()
{
    // Register all the events needed for this module.
    EventMgr_RegisterEvent(g_modulerecovery, "Event_OnMapStart",             "recovery_OnMapStart");
    EventMgr_RegisterEvent(g_modulerecovery, "Event_OnClientDisconnect",      "recovery_OnClientDisconnect");
    EventMgr_RegisterEvent(g_modulerecovery, "Event_OnConfigsExecuted",       "recovery_OnConfigsExecuted");
    EventMgr_RegisterEvent(g_modulerecovery, "Event_OnClientPutInServer",     "recovery_OnClientPutInServer");
    #if defined PROJECT_GAME_CSS
        //EventMgr_RegisterEvent(g_modulerecovery, "Event_PlayerDeath",             "recovery_PlayerDeath");
        //EventMgr_RegisterEvent(g_modulerecovery, "Event_PlayerHurt",             "recovery_PlayerHurt");
        EventMgr_RegisterEvent(g_modulerecovery, "Event_RoundEnd",                "recovery_RoundEnd");
        EventMgr_RegisterEvent(g_modulerecovery, "Event_PlayerSpawn",           "recovery_PlayerSpawn");
    #endif
}

/**
 * All modules and events have been registered by this point.  Event priority can be changed here.
 */
public recovery_OnEventsReady()
{
}

#if defined CONFIG_MANAGER
/**
 * Called when a registered config file (by this module) is manually reloaded.
 */
public recovery_OnConfigReload(configindex)
{
    #if defined LOG_MANAGER
        LogMgr_Print(g_modulerecovery, LogType_Normal, "recoveryConfigReload", "Reloaded recovery module's config (index %d)", configindex);
    #endif

    ConfigMgr_CacheKv(g_modulerecovery, CM_CONFIGINDEX_FIRST, "recoveryModule_ConfigCache");
}

/**
  * Read config values
  */
public KvCache:recoveryModule_ConfigCache(Handle:kv, sectionindex, const String:sectionname[])
{
    // Read Upgrade config
    if(StrEqual(sectionname, "recovery", false))
    {
        g_recoveryUpgradeConfigCache[UpgradeConfig_Disable] = KvGetNum(kv, "disable");
        g_recoveryUpgradeConfigCache[UpgradeConfig_TeamLock] = KvGetNum(kv, "teamlock");
        g_recoveryUpgradeConfigCache[UpgradeConfig_MaxLevel] = KvGetNum(kv, "maxlevel");
        g_recoveryUpgradeConfigCache[UpgradeConfig_Cost] = KvGetNum(kv, "cost");
        g_recoveryUpgradeConfigCache[UpgradeConfig_iCost] = KvGetNum(kv, "icost");

        if(g_recoveryUpgradeConfigCache[UpgradeConfig_Disable]==1)
            ModuleMgr_Disable(g_modulerecovery);
        
        ModuleMgr_WriteCell(g_modulerecovery, ModuleData_MaxLevel, g_recoveryUpgradeConfigCache[UpgradeConfig_MaxLevel]);
        ModuleMgr_WriteCell(g_modulerecovery, ModuleData_Cost, g_recoveryUpgradeConfigCache[UpgradeConfig_Cost]);
        ModuleMgr_WriteCell(g_modulerecovery, ModuleData_iCost, g_recoveryUpgradeConfigCache[UpgradeConfig_iCost]);
    }
}
#endif

/**
 * The map has started.
 */
public recovery_OnMapStart()
{
    #if defined CONFIG_MANAGER
        ConfigMgr_CacheKv(g_modulerecovery, CM_CONFIGINDEX_FIRST, "recoveryModule_ConfigCache");
    #endif
}

public recovery_PlayerSpawn(client)
{
    new level=GetPlayerUpgradeLevel(client,g_modulerecovery);
    if(level>0)
    {
        new weapons = GetArraySize(Weapons[client]);

        if (!weapons)
            return;
        
        for (new x=0; x < 5; x++)
        {
            new remove_weapon=GetPlayerWeaponSlot(client, x);
            if(IsValidEdict(remove_weapon))
            {
                RemovePlayerItem(client, remove_weapon);
                AcceptEntityInput(remove_weapon, "Kill");
            }
        }
        
        for (new i, String:weapon[128]; i < weapons; i++)
        {            
            GetArrayString(Weapons[client], i, weapon, sizeof(weapon));    
            GivePlayerItem(client, weapon);
        }
        
        ClearArray(Weapons[client]);
    }
}

public Action:Hook_WeaponDrop(client, entity)
{
    if(entity >= 0&&IsValidPlayer(client)&&IsClientInGame(client))
    {
        if(GetClientHealth(client)<=0)
        {
            decl String:weapon[128];
            GetEdictClassname(entity, weapon, sizeof(weapon));
            PushArrayString(Weapons[client], weapon);
        }
    }
}

public OnEntityDestroyed(entity)
{
    if (entity <= MaxClients || !IsValidEdict(entity))
        return;

    decl String:classname[128];
    GetEdictClassname(entity, classname, sizeof classname);

    if (StrContains(classname, "weapon_") == -1)
        return;

    new client = GetEntPropEnt(entity, Prop_Data, "m_hOwnerEntity");

    if (client == -1 || !IsClientInGame(client) || IsPlayerAlive(client))
        return;

    PushArrayString(Weapons[client], classname);
}

/**
 * Round has ended.
 *
 * @param winner    The index of the winning team.
 */
public recovery_RoundEnd(winner)
{
    new Handle:restart_delay=FindConVar("mp_round_restart_delay");
    new Float:convar=GetConVarFloat(restart_delay);
    CreateTimer(convar-0.5, RoundEndPushArray);
}

public Action:RoundEndPushArray(Handle:timer)
{
    for(new client=1;client<=MaxClients;client++)
    {
        if(client < 1 || !IsClientInGame(client) || !IsPlayerAlive(client))
            continue;
        for(new x=0;x<5;x++)
        {
            new weapons = GetPlayerWeaponSlot(client, x);
            if(weapons != -1)
            {
                decl String:weapon[64];
                GetEdictClassname(weapons, weapon, sizeof(weapon));
                PushArrayString(Weapons[client], weapon);
            }
        }
    }
}

public recovery_OnConfigsExecuted()
{
    for (new i = 1; i <= MaxClients; i++)
    {
        Weapons[i] = CreateArray(128);
    }
}

/**
 * Client has joined the server.
 * 
 * @param client    The client index.
 */
public recovery_OnClientPutInServer(client)
{
    SDKHook(client, SDKHook_WeaponDrop, Hook_WeaponDrop);
}

/**
 * Client is disconnecting from the server.
 * 
 * @param client    The client index.
 */
public recovery_OnClientDisconnect(client)
{
    ClearArray(Weapons[client]);
}
And the translation (ru)
Code:
  "recovery_fullname"
  {
    "en" ""
    "de" ""
    "fr" ""
    "no" ""
    "se" ""
    "tr" ""
    "hu" ""
    "pl" ""
    "ru" "Возврат оружия"
    "dk" ""
    "nl" ""
    "lv" ""
  }
  "recovery_description"
  {
    "en" ""
    "de" ""
    "fr" ""
    "no" ""
    "se" ""
    "tr" ""
    "hu" ""
    "pl" ""
    "ru" "Возвращает оружие в следующем раунде"
    "dk" ""
    "nl" ""
    "lv" ""
  }

Last edited by TryNoob; 01-31-2012 at 15:04. Reason: Fix bug.
TryNoob is offline
monomizer
Junior Member
Join Date: Sep 2011
Old 01-30-2012 , 07:22   Re: [THC RPG] Total HardCore RPG
Reply With Quote #1352

TryNoob
compiled in an error:

E:\Server\css\cstrike\addons\sourcemod\script ing>spcomp thc_rpg.sp
SourcePawn Compiler 1.4.1
Copyright (c) 1997-2006, ITB CompuPhase, (C)2004-2008 AlliedModders, LLC

thc_rpg/upgrades/recovery.inc(155) : error 017: undefined symbol "Weapons"
thc_rpg/upgrades/recovery.inc(155) : warning 215: expression has no effect
thc_rpg/upgrades/recovery.inc(155) : error 001: expected token: ";", but found "
]"
thc_rpg/upgrades/recovery.inc(155) : error 029: invalid expression, assumed zero

thc_rpg/upgrades/recovery.inc(155) : fatal error 127: too many error messages on
one line

Compilation aborted.
4 Errors.

E:\Server\css\cstrike\addons\sourcemod\script ing>pause
Для продолжения нажмите любую клавишу . . .

Fix please

Last edited by monomizer; 01-30-2012 at 07:23.
monomizer is offline
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 01-30-2012 , 09:44   Re: [THC RPG] Total HardCore RPG
Reply With Quote #1353

also, thcrpg tries not to rely on sdkhooks (dunno, ask arsirc) and also this doesnt offer any config options, also this could possibly be done using csweapondrop forward that was first appeared in sm 1.4.0, and also a pre-hook instead of entitydestroy
__________________
Taking private C++/PHP/SourcePawn requests, PM me.
Zephyrus is offline
TryNoob
BANNED
Join Date: Aug 2011
Old 01-30-2012 , 13:53   Re: [THC RPG] Total HardCore RPG
Reply With Quote #1354

Quote:
Originally Posted by monomizer View Post
TryNoob

Fix please
Fixed... I just have in project_events was at first..
Исправил... У меня в project_events сначало было просто..


Zephyrus, this is my option. Made long ago, so not very =)
Could write his own version entitydestroy here? I do not understand / not correctly translated.
TryNoob is offline
monomizer
Junior Member
Join Date: Sep 2011
Old 01-31-2012 , 13:38   Re: [THC RPG] Total HardCore RPG
Reply With Quote #1355

TryNoob

E:\Server\css\cstrike\addons\sourcemod\script ing>spcomp thc_rpg.sp
SourcePawn Compiler 1.4.1
Copyright (c) 1997-2006, ITB CompuPhase, (C)2004-2008 AlliedModders, LLC

thc_rpg/upgrades/recovery.inc(259) : error 017: undefined symbol "SDKHook"
thc_rpg.sp(212) : warning 203: symbol is never used: "recovery_Register"

1 Error.

E:\Server\css\cstrike\addons\sourcemod\script ing>pause
Для продолжения нажмите любую клавишу . . .
monomizer is offline
TryNoob
BANNED
Join Date: Aug 2011
Old 01-31-2012 , 15:04   Re: [THC RPG] Total HardCore RPG
Reply With Quote #1356

Quote:
Originally Posted by monomizer View Post
TryNoob

E:\Server\css\cstrike\addons\sourcemod\script ing>spcomp thc_rpg.sp
SourcePawn Compiler 1.4.1
Copyright (c) 1997-2006, ITB CompuPhase, (C)2004-2008 AlliedModders, LLC

thc_rpg/upgrades/recovery.inc(259) : error 017: undefined symbol "SDKHook"
thc_rpg.sp(212) : warning 203: symbol is never used: "recovery_Register"

1 Error.

E:\Server\css\cstrike\addons\sourcemod\script ing>pause
Для продолжения нажмите любую клавишу . . .
#include <sdkhooks> - fix.
TryNoob is offline
arsirc
Veteran Member
Join Date: Dec 2007
Location: Carinthia,Austria,Earth
Old 01-31-2012 , 15:28   Re: [THC RPG] Total HardCore RPG
Reply With Quote #1357

Quote:
Originally Posted by Zephyrus View Post
also, thcrpg tries not to rely on sdkhooks (dunno, ask arsirc) and also this doesnt offer any config options, also this could possibly be done using csweapondrop forward that was first appeared in sm 1.4.0, and also a pre-hook instead of entitydestroy
but there is no reason why you should not go with SDKHooks!
if you think that it is useful, please feel free to use it!
arsirc is offline
TryNoob
BANNED
Join Date: Aug 2011
Old 02-02-2012 , 13:46   Re: [THC RPG] Total HardCore RPG
Reply With Quote #1358

Here's a version without sdkhook:

Code:
new Handle:Weapons[MAXPLAYERS+1]; 
/**
 * This module's identifier.
 */
new Module:g_modulerecovery;

new g_recoveryUpgradeConfigCache[UpgradeConfigs];

/**
 * Register this module.
 */
recovery_Register()
{
    // Define all the module's data as layed out by enum ModuleData in project.inc.
    new moduledata[ModuleData];
    
    moduledata[ModuleData_Disabled] = false;
    moduledata[ModuleData_Hidden] = false;
    strcopy(moduledata[ModuleData_FullName], MM_DATA_FULLNAME, "recovery Weapon");
    strcopy(moduledata[ModuleData_ShortName], MM_DATA_SHORTNAME, "recovery");
    strcopy(moduledata[ModuleData_Description], MM_DATA_DESCRIPTION, "recovery Weapon");
    
    new Module:dependencies[MM_DATA_DEPENDENCIES];
    dependencies[0] = g_moduleCore;
    dependencies[1] = INVALID_MODULE;
    moduledata[ModuleData_Dependencies] = dependencies;

    new Module:interlocks[MM_DATA_INTERLOCKS];
    interlocks[0] = INVALID_MODULE;
    moduledata[ModuleData_Interlocks] = interlocks;

    moduledata[ModuleData_TeamLock] = 0;
    moduledata[ModuleData_MaxLevel] = 3;
    moduledata[ModuleData_Cost] = 15;
    moduledata[ModuleData_iCost] = 25;

    // Send this array of data to the module manager.
    g_modulerecovery = ModuleMgr_Register(moduledata);

    // Now register the events we're going to use.
    #if defined EVENT_MANAGER
        EventMgr_RegisterEvent(g_modulerecovery, "Event_OnEventsRegister", "recovery_OnEventsRegister");
    #endif  
  
    // Register config file(s) that this module will use.
    #if defined CONFIG_MANAGER
        ConfigMgr_Register(g_modulerecovery, "recovery_OnConfigReload", "configs/thc_rpg/recovery.txt");
    #endif
}

/**
 * Register all events here.
 */
public recovery_OnEventsRegister()
{
    // Register all the events needed for this module.
    EventMgr_RegisterEvent(g_modulerecovery, "Event_OnMapStart",             "recovery_OnMapStart");
    EventMgr_RegisterEvent(g_modulerecovery, "Event_OnClientDisconnect",      "recovery_OnClientDisconnect");
    EventMgr_RegisterEvent(g_modulerecovery, "Event_OnConfigsExecuted",       "recovery_OnConfigsExecuted");
    //EventMgr_RegisterEvent(g_modulerecovery, "Event_OnClientPutInServer",     "recovery_OnClientPutInServer");
    #if defined PROJECT_GAME_CSS
        //EventMgr_RegisterEvent(g_modulerecovery, "Event_PlayerDeath",             "recovery_PlayerDeath");
        //EventMgr_RegisterEvent(g_modulerecovery, "Event_PlayerHurt",             "recovery_PlayerHurt");
        EventMgr_RegisterEvent(g_modulerecovery, "Event_RoundEnd",                "recovery_RoundEnd");
        EventMgr_RegisterEvent(g_modulerecovery, "Event_PlayerSpawn",           "recovery_PlayerSpawn");
    #endif
}

/**
 * All modules and events have been registered by this point.  Event priority can be changed here.
 */
public recovery_OnEventsReady()
{
}

#if defined CONFIG_MANAGER
/**
 * Called when a registered config file (by this module) is manually reloaded.
 */
public recovery_OnConfigReload(configindex)
{
    #if defined LOG_MANAGER
        LogMgr_Print(g_modulerecovery, LogType_Normal, "recoveryConfigReload", "Reloaded recovery module's config (index %d)", configindex);
    #endif

    ConfigMgr_CacheKv(g_modulerecovery, CM_CONFIGINDEX_FIRST, "recoveryModule_ConfigCache");
}

/**
  * Read config values
  */
public KvCache:recoveryModule_ConfigCache(Handle:kv, sectionindex, const String:sectionname[])
{
    // Read Upgrade config
    if(StrEqual(sectionname, "recovery", false))
    {
        g_recoveryUpgradeConfigCache[UpgradeConfig_Disable] = KvGetNum(kv, "disable");
        g_recoveryUpgradeConfigCache[UpgradeConfig_TeamLock] = KvGetNum(kv, "teamlock");
        g_recoveryUpgradeConfigCache[UpgradeConfig_MaxLevel] = KvGetNum(kv, "maxlevel");
        g_recoveryUpgradeConfigCache[UpgradeConfig_Cost] = KvGetNum(kv, "cost");
        g_recoveryUpgradeConfigCache[UpgradeConfig_iCost] = KvGetNum(kv, "icost");

        if(g_recoveryUpgradeConfigCache[UpgradeConfig_Disable]==1)
            ModuleMgr_Disable(g_modulerecovery);
        
        ModuleMgr_WriteCell(g_modulerecovery, ModuleData_MaxLevel, g_recoveryUpgradeConfigCache[UpgradeConfig_MaxLevel]);
        ModuleMgr_WriteCell(g_modulerecovery, ModuleData_Cost, g_recoveryUpgradeConfigCache[UpgradeConfig_Cost]);
        ModuleMgr_WriteCell(g_modulerecovery, ModuleData_iCost, g_recoveryUpgradeConfigCache[UpgradeConfig_iCost]);
    }
}
#endif

/**
 * The map has started.
 */
public recovery_OnMapStart()
{
    #if defined CONFIG_MANAGER
        ConfigMgr_CacheKv(g_modulerecovery, CM_CONFIGINDEX_FIRST, "recoveryModule_ConfigCache");
    #endif
}

public recovery_OnConfigsExecuted()
{
    for (new i = 1; i <= MaxClients; i++)
    {
        Weapons[i] = CreateArray(128);
    }
}

public Action:CS_OnCSWeaponDrop(client, weaponIndex)
{
    if (!IsValidPlayer(client) || !IsValidEdict(weaponIndex))
        return;
    
    new level=GetPlayerUpgradeLevel(client, g_modulerecovery);
    if(weaponIndex < 1 || GetClientHealth(client) > 0 || level < 1)
        return;    
    
    decl String:weapon[64];
    GetEdictClassname(weaponIndex, weapon, sizeof(weapon));
    if(!StrEqual(weapon, "weapon_c4"))
    {
        if(level>=1 && (StrEqual(weapon, "weapon_hegrenade") || StrEqual(weapon, "weapon_flashbang") || StrEqual(weapon, "weapon_smokegrenade")))
            PushArrayString(Weapons[client], weapon);
        if(level>=2 && (StrEqual(weapon, "weapon_glock") || StrEqual(weapon, "weapon_usp") || StrEqual(weapon, "weapon_p228") || StrEqual(weapon, "weapon_deagle") || StrEqual(weapon, "weapon_elite") || StrEqual(weapon, "weapon_fiveseven")))
            PushArrayString(Weapons[client], weapon);
        if(level>=3)
            PushArrayString(Weapons[client], weapon);
    }
}

public OnEntityDestroyed(entity)
{
    if (!IsValidEdict(entity))
        return;

    decl String:classname[64];
    GetEdictClassname(entity, classname, sizeof(classname));

    if (StrContains(classname, "weapon_") == -1)
        return;
    
    new client = GetEntPropEnt(entity, Prop_Data, "m_hOwnerEntity");

    if (client == -1 || !IsValidPlayer(client))
        return;
    
    new level=GetPlayerUpgradeLevel(client, g_modulerecovery);
    if(IsPlayerAlive(client) || level < 1)
        return;
    
    if(level>=1 && (StrEqual(classname, "weapon_hegrenade") || StrEqual(classname, "weapon_flashbang") || StrEqual(classname, "weapon_smokegrenade")))
        PushArrayString(Weapons[client], classname);
    if(level>=2 && (StrEqual(classname, "weapon_glock") || StrEqual(classname, "weapon_usp") || StrEqual(classname, "weapon_p228") || StrEqual(classname, "weapon_deagle") || StrEqual(classname, "weapon_elite") || StrEqual(classname, "weapon_fiveseven")))
        PushArrayString(Weapons[client], classname);
    if(level>=3)
        PushArrayString(Weapons[client], classname);
}

public recovery_RoundEnd(winner)
{
    new Handle:restart_delay=FindConVar("mp_round_restart_delay");
    new Float:convar=GetConVarFloat(restart_delay);
    if(convar > 0.1)
        CreateTimer(convar-0.1, RoundEndPushArray);
    else
        CreateTimer(0.0, RoundEndPushArray);
}

public Action:RoundEndPushArray(Handle:timer)
{
    for(new client=1; client<=MaxClients; client++)
    {
        if(client < 1 || !IsValidPlayer(client))
            continue;
        
        new level=GetPlayerUpgradeLevel(client, g_modulerecovery);
        if(!IsPlayerAlive(client) || level < 1)
            continue;
        
        for(new x=0; x<=3; x++)
        {
            new weapons = GetPlayerWeaponSlot(client, x);
            if(weapons == -1)
                continue;
            
            decl String:weapon[64];
            GetEdictClassname(weapons, weapon, sizeof(weapon));

            if(level>=1 && (StrEqual(weapon, "weapon_hegrenade") || StrEqual(weapon, "weapon_flashbang") || StrEqual(weapon, "weapon_smokegrenade")))
                PushArrayString(Weapons[client], weapon);
            if(level>=2 && (StrEqual(weapon, "weapon_glock") || StrEqual(weapon, "weapon_usp") || StrEqual(weapon, "weapon_p228") || StrEqual(weapon, "weapon_deagle") || StrEqual(weapon, "weapon_elite") || StrEqual(weapon, "weapon_fiveseven")))
                PushArrayString(Weapons[client], weapon);
            if(level>=3)
                PushArrayString(Weapons[client], weapon);
        }
    }
}

public recovery_PlayerSpawn(client)
{
    new level=GetPlayerUpgradeLevel(client,g_modulerecovery);
    if(level>0)
    {
        new weapons = GetArraySize(Weapons[client]);
        if (!weapons)
            return;
        
        for (new x=0; x<=3; x++)
        {            
            new remove_weapon=GetPlayerWeaponSlot(client, x);
            if(!IsValidEdict(remove_weapon))
                continue;
            
            decl String:remove_weapon_name[64];
            GetEdictClassname(remove_weapon, remove_weapon_name, sizeof(remove_weapon_name));
            if(StrEqual(remove_weapon_name, "weapon_c4")||StrEqual(remove_weapon_name, "weapon_knife"))
                continue;
                
            if(x == 1 && level < 2)
                continue;
                
            if(x == 0 && level < 3)
                continue;
            
            RemovePlayerItem(client, remove_weapon);
            AcceptEntityInput(remove_weapon, "Kill");
        }
        
        for (new i, String:weapon[64]; i < weapons; i++)
        {            
            GetArrayString(Weapons[client], i, weapon, sizeof(weapon));    
            GivePlayerItem(client, weapon);
        }
        
        ClearArray(Weapons[client]);
    }
}

public recovery_OnClientDisconnect(client)
{
    ClearArray(Weapons[client]);
}
TryNoob is offline
coty9090
Senior Member
Join Date: Aug 2007
Old 02-04-2012 , 11:53   Re: [THC RPG] Total HardCore RPG
Reply With Quote #1359

i'm getting this error in logs, and i'm not even using mysql, i'm using sqlite...

15:10:26: [thc_rpg.smx] [Core] [SavePlayerData] Player ̿̿ ̿ ̿̿ ̿̿̿\̵͇̿̿\ not saved to database, Reason: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0', reqxp = '50', level = '1', credits = '500', speed_l = '0', adren_l = '0', im' at line 1
L 02/04/2012 - 15:105: [thc_rpg.smx] [Core] [InsertPlayer] Player ̿̿ ̿ ̿̿ ̿̿̿\̵͇̿̿\ not added to database, Reason: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0','50','1','500','0.8.6_stable','0','0','0' ,'0','0','0','0','0','0','0','0','0'' at line 1
L 02/04/2012 - 16:15:11: [thc_rpg.smx] [Core] [CheckDBUpdate] Database query error, no data fetched
coty9090 is offline
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 02-04-2012 , 11:57   Re: [THC RPG] Total HardCore RPG
Reply With Quote #1360

It must be his name
__________________
Taking private C++/PHP/SourcePawn requests, PM me.
Zephyrus 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 22:33.


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