AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=43)
-   -   How can a coder find out if the user has other heroes ? (https://forums.alliedmods.net/showthread.php?t=44664)

mydas 09-10-2006 11:51

How can a coder find out if the user has other heroes ?
 
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.

Emp` 09-10-2006 14:28

Re: How can a coder find out if the user has other heroes ?
 
possible with the module :wink:

or you can rescript them together like my Pokemon Teams

PS: nice to see ya

vittu 09-10-2006 22:29

Re: How can a coder find out if the user has other heroes ?
 
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);


mydas 09-11-2006 04:49

Re: How can a coder find out if the user has other heroes ?
 
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)

Zenith77 09-14-2006 12:43

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

Originally Posted by vittu (Post 379743)
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);



mydas 09-15-2006 05:06

Re: How can a coder find out if the user has other heroes ?
 
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

Batman/Gorlag 09-16-2006 04:21

Re: How can a coder find out if the user has other heroes ?
 
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.

vittu 09-16-2006 04:50

Re: How can a coder find out if the user has other heroes ?
 
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.

mydas 09-16-2006 09:30

Re: How can a coder find out if the user has other heroes ?
 
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.


All times are GMT -4. The time now is 20:00.

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