Raised This Month: $32 Target: $400
 8% 

League of Legends [CS 1.6] -> Need Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MiloSx7
Member
Join Date: Oct 2011
Location: Serbia, Nish
Old 10-09-2011 , 06:35   League of Legends [CS 1.6] -> Need Help
Reply With Quote #1

I started writing League of Legends (lol) mod for Counter-Strike 1.6 (CS 1.6)

Down there is the list what the mod should be, but its not like that! My mod is way to far from the notes i wrote down there, and that's why i need your help, because i can't make everything working, as i said in notes ^.^

And this is all about this mod:
  • Players are beginning in spec, and they can choose their hero, level him up, buy items for helping in fights, use special ability... (hero's level and experience is restarted every round)
  • Spec is Lobby, where players can see their Influence Points, Their level (which is earned from rounds), buy new heroes from Influence Points... Players can leave the round and go to lobby, but they will lose 150 points (by default) for leaving the team!
  • No round end, auto re spawn... But when a player dies, he need to wait certain amount of time to get his re spawn
  • Goal of the game is to destroy all the enemy turrets, and that's the end of map.. Turrets deal great damage, so that's why team work is here important! Map is changed, all players are in lobby, choosing their heroes, and then spawned, and start fighting...
  • All the heroes will have knifes, some of them will have ranged weapons, but wont deal great damage (like Tristana will have AWP, but will deal about 50 Damage...)
  • After leveling a hero, you can upgrade his special ability for better results in fights...
  • Minions are spawned every 30 seconds for helping Summoners (players) defeat the enemies or Turrets...
  • Killing Enemies or Minions or Destroying turrets is awarded for EXTRA gold, which you use in shop, to buy some extra items that will help in fights...
  • Players are auto-receiving gold and energy every second, so if they lose energy in fight they will get regeneration...
That's it! I'm glad u rode it

Here is the Current Source code:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <colorchat>
#include <fun>
#include <hamsandwich>

#define TASK_GIVEGOLD    523
#define TASK_SHOWINFO    672
#define TASK_GIVEENERGY 745

enum {
    
None,
    
Master_Yi,
    
Tristana,
    
Tyndramere,
    
Garen
}

new const 
hero_name[][] = {
    
"None",
    
"Master Yi",
    
"Tristana",
    
"Tyndramere",
    
"Garen"
}

new const 
hero_energy[] = {
    
100,
    
520,
    
480,
    
540,
    
540
}

/*=====================*/
new hero_level[33]
new 
hero_experience[33]
new 
hero_gold[33]
new 
hero_max_energy[33]
/*=====================*/

/*=============================*/
new player_level[33]
new 
player_influence_points[33]
new 
player_hero[33]
/*=============================*/

new SyncHud
new SyncHud2

new bool:has_rocket_boots[33]


/*==============================================================*/
public plugin_init()
{
    
register_plugin("League of Legends""1.0""MiloS -.-")
    
    
register_clcmd("say /shop""Shop")
    
register_clcmd("say /test""TestCommand")
    
    
register_cvar("hero_killxp""20")
    
register_cvar("hero_killgold""250")
    
register_cvar("hero_energyup""20")
    
    
register_event("CurWeapon""CurWeapon""be""1=1")
    
    
RegisterHam(Ham_Killed"player""Death"1)
    
RegisterHam(Ham_Spawn"player""Spawn"1)
    
    
SyncHud CreateHudSyncObj()
    
SyncHud2 CreateHudSyncObj()
}
/*==============================================================*/


/*================================*/
public TestCommand(id)
{
    
hero_gold[id] += 500
    hero_experience
[id] += 500
    Hero_CheckLevel
(id)
}
/*================================*/


/*===================================================*/
public client_putinserver(id)
{
    
set_task(0.1"ShowInfo"id TASK_SHOWINFO)
    
set_task(1.0"GiveGold"id TASK_GIVEGOLD)
    
set_task(1.0"GiveEnergy"id TASK_GIVEENERGY)
}
/*===================================================*/


/*======================================================================*/
public Death(victimattacker)
{
    if(
attacker != victim)
    {
        
hero_experience[attacker] += get_cvar_num("hero_killxp")
        
hero_gold[attacker] += get_cvar_num("hero_killgold")
        
Hero_CheckLevel(attacker)
    }
}
/*======================================================================*/


/*=======================================================*/
public Spawn(id)
{
    if(!
is_user_alive(id))
    {
        return 
PLUGIN_HANDLED
    
}
    
    if(!
player_hero[id])
    {
        
ChooseHero(id)
    }
    
    
hero_max_energy[id] = hero_energy[player_hero[id]]
    
    
set_user_health(idhero_energy[player_hero[id]])
    
    return 
PLUGIN_CONTINUE
}
/*=======================================================*/


/*================================================================*/
public CurWeapon(id)
{
    if(
has_rocket_boots[id])
    {
        
set_user_maxspeed(idget_user_maxspeed(id) + 10.0)
    }
}
/*================================================================*/


/*=======================================================================================*/
public Hero_CheckLevel(id)
{
    if(
hero_level[id] < 18)
    {
        while(
hero_experience[id] >= (hero_level[id] * * (hero_level[id] / 2)))
        {
            
hero_level[id] ++
            
hero_max_energy[id] += get_cvar_num("hero_energyup")
            
            
set_hudmessage(02550, -1.00.2006.03.0)
            
ShowSyncHudMsg(idSyncHud2"Level Up!")
        }
    }
}
/*=======================================================================================*/


/*======================================================================*/
public ChooseHero(id)
{
    new 
menu menu_create("Choose your Hero!""ChooseHero_Handle")
    
    for(new 
1sizeof hero_name++)
    {
        
menu_additem(menuhero_name[i])
    }
    
    
menu_display(idmenu)
}
public 
ChooseHero_Handle(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    
item ++
    
    if(
player_hero[id] != item)
    {
        
player_hero[id] = item
    
}
    
    
Spawn(id)
    
    return 
PLUGIN_CONTINUE
}
/*======================================================================*/


/*=================================================================================*/
public Shop(id)
{
    new 
menu menu_create("Shop""Shop_Handle")
    
menu_additem(menu"\yRocket Boots \r[Adds 10% Speed] \yCost: \r[850g]")
    
menu_additem(menu"\yTitanium Sword \r[Adds 50 Damage] \yCost: \r[1050g]")
    
menu_display(idmenu)
}
public 
Shop_Handle(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
    }
    
    
menu_display(idmenu)
    
    switch(
item)
    {
        case 
0:
        {
            if(
hero_gold[id] < 850)
            {
                
ColorChat(idNORMAL"^4[League of Legends] ^3You don't have enough gold to buy this")
                return 
PLUGIN_HANDLED
            
}
            else
            {
                
set_user_maxspeed(idget_user_maxspeed(id) + 10.0)
                
has_rocket_boots[id] = true
                hero_gold
[id] -= 850
                ColorChat
(idNORMAL"^4[League of Legends] ^3You bought Rocket Boots, Good Luck")
            }
        }
        case 
1:
        {
            if(
hero_gold[id] < 1050)
            {
                
ColorChat(idNORMAL"^4[League of Legends] ^3You don't have enough gold to buy this")
                return 
PLUGIN_HANDLED
            
}
            else
            {
                
ColorChat(idNORMAL"^4[League of Legends] ^3You bought Titanium Sword, Good Luck")
            }
        }
    }
    
    return 
PLUGIN_CONTINUE
}
/*=================================================================================*/


/*=======================================================*/
public ShowInfo(id)
{
    
id -= TASK_SHOWINFO
    set_task
(0.1"ShowInfo"id TASK_SHOWINFO)
    
    
set_hudmessage(02550, -1.00.8006.00.1)
    
ShowSyncHudMsg(idSyncHud"[Hero: %s][Gold: %d][Energy: %d]^n[Experience: %i / %i][Level: %i]"hero_name[player_hero[id]], hero_gold[id], get_user_health(id), hero_experience[id], hero_level[id] * * (hero_level[id] / 2), hero_level[id]) 
}
/*=======================================================*/


/*===================================================*/
public GiveGold(id)
{
    
id -= TASK_GIVEGOLD
    set_task
(1.0"GiveGold"id TASK_GIVEGOLD)
    
    
hero_gold[id] += 1
}
/*===================================================*/


/*==============================================================*/
public GiveEnergy(id)
{
    
id -= TASK_GIVEENERGY
    set_task
(1.0"GiveEnergy"id TASK_GIVEENERGY)
    
    new 
new_health = (get_user_health(id) + hero_max_energy[id]) ? get_user_health(id) + 1:hero_max_energy[id]
    
    
set_user_health(idnew_health)
}
/*==============================================================*/


/*=====================================*/
public client_disconnect(id)
{
    
remove_task(id TASK_SHOWINFO)
    
remove_task(id TASK_GIVEGOLD)
    
remove_task(id TASK_GIVEENERGY)
}
/*=====================================*/ 
And here are all the problems:

  • I don't know how to detect map end, or all turrets destroyed, so this is now a shitty hero mod
  • What i need to put in client put in server so players will be asked first to choose hero, then team (blues or purples...)
  • I have something for turrets, but i don't have the model :\ i will give you the code of Turret i have down there
  • Minions... Is it even possible to make minions that will go around the map, and try to kill enemies/turrets
Source code of Turrets:
PHP Code:
public CreateSentryGun(id)
{
    if(!(
entity_get_int(idEV_INT_flags) & FL_ONGROUND))
    {
        return
    }
    
    new 
num
    
new players[32]
    new 
Float:Origin[3]
    
    
get_players(playersnum"gh")
    
    
entity_get_vector(idEV_VEC_originOrigin)
    
Origin[2] += 45.0
    
    
new ent create_entity("info_target")
    
    
entity_set_string(entEV_SZ_classname"turret")
    
entity_set_model(ent"models/turret.mdl")
    
    
entity_set_float(entEV_FL_health2555)
    
entity_set_float(entEV_FL_takedamageDAMAGE_YES)
    
    
entity_set_size(entFloat: { -16.0, -16.00.0 }, Float: { 16.016.048.0 })
    
    
entity_set_origin(entOrigin)
    
entity_set_int(entEV_INT_solidSOLID_SLIDEBOX)
    
entity_set_int(entEV_INT_movetypeMOVETYPE_TOSS)
    
entity_set_int(entEV_INT_iuser2id)
    
entity_set_vector(entEV_VEC_anglesFloat: { 0.00.00.0 })
    
entity_set_byte(entEV_BYTE_controller2127)
    
    
entity_set_float(entEV_FL_nextthinkget_gametime() + 1.0)
}

public 
SentryThink(ent)
{
    if(!
is_valid_ent(ent))
    {
        return 
PLUGIN_CONTINUE
    
}
    
    new 
Float:SentryOrigin[3]
    new 
Float:closestOrigin[3]
    
    
entity_get_vector(entEV_VEC_originSentryOrigin)
    
    new 
id entity_get_int(entEV_INT_iuser2)
    new 
target entity_get_edict(entEV_ENT_euser1)
    new 
firemods entity_get_int(entEV_INT_iuser1)
    
    if(
firemods)
    {
        if(
ExecuteHam(Ham_FVisibletargetent) && is_user_alive(target))
        {
            new 
Float:TargetOrigin[3]
            
            
entity_get_vector(targetEV_VEC_originTargetOrigin)
            
            
sentry_turntotarget(entSentryOriginTargetOrigin)
            
            new 
Float:hitRatio random_float(0.01.0) - 0.2
            
            
if(hitRatio <= 0.0)
            {
                
UTIL_Kill(idtargetrandom_float(5.035.0), DMG_BULLET1)
                
                
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
                
write_byte(TE_TRACER)
                
write_coord(floatround(SentryOrigin[0]))
                
write_coord(floatround(SentryOrigin[1]))
                
write_coord(floatround(SentryOrigin[2]))
                
write_coord(floatround(TargetOrigin[0]))
                
write_coord(floatround(TargetOrigin[1]))
                
write_coord(floatround(TargetOrigin[2]))
                
message_end()
            }
            
            
entity_set_float(entEV_FL_nextthinkget_gametime() + 0.1)
            return 
PLUGIN_CONTINUE
        
}
        else
        {
            
firemods 0
            entity_set_int
(entEV_INT_iuser10)
            
entity_set_edict(entEV_ENT_euser10)
        }
    }
    
    new 
closestTarget getClosestPlayer(ent)
    
    if(
closestTarget)
    {
        
entity_get_vector(closestTargetEV_VEC_originclosestOrigin)
        
turret_turntotarget(entSentryOriginclosestOrigin)
        
        
entity_set_int(entEV_INT_iuser11)
        
entity_set_edict(entEV_ENT_euser1closestTarget)
        
        
entity_set_float(entEV_FL_nextthinkget_gametime() + 1.0)
        
        return 
PLUGIN_CONTINUE
    
}
    
    if(!
firemods)
    {
        new 
controler1 entity_get_byte(entEV_BYTE_controller1) + 1
        
        
if(controler1 255)
        {
            
controler1 0
        
}
        
        
entity_set_byte(entEV_BYTE_controller1controler1)
        
        new 
controler2 entity_get_byte(entEV_BYTE_controller2)
        
        if(
controler2 127 || controler2 127)
        {
            
entity_set_byte(entEV_BYTE_controller2127)
        }
        
        
entity_set_float(entEV_FL_nextthinkget_gametime() + 0.05)
    }
    
    return 
PLUGIN_CONTINUE
}

public 
turret_turntotarget(entFloat:sentryOrigin[3], Float:closestOrigin[3])
{
    new 
newTrip
    
new Float:newAngle = (floatatan(((closestOrigin[1] - sentryOrigin[1]) / (closestOrigin[0] - sentryOrigin[0])), radian) * 57.2957795)
    
    if(
closestOrigin[0] < sentryOrigin[0])
    {
        
newAngle += 180.0
    
}
    
    if(
newAngle 0.0)
    {
        
newAngle += 360.0
    
}
    
    
sentryOrigin[2] += 35.0
    
    
if(closestOrigin[2] > sentryOrigin[2])
    {
        
newTrip 0
    
}
    
    if(
closestOrigin[2] < sentryOrigin[2])
    {
        
newTrip 255
    
}
    
    if(
closestOrigin[2] == sentryOrigin[2])
    {
        
newTrip 127
    
}
    
    
entity_set_byte(entEV_BYTE_controller1floatround(newAngle 0.70833))
    
entity_set_byte(entEV_BYTE_controller2newTrip)
    
entity_set_byte(entEV_BYTE_controller3entity_get_byte(entEV_BYTE_controller3) + 20 2550entity_get_byte(entEV_BYTE_controller3) + 20)

__________________
MiloS
MiloSx7 is offline
Send a message via MSN to MiloSx7
enjoi.
Veteran Member
Join Date: Mar 2011
Old 10-09-2011 , 08:21   Re: League of Legends [CS 1.6] -> Need Help
Reply With Quote #2

Lol. League Of Legends always makes me mad. We play a match in cs 1.6 but someone goes off so they start a game then he comes back on 5 mins later and they say sorry loling
__________________
Block Maker v6.0 []
Point Slay v3.0 []
Contact [ PM ]
enjoi. is offline
MiloSx7
Member
Join Date: Oct 2011
Location: Serbia, Nish
Old 10-09-2011 , 10:09   Re: League of Legends [CS 1.6] -> Need Help
Reply With Quote #3

lol makes me mad, too
As i said, if someone leaves the battle, he looses 150 points -.^
__________________
MiloS
MiloSx7 is offline
Send a message via MSN to MiloSx7
mix97mix
Member
Join Date: Sep 2011
Old 10-09-2011 , 10:24   Re: League of Legends [CS 1.6] -> Need Help
Reply With Quote #4

If your doing normal colorchat better put
client_print(id, print_chat,"Text")...
Just saying..
mix97mix is offline
Send a message via MSN to mix97mix Send a message via Skype™ to mix97mix
MiloSx7
Member
Join Date: Oct 2011
Location: Serbia, Nish
Old 10-09-2011 , 10:49   Re: League of Legends [CS 1.6] -> Need Help
Reply With Quote #5

leave my thread, noob...

this mix97mix is stealing plugins, avoid him...
__________________
MiloS
MiloSx7 is offline
Send a message via MSN to MiloSx7
ROKronoS
Senior Member
Join Date: Oct 2010
Location: Bucharest, Romania
Old 10-09-2011 , 12:08   Re: League of Legends [CS 1.6] -> Need Help
Reply With Quote #6

Quote:
I don't know how to detect map end, or all turrets destroyed, so this is now a shitty hero mod
You should create two types of entities: turretblue and turretpurple.
To detect if all the enemy/allied turrets have been destroyed , you can count the remaining after the destruction of a turret (turretblue or turretpurple).If it's 0 , all enemy/allied turrets have been destroyed

EDIT: Also , for map end you can use:
PHP Code:
public plugin_end()
{
    
code...

or http://forums.alliedmods.net/showpos...5&postcount=14

Last edited by ROKronoS; 10-09-2011 at 12:12.
ROKronoS is offline
MiloSx7
Member
Join Date: Oct 2011
Location: Serbia, Nish
Old 10-09-2011 , 12:50   Re: League of Legends [CS 1.6] -> Need Help
Reply With Quote #7

Thanks dude... This turret thing is very helpful, but i don't know how to put them somewhere on map... 1 should be @spawn point, and when player is @ spawn, his hp is regenerated fastly... Thanks for advice
__________________
MiloS
MiloSx7 is offline
Send a message via MSN to MiloSx7
ROKronoS
Senior Member
Join Date: Oct 2010
Location: Bucharest, Romania
Old 10-09-2011 , 13:11   Re: League of Legends [CS 1.6] -> Need Help
Reply With Quote #8

You can manually create those turrets with a command and then store the coordinates in a file (specific map file map_name.txt in a folder called turrets).For regeneration , you'll need to check if the player is in it's team buyzone.Going to search about buyzones...

EDIT: Perhaps you could use this native: http://www.amxmodx.org/funcwiki.php?...zone&go=search
EDIT 2: For the regeneration , you should make a task and check if the user is in the buyzone
PHP Code:
if(cs_get_user_mapzones(id) & CS_MAPZONE_BUY)
{
    
//code...

Taken from this plugin: http://forums.alliedmods.net/showthr...hlight=buyzone

Last edited by ROKronoS; 10-09-2011 at 13:34.
ROKronoS is offline
MiloSx7
Member
Join Date: Oct 2011
Location: Serbia, Nish
Old 10-09-2011 , 14:29   Re: League of Legends [CS 1.6] -> Need Help
Reply With Quote #9

You rock dude, thanks

Going to work on 1.1 soon... Thanks
__________________
MiloS
MiloSx7 is offline
Send a message via MSN to MiloSx7
ROKronoS
Senior Member
Join Date: Oct 2010
Location: Bucharest, Romania
Old 10-09-2011 , 14:36   Re: League of Legends [CS 1.6] -> Need Help
Reply With Quote #10

Quote:
What i need to put in client put in server so players will be asked first to choose hero, then team (blues or purples...)
You can inspire from here: http://forums.alliedmods.net/showthr...oose+team+menu to block the menus.Then create a menu with heroes and another one with the teams

EDIT: Read this topic: http://forums.alliedmods.net/showthread.php?t=155608
It will help you

Last edited by ROKronoS; 10-09-2011 at 14:43.
ROKronoS 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 02:32.


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