Raised This Month: $ Target: $400
 0% 

Scripting a plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Manikstor
Member
Join Date: Jan 2005
Old 05-30-2006 , 14:15   Scripting a plugin
Reply With Quote #1

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.
__________________
Manikstor is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 05-30-2006 , 17:22  
Reply With Quote #2

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.
VEN is offline
Manikstor
Member
Join Date: Jan 2005
Old 05-30-2006 , 18:27  
Reply With Quote #3

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
__________________
Manikstor is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 05-31-2006 , 11:06  
Reply With Quote #4

Quote:
Originally Posted by Manikstor
maybe u can do it for me as a request :P
Ok, here it is: Juicy Corpse
VEN is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 05-31-2006 , 11:44  
Reply With Quote #5

Dude that plugin is amazing!
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
VEN
Veteran Member
Join Date: Jan 2005
Old 05-31-2006 , 12:36  
Reply With Quote #6

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. :(
VEN is offline
Manikstor
Member
Join Date: Jan 2005
Old 05-31-2006 , 19:08  
Reply With Quote #7

Quote:
Originally Posted by VEN
Quote:
Originally Posted by Manikstor
maybe u can do it for me as a request
Ok, here it is: Juicy Corpse
Nice, Man I like the plugin And the credits


you did an awesome job with it thanks alot.

btw is it possible to make it say

Mmmmm.. Im Hungry, Time To Eat!
__________________
Manikstor is offline
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 05-31-2006 , 19:19  
Reply With Quote #8

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
Peli is offline
Send a message via MSN to Peli
Reply


Thread Tools
Display Modes

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:23.


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