AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Scripting a plugin (https://forums.alliedmods.net/showthread.php?t=29140)

Manikstor 05-30-2006 14:15

Scripting a plugin
 
Hello, Im a mapper and i saw this great movie where random people get spawn in some island and they get weapons diferent types of weapons. Now i want to make it a 1.6 map I can do that i can make the map. What i need is a plugin so everyone can kill each other t's can kill terrorist and still count as a frag. All i need is help with the plugin i can make the map.

Also I was talking with my friends and we came with this idea for a plugin.
when u kill a person and if u have low life you can regain life, How? easy by standing in front of the corpse and binding a key to the command so in chat command it says something like SAY: MMMM... Im Hungry Now! TIME TO EAT!. Therefor he starts regenarating life 1 by 1.

Im not a great Coder. Im still trying to learn, I did try a few codes by downloading the sma and editing a few thing and adding a few of my commands. So if u have a spare time and your willing to help me I will be thankful.

VEN 05-30-2006 17:22

Quote:

What i need is a plugin so everyone can kill each other t's can kill terrorist and still count as a frag
It's possible to alter a frags count but there are no good ways to make it possible to take the same damage for teammate's attack as if it was enemy's attack. Damage coefficient is different for team attacks.

As for the second idea i believe it may be funny.
First you will need to get when player dies
Code:
register_event("DeathMsg", "event_death", "a")
Usually that line is in plugin_init

Then when your event_death function is called you need to get the index of a victim with read_data(2) and after that get the current position for example with a get_user_origin native.

There are a certain tricks tough. For exmaple, to get the corp's position accurately, you have to catch when DEAD_DEAD flag is set. And for corp's use event you have to catch use sound and check the user's distance and view point.

Manikstor 05-30-2006 18:27

wow, i mean i tought it will be easier than that. im still tryin to learn coding but if you can help me with the 2nd plugin it will be great im willing to learn i really dont know where to start or maybe u can do it for me as a request :P

VEN 05-31-2006 11:06

Quote:

Originally Posted by Manikstor
maybe u can do it for me as a request :P

Ok, here it is: Juicy Corpse

SweatyBanana 05-31-2006 11:44

Dude that plugin is amazing!

VEN 05-31-2006 12:36

Thanks, if you're talking to me. :P
I like that idea and therefore i wrote that plugin.
The hardest part is detection of a corpse's stomach (or head) position.
I tried numerous ways but none of them can tell that.
It's because when corpse lies, player's bounding box is "stays".
If someone have a solution, it would be really nice but i highly doubt though. :(

Manikstor 05-31-2006 19:08

Quote:

Originally Posted by VEN
Quote:

Originally Posted by Manikstor
maybe u can do it for me as a request :P

Ok, here it is: Juicy Corpse

Nice, Man I like the plugin And the credits :P


you did an awesome job with it thanks alot.

btw is it possible to make it say

Mmmmm.. Im Hungry, Time To Eat!

Peli 05-31-2006 19:19

You can check to see if a users health is lower, then send out that message. Like this: (Off of damage event
Code:
if(get_user_health(id) < x) // Checks a users health, replace x with any # {    client_print(id, print_chat, "Mmmmm.. Im Hungry, Time To Eat!") // message that only that user can see } return PLUGIN_HANDLED // returns plugin, stops it there


All times are GMT -4. The time now is 16:23.

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