Raised This Month: $ Target: $400
 0% 

[Tutorial] Learn the new ways


Post New Thread Reply   
 
Thread Tools Display Modes
G-Dog
Senior Member
Join Date: Dec 2005
Location: Thunderstorm Central
Old 04-11-2011 , 14:09   Re: [Tutorial] Learn the new ways
Reply With Quote #111

Quote:
Originally Posted by The Art of War View Post
DeathMsg is old AMX, not AMXx. Use
Code:
public sh_client_death()
instead.
I think DarkGod got the same kick out of your statement that I did, especially if you actually look at how superhero itself catches the death.
__________________
If at first you don't succeed, then skydiving isn't for you.
G-Dog is offline
Send a message via AIM to G-Dog
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 04-11-2011 , 14:47   Re: [Tutorial] Learn the new ways
Reply With Quote #112

Quote:
Originally Posted by G-Dog View Post
I think DarkGod got the same kick out of your statement that I did, especially if you actually look at how superhero itself catches the death.
PHP Code:
// Must use death event since csx client_death does not catch worldspawn or suicides 
Ah.
__________________
The Art of War is offline
MuzzMikkel
Member
Join Date: Aug 2010
Location: Denmark
Old 06-03-2011 , 03:30   Re: [Tutorial] Learn the new ways
Reply With Quote #113

Jelle your the best, i really learned much on this tutorial!!
MuzzMikkel is offline
Send a message via MSN to MuzzMikkel
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 06-03-2011 , 20:23   Re: [Tutorial] Learn the new ways
Reply With Quote #114

look at the core... art.
Fr33m@n is offline
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 06-04-2011 , 06:22   Re: [Tutorial] Learn the new ways
Reply With Quote #115

Lol no offence but you are a bit late ^^
__________________
The Art of War is offline
brenu
Junior Member
Join Date: Jun 2011
Old 07-22-2011 , 09:35   Re: [Tutorial] Learn the new ways
Reply With Quote #116

Can you add the section Infinite Ammo and Giving Weapons at spawn?..
Please, i think many people want this....
brenu is offline
Send a message via MSN to brenu
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 07-22-2011 , 15:15   Re: [Tutorial] Learn the new ways
Reply With Quote #117

Quote:
Originally Posted by brenu View Post
Can you add the section Infinite Ammo and Giving Weapons at spawn?..
Please, i think many people want this....
If you read it you will see that it is already added.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
brenu
Junior Member
Join Date: Jun 2011
Old 07-23-2011 , 14:55   Re: [Tutorial] Learn the new ways
Reply With Quote #118

Hey, Jelle, please, can u help me??.
I write all the code like u talk in the tutorial...
I used all the functions that u talk in this tutorial..
But when i go compile i got this errors:

Quote:
warning 217: loose indentation <31>
warning 217: loose indentation <42>
error 017: undefined symbol "stick_weapon" <68>
error 017: undefined symbol "stick_weapon" <100>
error 017: undefined symbol "stick_weapon" <106>
error 021: symbol already defined: "cs_set_user_model" <109>
error 010: invalid function or declaration <110>
error 021: symbol already defined: "sh_give_weapon" <113>
error 054: unmatched closing brace <119>
Can you, Jelle, or you guys help me fixing this code or talking whats happened to me fix the code...
I'm much thanks if u guys can help me....

The code:
Code:
// Stick - Hp, Gravity, Armor, Speed, Gun!

/* CVARS - copy and paste to shconfig.cfg

//Stick
Stick_level 12   //Stick Level
Stick_health 750   //Stick Health
Stick_armor 100   //Stick Armor
Stick_grav 0.50   //Stick Gravity
Stick_speed 400   //Stick Speed
Stick_mult 3.0   //Stick Damage mult

*/

#include <superheromod>  

// GLOBAL VARIABLES
new gHeroID
new const gHeroName[] = "Stick"
new bool:gHasStickPower[SH_MAXSLOTS+1]
new const gStickPlayer[] = "models/player/Stick/Stick.mdl"
new const gStickWeapon[] = "models/shmod/v_Stick_AK47.mdl"
new const gStickWeapon2[] = "models/shmod/p_Stick_AK47.mdl"
//----------------------------------------------------------------------------------------------
public plugin_init()
{
	// Plugin Info
	register_plugin("SUPERHERO Stick", "1.0", "[SN]KyLava")

      // DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG  
      new pcvarLevel = register_cvar("Stick_level", "12")
      new pcvarHealth = register_cvar("Stick_health", "750")
      new pcvarArmor = register_cvar("Stick_armor", "100")
      new pcvarGrav = register_cvar("Stick_grav", "0.50")
      new pcvarSpeed = register_cvar("Stick_speed", "400")
      new pcvarMult = register_cvar("Stick_mult", "3.0")
     
      // This is what creates the hero remember the pcvarLevel is pointing at the level for the hero
      gHeroID = sh_create_hero(gHeroName, pcvarLevel)

     // EVENTS
     register_event("CurWeapon", "weapon_change", "be", "1=1")

     //This is setting the hero info. It pretty much explains itself
     sh_set_hero_info(gHeroID, "Hp, Gravity, Armor, Speed, Gun!", "More Health and Armor, Super Speed and Models")
     sh_set_hero_hpap(gHeroID, pcvarHealth, pcvarArmor)
     sh_set_hero_grav(gHeroID, pcvarGrav) 
     sh_set_hero_speed(gHeroID, pcvarSpeed)
     sh_set_hero_dmgmult(gHeroID, pcvarMult, CSW_AK47)
     
}  
//----------------------------------------------------------------------------------------------
public sh_hero_init(id, heroID, mode)
{

     if (gHeroID != heroID) return
     

     switch(mode)
     {

          //If The Hero is added
          case SH_HERO_ADD:
          {

               gHasStickPower[id] = true
               stick_morph(id)
               stick_weapon(id)
               switch_model(id)

          }

          case SH_HERO_DROP:
          {

               gHasStickPower[id] = false
               stick_unmorph(id)
               if (is_user_alive(id))
               {
                    sh_drop_weapon(id, CSW_AK47, true)
               }
          }
     }
}  
//----------------------------------------------------------------------------------------------
public plugin_precache()

{
     precache_model(gStickPlayer)
     precache_model(gStickWeapon)
}
//----------------------------------------------------------------------------------------------
public sh_client_spawn(id)
{

     if (gHasStickPower[id])
     {

          stick_morph(id)
          stick_weapon(id)
     }

}

stick_morph(id)
stick_weapon(id)
{

     cs_set_user_model(id, "stick")
     if (sh_is_active() && is_user_alive(id) && gHasStickPower[id] )
     {

          sh_give_weapon(id, CSW_AK47)
          stick_unmorph(id)
          {

          cs_reset_user_model(id)
          }
     }
}
//----------------------------------------------------------------------------------------------
public weapon_change(id)
{
     if ( !sh_is_active() || !gHasStickPower[id] ) return
     

     new weaponID = read_data(2)

     if (weaponID !=CSW_AK47) return
     
     switch_model(id)
     
     if (read_data(3) == 0)
     {
          sh_reload_ammo(id, 1)
     }

}
//----------------------------------------------------------------------------------------------
switch_model(id)
{

     if (!sh_is_active() || !is_user_alive(id) || !gHasStickPower[id] ) return
     

     if (get_user_weapon(id) == CSW_AK47)
     {

          set_pev(id, pev_viewmodel2, gStickWeapon)
          set_pev(id, pev_weaponmodel2, gStickWeapon2)

     }

}  
//----------------------------------------------------------------------------------------------

Last edited by brenu; 07-24-2011 at 11:15. Reason: Fixed Indentation, and Edit the errors.
brenu is offline
Send a message via MSN to brenu
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 07-23-2011 , 16:23   Re: [Tutorial] Learn the new ways
Reply With Quote #119

I wont even look at it if you don't fix your indentation.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
brenu
Junior Member
Join Date: Jun 2011
Old 07-23-2011 , 17:49   Re: [Tutorial] Learn the new ways
Reply With Quote #120

Quote:
Originally Posted by Jelle View Post
I wont even look at it if you don't fix your indentation.
How i do this??
How i fix my indentation???
I don't understand what you say..
Please i need help =(

Last edited by brenu; 07-23-2011 at 18:14.
brenu is offline
Send a message via MSN to brenu
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 18:37.


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