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

Help with kinda giveing XP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 09-23-2006 , 18:53   Help with kinda giveing XP
Reply With Quote #1

What i need is, how i can seperate the mana giving.

- I tryed this, but when a other client joined the server, then he had the same ammount of mana as me?
So how can i make it like each person get there "own" mana?

Code:
#include <amxmodx> #include <amxmisc> new mana[33]; public plugin_init() {         register_plugin("speed", "1.0", "stigma")     register_event("DeathMsg","gMana","a")     register_clcmd("say /test","team")         return PLUGIN_CONTINUE } public gMana(id) {         set_hudmessage(0, 100, 155, 0.40, 0.83, 0, 1.0, 4.0, 0.1, 0.01, 3)         new killer = read_data(1)     new victim = read_data(2)     new iWeapon, attacker     get_user_attacker(victim, iWeapon)         new vicname[32]     get_user_name (victim, vicname,32)         if(get_user_team(killer) != get_user_team(victim)) {             if (killer != victim)         {                 show_hudmessage(attacker, "You've recieved 20 mana points^nfor killing %s", vicname)             mana[attacker] += 20                 } else {                     show_hudmessage(attacker, "You've lost 50 mana points^nfor committing suicide!")             mana[attacker] -= 50             }     } else {                 show_hudmessage(attacker, "You've lost 65 mana points^nfor killing a teammate!")         mana[attacker] -= 65                 show_hudmessage(victim, "You've got 65 mana from %s mana pool^nReason: teamkill", attacker)         mana[victim] +=65             }         return PLUGIN_CONTINUE     }
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 09-23-2006 , 21:59   Re: Help with kinda giveing XP
Reply With Quote #2

gMana(id) --> gMana()
[ --<-@ ] Black Rose is offline
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 09-23-2006 , 22:05   Re: Help with kinda giveing XP
Reply With Quote #3

I have tryed that it dosent work :S
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 09-23-2006 , 22:09   Re: Help with kinda giveing XP
Reply With Quote #4

It's supposed to be that.

Is that your full code?
[ --<-@ ] Black Rose is offline
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 09-23-2006 , 22:13   Re: Help with kinda giveing XP
Reply With Quote #5

Nope. But here it is...

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #define PLUGIN "Wizardry" #define AUTHOR "stigma" #define VERSION "1.0" new mana[33]; public plugin_init() {         register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("DeathMsg","gMana","a")     register_cvar("XP_per_kill","20")         return PLUGIN_CONTINUE } public client_putinserver(id) {         set_task(5.0,"vMana")     } public vMana(id) {         set_hudmessage(0, 0, 255, 0.00, 0.60, 0, 1.0, 1.0, 0.1, 0.01, 1)         show_hudmessage(id,"Mana: %d",mana[id])         set_task(1.0,"vMana")         return PLUGIN_HANDLED     } public gMana() {         set_hudmessage(0, 100, 155, 0.40, 0.83, 0, 1.0, 4.0, 0.1, 0.01, 3)         new killer = read_data(1)     new victim = read_data(2)     new iWeapon, attacker     get_user_attacker(victim, iWeapon)         new vicname[32]     get_user_name (victim, vicname,32)         if(get_user_team(killer) != get_user_team(victim)) {             if (killer != victim)         {                 show_hudmessage(attacker, "You've recieved 20 mana points^nfor killing %s", vicname)             mana[attacker] += 20                 } else {                     show_hudmessage(attacker, "You've lost 50 mana points^nfor committing suicide!")             mana[attacker] -= 50             }     } else {                 show_hudmessage(attacker, "You've lost 65 mana points^nfor killing a teammate!")         mana[attacker] -= 65                 show_hudmessage(victim, "You've got 65 mana from %s mana pool^nReason: teamkill", attacker)         mana[victim] +=65             }         return PLUGIN_CONTINUE     }
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 09-23-2006 , 22:22   Re: Help with kinda giveing XP
Reply With Quote #6

Should work.
Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #define PLUGIN "Wizardry" #define AUTHOR "stigma" #define VERSION "1.0" new mana[33]; public plugin_init() {         register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("DeathMsg","gMana","a")     register_cvar("XP_per_kill","20") } public client_putinserver(id) {         // you have to pass an id to vMana(id)     set_task(5.0, "vMana", id)     } public vMana(id) {         set_hudmessage(0, 0, 255, 0.00, 0.60, 0, 1.0, 1.0, 0.1, 0.01, 1)         show_hudmessage(id,"Mana: %d",mana[id])         set_task(1.0,"vMana")     } // attacker used in most functions below, was not defined, therefore no1 accept victim for a teamkill would get xp/see hud msgs public gMana() {         set_hudmessage(0, 100, 155, 0.40, 0.83, 0, 1.0, 4.0, 0.1, 0.01, 3)         new killer = read_data(1)     new victim = read_data(2)         new vicname[32]     get_user_name (victim, vicname,32)         new killername[32]     get_user_name (killer, killername,32)         if(get_user_team(killer) != get_user_team(victim)) {                 if (killer != victim)         {                         show_hudmessage(killer, "You've recieved 20 mana points^nfor killing %s", vicname)             mana[killer] += 20                         } else {                         show_hudmessage(killer, "You've lost 50 mana points^nfor committing suicide!")             mana[killer] -= 50                     }         } else {                 show_hudmessage(killer, "You've lost 65 mana points^nfor killing a teammate!")         mana[killer] -= 65                 // %s does not pring variables, killer --> killername         show_hudmessage(victim, "You've got 65 mana from %s mana pool^nReason: teamkill", killername)         mana[victim] +=65             }     }

Last edited by [ --<-@ ] Black Rose; 09-23-2006 at 22:24.
[ --<-@ ] Black Rose is offline
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 09-23-2006 , 22:32   Re: Help with kinda giveing XP
Reply With Quote #7

Ohh gg nice mayn!

kk karme+!
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
stupok
Veteran Member
Join Date: Feb 2006
Old 09-24-2006 , 15:35   Re: Help with kinda giveing XP
Reply With Quote #8

You are testing for suicide when the killer and the victim are on opposing teams... If you are CT and you kill yourself (CT), the killer and victim are on the same team...

Here is my version:
Code:
if(get_user_team(killer) != get_user_team(victim)) {      show_hudmessage(killer, "You've recieved 20 mana points^nfor killing %s", vicname)      mana[killer] += 20 } else {      if (killer != victim)      {           show_hudmessage(killer, "You've lost 65 mana points^nfor killing a teammate!")           mana[killer] -= 65           // %s does not pring variables, killer --> killername           show_hudmessage(victim, "You've got 65 mana from %s mana pool^nReason: teamkill", killername)           mana[victim] +=65           } else {                     show_hudmessage(killer, "You've lost 50 mana points^nfor committing suicide!")                     mana[killer] -= 50           } }
stupok is offline
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 09-27-2006 , 03:52   Re: Help with kinda giveing XP
Reply With Quote #9

Ohh thx alot, i actually got the message, the the person who comitted suicide, has killed a teammate.. thx alot!

++Karme ;)
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
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:09.


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