Raised This Month: $ Target: $400
 0% 

How can a coder find out if the user has other heroes ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mydas
Senior Member
Join Date: Mar 2005
Old 09-10-2006 , 11:51   How can a coder find out if the user has other heroes ?
Reply With Quote #1

Like Poison Ivy is supposed to be immune to poisons. So I made a poison hero and I want it not to work on players that have Poison Ivy.
__________________
[2021] I would love to revive SHMOD.

My heroes: SLAYER, Akasha, Achilles, Robo-Ky,Justice, Potemkin, Juggernaut, Mirage, Leviathan, Tyrael, Marduk, Omega Red
mydas is offline
Send a message via Yahoo to mydas
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 09-10-2006 , 14:28   Re: How can a coder find out if the user has other heroes ?
Reply With Quote #2

possible with the module

or you can rescript them together like my Pokemon Teams

PS: nice to see ya
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 09-10-2006 , 22:29   Re: How can a coder find out if the user has other heroes ?
Reply With Quote #3

You can check out Blade when i release it though it would require editing Poison Ivy which I have to re-edit for Longshot anyway. But it would be a simple check like the one i made for Blade checking for Dracula (though in Blade it may look a bit strange). Will post it soon enough.


However, with the module there is a check you can use currently:
Code:
//Check if user has this hero
//1. Player ID
//2. Hero ID
native sh_check_hero(id, heroID);
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
mydas
Senior Member
Join Date: Mar 2005
Old 09-11-2006 , 04:49   Re: How can a coder find out if the user has other heroes ?
Reply With Quote #4

something like get_user_info(id, "POISON", temp, 7) ?
thought about it, doesn't work.

ps. nice to see ya too, i'm back now (again)
__________________
[2021] I would love to revive SHMOD.

My heroes: SLAYER, Akasha, Achilles, Robo-Ky,Justice, Potemkin, Juggernaut, Mirage, Leviathan, Tyrael, Marduk, Omega Red
mydas is offline
Send a message via Yahoo to mydas
Zenith77
Veteran Member
Join Date: Aug 2005
Old 09-14-2006 , 12:43   Re: How can a coder find out if the user has other heroes ?
Reply With Quote #5

Quote:
Originally Posted by vittu View Post
However, with the module there is a check you can use currently:
Code:
//Check if user has this hero
//1. Player ID
//2. Hero ID
native sh_check_hero(id, heroID);
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
mydas
Senior Member
Join Date: Mar 2005
Old 09-15-2006 , 05:06   Re: How can a coder find out if the user has other heroes ?
Reply With Quote #6

I bear no interest in the module. I just wanna know how can I find what I need to know using get_user_info(). So, can anyone help ? xD
__________________
[2021] I would love to revive SHMOD.

My heroes: SLAYER, Akasha, Achilles, Robo-Ky,Justice, Potemkin, Juggernaut, Mirage, Leviathan, Tyrael, Marduk, Omega Red
mydas is offline
Send a message via Yahoo to mydas
Batman/Gorlag
Senior Member
Join Date: Aug 2005
Old 09-16-2006 , 04:21   Re: How can a coder find out if the user has other heroes ?
Reply With Quote #7

In your poison ivy code you first have to set a user's info using set_user_info, like in this code in your hero_init:

Code:
//if the person has poison ivy's power set_user_info(id, "POISON", "1") //else if the person dropped poison ivy set_user_info(id, "POISON", "0")

Then in your hero, when you have to retrieve the info, all you have to do is something similar to this:

Code:
new temp[7] get_user_info(id, "POISON", temp, 6) new isPoisonIvy = str_to_num(temp) //This checks if the victim has been poisoned if(isPoisonIvy == 1){    //something happens } else if(isPoisonIvy == 0){    //person isn't Poison Ivy, do something else instead }

And yeah good to see you back.
__________________
GRR If only the amxmod programming were in Java.....
Java and C used to be two different languages, now Java is turning into another C. My logevent plugin
Batman/Gorlag is offline
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 09-16-2006 , 04:50   Re: How can a coder find out if the user has other heroes ?
Reply With Quote #8

No don't use set info, that's just bad... Should be removed from those others in favor of forwards.

Like I said before check Blade (and it's Dracula) - http://forums.alliedmods.net/showthread.php?t=30090
I gotta edit poison ivy at some point anyway.
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
mydas
Senior Member
Join Date: Mar 2005
Old 09-16-2006 , 09:30   Re: How can a coder find out if the user has other heroes ?
Reply With Quote #9

Thank you very much, I'm checking it right now. First time I thought you were referring to the get/set info thingie. I will make a modified Poison Ivy for this, if it's ok with you ... but first I gotta understand what a "forward" is.
__________________
[2021] I would love to revive SHMOD.

My heroes: SLAYER, Akasha, Achilles, Robo-Ky,Justice, Potemkin, Juggernaut, Mirage, Leviathan, Tyrael, Marduk, Omega Red
mydas is offline
Send a message via Yahoo to mydas
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 16:12.


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