Raised This Month: $ Target: $400
 0% 

Save File Problem...


Post New Thread Reply   
 
Thread Tools Display Modes
hazukiy
Member
Join Date: Jul 2009
Location: England
Old 02-23-2013 , 11:30   Re: Save File Problem...
Reply With Quote #21

PHP Code:

#include <sourcemod>
#include <sdktools>
#include <clientprefs>

#pragma semicolon 1

#define HudTick 1.2

#define DefaultSpeed 190.0
#define DefaultClass "None"
#define MoneyTimer 600.0

#define bits_SUIT_DEVICE_SPRINT        0x00000001

static String:Team[32];
static 
String:Class[32][32];
static 
String:AFK[32];
static 
String:God[32];

new 
Handle:cookie;
new 
Money[MAXPLAYERS+1];

public 
Plugin:myinfo 
{
    
name "Deathmatch Mod",
    
author "SirTiggs",
    
description "A simple, fun deathmatch mod",
    
version "1.1.0"
};

public 
OnPluginStart()
{    
    
RegConsoleCmd("sm_class"Command_Class"Usage: sm_class <class name>");
    
RegConsoleCmd("sm_chelp"Command_cHelp"Usage: sm_chelp");
    
RegConsoleCmd("sm_afk"Command_Afk"Usage: sm_afk <0/1>");
    
RegConsoleCmd("sm_changeteam"Command_ChangeTeam"Usage: sm_changeteam");
    
RegConsoleCmd("sm_cmds"Command_Cmds"Usage: sm_cmds");
    
RegConsoleCmd("kill"Command_Commit);
    
RegConsoleCmd("explode"Command_Commit);
    
RegAdminCmd("sm_god"Command_GodADMFLAG_ROOT"Usage: sm_god <0/1>");
    
RegAdminCmd("sm_rape"Command_RapeADMFLAG_ROOT"Usage: sm_rape <player name>");
    
RegAdminCmd("sm_model"Command_ModelADMFLAG_ROOT"Usage: sm_model <model name>");
    
RegAdminCmd("sm_ip"Command_IPADMFLAG_ROOT"Usage: sm_ip <player name>");
    
RegAdminCmd("sm_heal"Command_HealADMFLAG_ROOT"Usage: sm_heal <player name>");
    
RegAdminCmd("sm_setmoney"Command_SetMoneyADMFLAG_ROOT"Usage: sm_setmoney");
    
    
GetConVarInt(FindConVar("mp_teamplay"));
    
    
RegClientCookie("Money""players' Money"CookieAccess_Private);
}

public 
OnClientCookiesCached(Client)
{

    
decl String:buffer[8];
    
GetClientCookie(Clientcookiebuffer8);
    
Money[Client] = StringToInt(buffer);
    
}

SetClientMoney(clientamount){

    
decl String:buffer[8];
    
IntToString(amountbuffer8);
    
SetClientCookie(Clientcookiebuffer);
    
Money[Client] = amount;
    
}

AddClientMoney(Clientamount)
{
    
SetClientMoney(ClientMoney[Client] + amount); 
}

public 
OnMapStart()
{
    
PrecacheModel("models/alyx.mdl"true);
    
PrecacheModel("models/gman.mdl"true);
    
PrecacheModel("models/barney.mdl"true);
    
PrecacheModel("models/combine_super_soldier.mdl"true);
    
PrecacheModel("models/breen.mdl"true);
    
PrecacheModel("models/monk.mdl"true);
    
    
PrecacheModel("models/humans/Group01/Male_01.mdl"true);
    
PrecacheModel("models/humans/Group01/Female_01.mdl"true);
    
PrecacheModel("models/humans/Group01/Male_02.mdl"true);
    
PrecacheModel("models/humans/Group01/Female_02.mdl"true);
    
PrecacheModel("models/humans/Group01/Male_03.mdl"true);
    
PrecacheModel("models/humans/Group01/Female_03.mdl"true);
    
PrecacheModel("models/humans/Group01/Male_04.mdl"true);
    
PrecacheModel("models/humans/Group01/Female_04.mdl"true);
    
PrecacheModel("models/humans/Group01/Male_05.mdl"true);
    
PrecacheModel("models/humans/Group01/Male_06.mdl"true);
    
PrecacheModel("models/humans/Group01/Female_06.mdl"true);
    
PrecacheModel("models/humans/Group01/Male_07.mdl"true);
    
PrecacheModel("models/humans/Group01/Female_07.mdl"true);
    
PrecacheModel("models/humans/Group01/Male_08.mdl"true);
    
PrecacheModel("models/humans/Group01/Female_08.mdl"true);
    
PrecacheModel("models/humans/Group03/Male_02.mdl"true);
    
PrecacheModel("models/humans/Group03/Female_01.mdl"true);
    
    
HookEvent("player_spawn"EventSpawnEventHookMode_Pre);
    
}

public 
OnMapEnd()
{


}

public 
OnClientPutInServer(Client)
{        
    
decl String:Player[32];
    
GetClientName(ClientPlayersizeof(Player));

    if(
GetUserAdmin(Client))
    {
        
PrintToChatAll("[Tigg]  Admin: %s has joined us!"Player);
    }
    else if(!
GetUserAdmin(Client))
    {
        
PrintToChatAll("[Tigg]  Player: %s has joined the game!"Player);
    }

    
CreateTimer(0.5DisplayHudClientTIMER_REPEAT);
    
    
PrintToChat(Client"[Tigg]  Welcome to Deathmatch mod by SirTiggs");

    Class[
Client] = DefaultClass;
}

public 
OnClientDisconnect(Client)
{
}

public 
EventSpawn(Handle:Event, const String:Name[], bool:Broadcast)
{
    
decl Client;
    
    
Client GetClientOfUserId(GetEventInt(Event"userid"));
    
    
CreateTimer(1.5ClassPresetsClient);
}

public 
Action:DisplayHud(Handle:Timerany:Client)
{
    new 
PlayerTeam GetClientTeam(Client);
    new 
Kills GetClientFrags(Client);
    new 
Deaths GetClientDeaths(Client);
    new 
Combine GetTeamScore(2);
    new 
Rebel GetTeamScore(3);
    new 
cTotalTeam GetTeamClientCount(2);
    new 
rTotalTeam GetTeamClientCount(3);
    new 
Health GetClientHealth(Client);

    
decl String:PlayerName[32];
    
GetClientName(ClientPlayerNamesizeof(PlayerName));
    
    if(
IsClientAuthorized(Client) && IsClientInGame(Client))
    {
        if(
IsClientConnected(Client) && IsPlayerAlive(Client))
        {        
            if(
PlayerTeam == 1)
            {
                
Team "Spectate";
            }
            else if(
PlayerTeam == 2)
            {
                if(
Combine 1)
                {
                    
Combine 0;
                }
                
Team "Combine";
                
SetHudTextParams(-1.00.050HudTick0025525506.00.10.2);
                
ShowHudText(Client, -1"Team Members %d: R %d | C %d"cTotalTeamRebelCombine);
                
ClientCommand(Client"r_screenoverlay effects/combine_binocoverlay.vmt");
            }
            else if(
PlayerTeam == 3)
            {
                if(
Rebel 1)
                {
                    
Rebel 0;
                }
                
Team "Rebel";
                
SetHudTextParams(-1.00.050HudTick2550025506.00.10.2);
                
ShowHudText(Client, -1"Team Members %d: R %d | C %d"rTotalTeamRebelCombine);
                if(
Health <= 15)
                {
                    
ClientCommand(Client"r_screenoverlay debug/yuv.vmt");
                }
                else
                {
                    
ClientCommand(Client"r_screenoverlay 0");
                }
            }
            else
            {
                return 
Plugin_Handled;
            }
            
            if(
Kills 1)
            {
                
Kills 0;
            }
            
            
//Main Hud
            
SetHudTextParams(0.0150.30HudTick02503025506.00.10.2);
            
ShowHudText(Client, -1"Kills: %d\nDeaths: %d\nClass: %s\nMoney: £%d"KillsDeaths, Class[Client], Money[Client]);
            
SetHudTextParams(0.0150.25HudTick2550025506.00.10.2);
            
ShowHudText(Client, -1"-Info-");
            
            if(
StrEqual(Class[Client], "None"))
            {
                
SetHudTextParams(-1.00.015HudTick30255025506.00.10.2);
                
ShowHudText(Client, -1"|%s Of Team %s|"PlayerNameTeam);
                
SetHudTextParams(-1.01.0HudTick30255025506.00.10.2);
                
ShowHudText(Client, -1"Type [/class <class>] To Choose A Class");
            }
            else
            {
                
SetHudTextParams(-1.00.015HudTick30255025506.00.10.2);
                
ShowHudText(Client, -1"|%s Of Class %s In Team %s|"PlayerName, Class[Client], Team);

            }
        }
    }
    return 
Plugin_Handled;
}

public 
Action:Command_God(Clientargs)
{
    
decl String:arg1[32];
    
GetCmdArg(1arg1sizeof(arg1));
    
    if(
args == 0)
    {
        
PrintToChat(Client"[Tigg]  Error in arg: sm_god <0/1>");

        return 
Plugin_Handled;
    }

    if(
IsPlayerAlive(Client))
    {
        if(
StrEqual(arg1"1"))
        {
            if(
StrEqual(God"1"))
            {
                
PrintToChat(Client"[Tigg]  You're already in god mode!");
                
                return 
Plugin_Handled;
            }
            else
            {
                
God "1";
                
SetEntProp(ClientProp_Data"m_takedamage"01);
                
PrintToChat(Client"[Tigg]  You're now god!");
                
ClientCommand(Client"play buttons/blip1.wav");
                
SetEntityRenderColor(Client25500255);
            }
        }
        else if(
StrEqual(arg1"0"))
        {
            if(
StrEqual(God"0"))
            {
                
PrintToChat(Client"[Tigg]  You're not in god mode!");
                
                return 
Plugin_Handled;
            }
            else
            {
                
God "0";
                
SetEntProp(ClientProp_Data"m_takedamage"21);
                
PrintToChat(Client"[Tigg]  You're now mortal!");
                
ClientCommand(Client"play buttons/blip1.wav");
                
SetEntityRenderColor(Client000255);
            }
        }
        else
        {
            
PrintToChat(Client"[Tigg]  Error in arg: sm_god <0/1>");
        
            return 
Plugin_Handled;
        
        }
    }
    else
    {
        
PrintToChat(Client"[Tigg] You need to be alive to be god");
    }    

    return 
Plugin_Handled;
}

public 
Action:Command_Class(Clientargs)
{
    
decl String:arg1[32];
    
GetCmdArg(1arg1sizeof(arg1));
    
    if(
args == 0)
    {
        
PrintToChat(Client"[Tigg]  Error in arg: sm_class <class name>");
        
        return 
Plugin_Handled;
    }
    
    if(
IsClientInGame(Client) && IsPlayerAlive(Client))
    {
        if(
StrEqual(arg1"Assault") || (StrEqual(arg1"assault")))
        {
            if(
StrEqual(Class[Client], "Assault"))
            {
                
PrintToChat(Client"[Tigg]  You're already that class!");
            
                return 
Plugin_Handled;
            }
            else
            {
                Class[
Client] = "Assault";
                
PrintToChat(Client"[Tigg]  You've selected Assault class!");
                
ClientCommand(Client"play buttons/blip1.wav");
            }

        }
        else if(
StrEqual(arg1"Assassin") || (StrEqual(arg1"assassin")))
        {
            if(
StrEqual(Class[Client], "Assassin"))
            {
                
PrintToChat(Client"[Tigg]  You're already that class!");
            
                return 
Plugin_Handled;
            }
            else
            {
                Class[
Client] = "Assassin";
                
PrintToChat(Client"[Tigg]  You've selected Assassin class!");
                
ClientCommand(Client"play buttons/blip1.wav");
            }
        }
        else if(
StrEqual(arg1"Support") || (StrEqual(arg1"support")))
        {
            if(
StrEqual(Class[Client], "Support"))
            {    
                
PrintToChat(Client"[Tigg]  You're already that class!");
            
                return 
Plugin_Handled;
            }
            else
            {
                Class[
Client] = "Support";
                
PrintToChat(Client"[Tigg]  You've selected Support class!");
                
ClientCommand(Client"play buttons/blip1.wav");
            }    
        }
        else if(
StrEqual(arg1"Sniper") || (StrEqual(arg1"sniper")))
        {
            if(
StrEqual(Class[Client], "Sniper"))
            {    
                
PrintToChat(Client"[Tigg]  You're already that class!");
            
                return 
Plugin_Handled;
            }
            else
            {
                Class[
Client] = "Sniper";
                
PrintToChat(Client"[Tigg]  You've selected Sniper class!");
                
ClientCommand(Client"play buttons/blip1.wav");
            }    
        }
        else if(
StrEqual(arg1"None") || (StrEqual(arg1"none")))
        {
            if(
StrEqual(Class[Client], "None"))
            {    
                
PrintToChat(Client"[Tigg]  You don't have a class!");
            
                return 
Plugin_Handled;
            }
            else
            {
                Class[
Client] = "None";
                
PrintToChat(Client"[Tigg]  You've quit your current class!");
                
ClientCommand(Client"play buttons/blip1.wav");
            }    
        }
        else
        {
            
PrintToChat(Client"[Tigg]  Sorry but that is a unknown class. Please type /chelp for more information.");
            
            return 
Plugin_Handled;
        }
    }
    return 
Plugin_Handled;
}

public 
Action:Command_cHelp(Clientargs)
{
    
PrintToChat(Client"=====Class Lists=====");
    
PrintToChat(Client"1) -Assault- [/class assault] Tough");
    
PrintToChat(Client"2) -Assassin- [/class assassin] Quick");
    
PrintToChat(Client"3) -Support- [/class support] Heavly-Weaponed");
    
PrintToChat(Client"4) -Sniper- [/class sniper] Hard To Detect");
    
    return 
Plugin_Handled;
}

public 
Action:Command_Cmds(Clientargs)
{
    if(
IsClientConnected(Client) && IsClientInGame(Client))
    {
        
PrintToChat(Client"-===Command List===");
        
PrintToChat(Client"1) Usage: sm_class <class name> *Select a Class*");
        
PrintToChat(Client"2) Usage: sm_chelp *Displays Class Help*");
        
PrintToChat(Client"3) Usage: sm_afk <0/1> *Go AFK*");
        
PrintToChat(Client"4) Usage: sm_changeteam *Change Your Team*");
        
PrintToChat(Client"==========================");
    }
    return 
Plugin_Handled;
}

public 
Action:Command_Model(Clientargs)
{
    if(
IsClientConnected(Client) && IsClientInGame(Client) && IsPlayerAlive(Client))
    {    
        
decl String:arg1[32];
        
GetCmdArg(1arg1sizeof(arg1));
        
        if(
StrEqual(arg1"alyx") || (StrEqual(arg1"Alyx")))
        {
            
SetEntityModel(Client"models/alyx.mdl");
            
ClientCommand(Client"play buttons/blip1.wav");
            
PrintToChat(Client"[Tigg]  You've changed to model Alyx!");
            
            return 
Plugin_Handled;
        }
        else if(
StrEqual(arg1"gman") || (StrEqual(arg1"Gman")))
        {
            
SetEntityModel(Client"models/gman.mdl");
            
ClientCommand(Client"play buttons/blip1.wav");
            
PrintToChat(Client"[Tigg]  You've changed to model Gman!");
            
            return 
Plugin_Handled;
        }
        else if(
StrEqual(arg1"gordon") || (StrEqual(arg1"Gordon")))
        {
            
SetEntityModel(Client"models/player/gordon_classic.mdl");
            
ClientCommand(Client"play buttons/blip1.wav");
            
PrintToChat(Client"[Tigg]  You've changed to model Gordon Freeman");
            
            return 
Plugin_Handled;
        }
        else if(
StrEqual(arg1"breen") || (StrEqual(arg1"Breen")))
        {
            
SetEntityModel(Client"models/breen.mdl");
            
ClientCommand(Client"play buttons/blip1.wav");
            
PrintToChat(Client"[Tigg]  You've changed to model Breen");
            
            return 
Plugin_Handled;
        }
        else
        {
            
PrintToChat(Client"[Tigg]  Error in arg: sm_model <model name>");    
            return 
Plugin_Handled;
        }
    }
    return 
Plugin_Handled;
}

public 
Action:Command_Afk(Clientargs)
{
    new 
Health GetClientHealth(Client);
    
decl String:arg1[32];
    
decl String:PlayerName[32];
    
GetCmdArg(1arg1sizeof(arg1));
    
GetClientName(ClientPlayerNamesizeof(PlayerName));

    if(
args == 0)
    {
        
PrintToChat(Client"[Tigg]  Error in arg: sm_afk <0/1>");

        return 
Plugin_Handled;    
    }

    if(
IsPlayerAlive(Client))
    {
        if(
StrEqual(arg1"1"))
        {
            if(
StrEqual(AFK"1"))
            {
                
PrintToChat(Client"[Tigg]  You're already in AFK mode.");
            
                return 
Plugin_Handled;
            }
            else
            {
                if(
Health 100)
                {
                    
PrintToChat(Client"[Tigg]  You can't go AFK with lower than 100HP");
                
                    return 
Plugin_Handled;
                }
                else if(
Health == 100)
                {
                    
AFK "1";
                    
ClientCommand(Client"play buttons/blip1.wav");
                    
SetEntProp(ClientProp_Data"m_takedamage"01);
                    
PrintToChat(Client"[Tigg]  You're now in AFK mode. You'll be frozen while in AFK mode.");
                    
PrintToChatAll("[Tigg]  Player: %s has gone in AFK mode."PlayerName);
                    
SetEntityRenderColor(Client02550255);
                    
SetEntityMoveType(ClientMOVETYPE_NONE);
                    
RemoveWeapons(Client);
                }
            }
        }
        else if(
StrEqual(arg1"0"))
        {
            if(
StrEqual(AFK"0"))
            {
                
PrintToChat(Client"[Tigg]  You're not in AFK mode.");
            
                return 
Plugin_Handled;
            }
            else
            {
                
AFK "0";
                
ClientCommand(Client"play buttons/blip1.wav");
                
PrintToChatAll("[Tigg]  Player: %s has come out of AFK mode."PlayerName);
                
PrintToChat(Client"[Tigg]  You come out of AFK mode!");
                
SetEntProp(ClientProp_Data"m_takedamage"21);
                
SetEntityRenderColor(Client255255255255);
                
SetEntityMoveType(ClientMOVETYPE_WALK);
                
WeaponsPrefix(Client);
                
                return 
Plugin_Handled;
            }
        }
    }
    return 
Plugin_Handled;
}

stock SetSpeed(ClientFloat:Speed)
{
    
decl SpeedOffset;
    
    
SpeedOffset FindSendPropOffs("CHL2MP_Player""m_flMaxspeed");

    if(
SpeedOffset 0SetEntData(ClientSpeedOffsetSpeed4true);
}

public 
Action:Command_Commit(Clientargs)
{
    
PrintToChat(Client"[Tigg]  Suicide is disabled.");
    
    return 
Plugin_Handled;
}

public 
Action:Command_Rape(Clientargs)
{    
    
decl Player;
    if(
args == 0)
    {
        
PrintToChat(Client"[Tigg]  Error in arg: sm_rape <player name>");
    
        return 
Plugin_Handled;
    }
    
    if(
args == 1)
    {
        
decl String:PlayerName[32];
        
decl MaxPlayers;
        
decl String:Name[32];
        
        
GetCmdArg(1PlayerNamesizeof(PlayerName));
        
        
MaxPlayers GetMaxClients();
        for(new 
1<= MaxPlayersX++)
        {
            if(!
IsClientConnected(X)) continue;
            
            
GetClientName(XNamesizeof(Name));
            
            if(
StrContains(NamePlayerNamefalse) != -1Player X;
            
        }
        
        if(
Player == -1)
        {
            
PrintToChat(Client"[Tigg]  Could not find client: %s"PlayerName);
            
            return 
Plugin_Handled;
        }
        
        if(
IsPlayerAlive(Player))
        {
            
GetClientName(ClientNamesizeof(Name));
            
GetClientName(PlayerPlayerNamesizeof(PlayerName));    
            
PrintToChat(Player"[Tigg]  You got raped :(");
            
PrintToChat(Client"[Tigg]  You rapped %s"PlayerName);
            
ClientCommand(Player"play vo/npc/Alyx/hurt05.wav"1);
            
ClientCommand(Player"play vo/npc/female01/pain06.wav"2);
            
ClientCommand(Player"play vo/npc/female01/ow02.wav"3);
            
SlapPlayer(Player50false);
        }
        
        if(
GetClientHealth(Player) < 10)
        {
            
PrintToChatAll("[Tigg]  Player: %s got killed by rape :("PlayerName);
            
ForcePlayerSuicide(Player);
        
            return 
Plugin_Handled;
        }
    }
    return 
Plugin_Handled;
}

public 
Action:Command_ChangeTeam(Clientargs)
{
    new 
PlayerTeam GetClientTeam(Client);
    
decl String:Name[32];
    
GetClientName(ClientNamesizeof(Name));
    
    if(
IsClientConnected(Client) && IsClientInGame(Client) && IsPlayerAlive(Client))
    {
        if(
PlayerTeam == 2)
        {
            
PrintToChatAll("[Tigg]  Player: %s is switching to team Rebels!"Name);
            
ChangeClientTeam(Client3);
        }
        else if(
PlayerTeam == 3)
        {
            
PrintToChatAll("[Tigg]  Player: %s is switching to team Combine!"Name);
            
ChangeClientTeam(Client2);
        }
        else
        {
            
PrintToChat(Client"[Tigg]  Something wierd happend ^.-");
        
            return 
Plugin_Handled;
        }
    }
    return 
Plugin_Handled;
}

public 
Action:ClassPresets(Handle:timerany:Client)
{
    if(
StrEqual(Class[Client], "Assault"))
    {
        
SetSpeed(Client180.0);
        
SetEntityHealth(Client450);
        
GivePlayerItem(Client"weapon_smg1");
        
GivePlayerItem(Client"weapon_ar2");
        
SetEntityModel(Client"models/combine_super_soldier.mdl");
        
SetEntityRenderColor(Client255255255255);

    }
    else if(
StrEqual(Class[Client], "Assassin"))
    {
        
SetSpeed(Client300.0);
        
SetEntityHealth(Client80);
        
GivePlayerItem(Client"weapon_crowbar");
        
GivePlayerItem(Client"weapon_stunstick");
        
SetEntityModel(Client"models/alyx.mdl");
        
SetEntityRenderColor(Client000255);

    }
    else if(
StrEqual(Class[Client], "Support"))
    {
        
SetSpeed(Client150.0);
        
SetEntityHealth(Client350);
        
GivePlayerItem(Client"weapon_rpg");
        
GivePlayerItem(Client"weapon_shotgun");
        
SetEntityModel(Client"models/monk.mdl");
        
SetEntityRenderColor(Client255255255255);
    }
    else if(
StrEqual(Class[Client], "Sniper"))
    {
        
SetEntityHealth(Client120);
        
SetEntityRenderColor(Client25500255);
        
SetEntityRenderMode(ClientRENDER_GLOW);
        
GivePlayerItem(Client"weapon_crossbow");
        
GivePlayerItem(Client"weapon_crowbar");
        
GivePlayerItem(Client"item_ammo_crossbow");
        
SetEntityModel(Client"models/barney.mdl");
    }
    else if(
StrEqual(Class[Client], "None"))
    {        
        
SetEntityModel(Client"models/humans/Group01/Male_03.mdl");  
    }
    return 
Plugin_Handled;
}

public 
Action:RemoveWeapons(Client)
{
        
decl Offset;
        
decl Weapon;

        
Offset FindSendPropOffs("CHL2MP_Player""m_hMyWeapons");

    for(new 
020= (4))
    {
        
Weapon GetEntDataEnt2(ClientOffset X);
        
        if(
Weapon 0)
        {
            
RemovePlayerItem(ClientWeapon);
            
RemoveEdict(Weapon);
        }
    }
}

public 
Action:Command_IP(Clientargs)
{
    
decl Player;
    if(
args == 0)
    {
        
PrintToChat(Client"[Tigg]  Error in arg: sm_ip <player name>");
    
        return 
Plugin_Handled;
    }

    if(
args == 1)
    {
        
decl String:PlayerName[32];
        
decl MaxPlayers;
        
decl String:IP[15];
        
decl String:Name[32];
        
        
GetCmdArg(1PlayerNamesizeof(PlayerName));
        
        
MaxPlayers GetMaxClients();
        for(new 
1<= MaxPlayersX++)
        {
            if(!
IsClientConnected(X)) continue;
            
            
GetClientName(XNamesizeof(Name));
            
            if(
StrContains(NamePlayerNamefalse) != -1Player X;
            
        }
        
        if(
Player == -1)
        {
            
PrintToChat(Client"[Tigg]  Could not find client: %s"PlayerName);
                
            return 
Plugin_Handled;
        }

        if(
IsClientConnected(Client) && IsClientInGame(Client))
        {
            
GetClientName(ClientNamesizeof(Name));
            
GetClientName(PlayerPlayerNamesizeof(PlayerName));            
            
GetClientIP(PlayerIPsizeof(IP));
            
PrintToChat(Client"[Tigg]  IP of %s = %s"PlayerNameIP);
        }

    }
    return 
Plugin_Handled;    
}

stock MoneyMod(Client)
{    
    new 
Kills GetClientFrags(Client);
    
    if(
Kills >= || Kills <= 10)
    {
        
AddClientMoney(ClientGetRandomInt(1100));
    }
    else if(
Kills >= 11 || Kills <= 20)
    {
        
AddClientMoney(ClientGetRandomInt(101500));
    }
    else if(
Kills >= 21 || Kills <= 30)
    {
        
AddClientMoney(ClientGetRandomInt(4001000));
    }    
    return 
Plugin_Handled;
}

public 
Action:Command_SetMoney(Clientargs)
{
    if(
IsClientInGame(Client))
    {
        
Money[Client] += 60;
        
PrintToChat(Client"[Tigg] You added £%d to your bank!"Money[Client]);
    }
    return 
Plugin_Handled;
}

public 
Action:Command_Heal(Clientargs)
{
    
decl Player;
    if(
args == 0)
    {
        
PrintToChat(Client"[Tigg]  Error in arg: sm_heal <player name>");
    
        return 
Plugin_Handled;
    }
    
    if(
args == 1)
    {
        
decl String:PlayerName[32];
        
decl String:Name[32];
        
decl MaxPlayers;
        
        
GetClientName(PlayerPlayerNamesizeof(PlayerName));
        
GetClientName(ClientNamesizeof(Name));
        
GetCmdArg(1PlayerNamesizeof(PlayerName));
        
        new 
Health GetClientHealth(Client);
        
        
MaxPlayers GetMaxClients();
        for(new 
1<= MaxPlayersX++)
        {
            if(!
IsClientConnected(X)) continue;
                
            
GetClientName(XNamesizeof(Name));
                
            if(
StrContains(NamePlayerNamefalse) != -1Player X;
        }
        
        if(
Player == -1)
        {
            
PrintToChat(Client"[Tigg]  Could not find client: %s"PlayerName);
                
            return 
Plugin_Handled;
        }
        
        if(
IsClientConnected(Player) && IsClientInGame(Player) && IsPlayerAlive(Player))
        {
            if(
Health >= 100)
            {
                
PrintToChat(Client"[Tigg]  Player: %s has full health"PlayerName);
                
                return 
Plugin_Handled;
            }
            else if(
Health <= 99)
            {
                
PrintToChat(Client"[Tigg]  You heal %s for full health"PlayerName);
                
PrintToChat(Player"[Tigg]  You've been healed to full health by %s"Name);
                
SetEntityHealth(Player100);
            }
        }
        else if(!
IsPlayerAlive(Player))
        {
            
PrintToChat(Client"[Tigg]  Player is not alive!");
            
            return 
Plugin_Handled;
        }
        else
        {
            
PrintToChat(Client"[Tigg]  Could not find client: %s"PlayerName);
        
            return 
Plugin_Handled;
        }
    }
    else
    {
        
PrintToChat(Client"[Tigg]  Something wierd happend ^.-");
    
        return 
Plugin_Handled;
    }
    return 
Plugin_Handled;
}

public 
Action:WeaponsPrefix(Client)
{
    new 
Combine GetClientTeam(Client);
    new 
Rebel GetClientTeam(Client);

    if(
IsPlayerAlive(Client))
    {
        if(
Combine == 2)
        {
            
GivePlayerItem(Client"weapon_stunstick");
            
GivePlayerItem(Client"weapon_pistol");
            
GivePlayerItem(Client"weapon_smg1");
            
GivePlayerItem(Client"weapon_frag");
            
GivePlayerItem(Client"weapon_physcannon");

            return 
Plugin_Handled;
        }
        else if(
Rebel == 3)
        {
            
GivePlayerItem(Client"weapon_crowbar");
            
GivePlayerItem(Client"weapon_pistol");
            
GivePlayerItem(Client"weapon_smg1");
            
GivePlayerItem(Client"weapon_frag");
            
GivePlayerItem(Client"weapon_physcannon");

            return 
Plugin_Handled;
        }
    }
    return 
Plugin_Handled;

hazukiy is offline
Bimbo1
Senior Member
Join Date: Jan 2010
Location: brazil
Old 02-23-2013 , 23:36   Re: Save File Problem...
Reply With Quote #22

oh, i'm stupid. you have to assign RegClientCookie to the cookie handle. i'm sorry for taking forever to answer and for the mistakes, i'm not testing it nor reviewing it.
Code:
cookie = RegClientCookie("Money", "players' Money", CookieAccess_Private);
Bimbo1 is offline
hazukiy
Member
Join Date: Jul 2009
Location: England
Old 02-24-2013 , 06:19   Re: Save File Problem...
Reply With Quote #23

Hey Bimbo, this function does not work ingame


PHP Code:

MoneyMod
(ClientAmount)
{    
    new 
Kills GetClientFrags(Client);
    
    
Amount 50;

    if(
Kills >= && Kills <= 10)
    {
        
SetClientMoney(ClientMoney[Client] + Amount); 
    }        


Last edited by hazukiy; 02-24-2013 at 10:03. Reason: Works.
hazukiy is offline
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 02-24-2013 , 08:40   Re: Save File Problem...
Reply With Quote #24

hazukiy, instead of making five replies all within 30 minutes, I'd instead point you to the Edit function of your posts.
__________________
11530 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 17:16.


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