PDA

View Full Version : First Plugin =P


0uK^-
04-08-2008, 12:51
Hi there.
I use the plugin Biohazard but i want to give the Humans and Zombies classes with powers =P

So i search how to do that and 6 days later is working =P

But i got 2 issues:

1 - The footsteps donīt work =\

2 - When the round begins everyone needs to change the weapon so they can get the speed.

And for last, i'm newbie in this soo i ask if someone can see the plugin if is ok ( the codes, etc...) and if is a easy way to do the code is not ok.

Tkz in advance =)

Ps- Sry for my english =\

grimvh2
04-08-2008, 13:45
2 - i did not looked but probally set speed when they change weapon so you set it in curweapon event , dont delete that but you also have to do this


plugin_init()
{
register_logevent("StartRound",2,"0=World triggered", "1=Round_Start");
}

public StartRound(id)
{
set_task(1.0, "setspeed", id)
}

public setspeed(id)
{
set_user_maxspeed(id, yourspeed)
}


and if you did that check if the code is reachable

MeRcyLeZZ
04-08-2008, 14:59
1. Since it's your first plugin I recommend using set_user_footsteps(id, set) (http://www.amxmodx.org/funcwiki.php?go=func&id=130) from the Fun module instead.

2. You have to set the correct speed for everyone after freezetime is over. In your new_round event add this:

public event_new_round(id)
{
freezetime = true;

@@ set_task(0.1+get_cvar_float(mp_freezetime), "freezetime_over")
}

public freezetime_over()
{
new id
for (id = 1; id <= 32; id++)
{
if (!is_user_alive(id))
continue;

set_speed(id);
}
}

hoboman
04-08-2008, 15:10
...or better yet, hook Round_Start and put the stuff from "freezetime_over" into a Round_Start handler. Should be much more efficient.

0uK^-
04-08-2008, 16:29
Tkz i will do that...

The footsteps i will add the set_user_footsteps...

The rest the code is correct?

Tkz all for responding =)