Some Shi* - Again
Sorry that i'm bothering you every day =/
But i need to finish this plugin Here's The Code: PHP Code:
It doesn't give me any errors... Just doesn't work... It just show's me: 10 Frags Remaining < all the time - it doesn't change when i kill someone. And when someone gets 10 Frags - It doesn't show the message. And it doesn't change the timelimit back... Every next map has 1min timelimit < LOL I know the timelimit thing isn't a good method... But i don't know other way that i can do this... I just wan't to make this plugin... It remind's me "quake 3 arena" Thanks. If i wrote some words incorrectly - Sorry for my english |
Re: Some Shi* - Again
What Mod are you trying to use this on?
If its DoD, you need to use the dodfun include. To do that, change: #include <fun> to #include <dodfun> set_user_frags(id, Frags) to dod_set_user_kills(id, Frags, 1) new Frags = get_user_frags(id) to new Frags = dod_get_user_kills(id) If its not DoD, sorry, can't help. ps, your English is great. I commend you for learning it so well. |
Re: Some Shi* - Again
Lol theres quite a few things wrong.
Firstly reset_back wont ever do anything. Your checking a cvar and then setting it to itself. Pointless? Checking for a winner or player spawn (resetHUD) doesn't seem like the best way. I'm working on something similar at the moment and I reckon deathmsg would be the best (the amount of frags changes when someone dies so this is the best time to check) To set 1 minute remaining you can set mp_timelimit to 1. You need to the value of halflife time and add 1 to it and set mp_timelimit to that Code:
Theres some otherthing like set_user_frags(id).. inside a get player for loop. I don't understand what this is supposed to do but it should at least be players[i].. Have a play around with that and see how far you get. I can show you how I did it if you really get stuck. Good Luck |
Re: Some Shi* - Again
Thanks.
This mod is for CS(Counter-Strike) :O The "set_user_frags" was ment to "if user gets more frags than 50 it set's their frags to 50. But it doesn't matter anymore. I'm totally STUCK. I'd understand just a part of it, can you be more clearer, please. It shows me "Error: Undefined symbol "halflife_time" on line 68" do i need to create it??? And i didn't understand the DeathMSG event - what to write in it? i know just the start. I looked at some code's, every DeathMSG event differs from each other, i searched this Forum, Google but i still can't find anything. Can you give me some code for hint? Here's my code: PHP Code:
|
Re: Some Shi* - Again
halflife_time is in the engine module. So you'd need to include it.
You may want to look into using fakemeta. new Frags = pev(id, pev_frags) set_pev(id, pev_frags, Frags) |
Re: Some Shi* - Again
Thanks VET.
I know all of you think: "This guy comes and asks every time he has some difficulties, he so stupid" It's not like that. I'm trying - this time i was trying to figure out this mess out 1,5h with no break!!!i Just can't Now my problems are. 10 Frags Remaining < all the time - it doesn't change when i kill someone. And when someone gets 10 Frags - It doesn't show the message. TimeLimit thing doesn't work at ALL I just can't make this plugin, it's so simple. Im just a n00b. Where should i put the Code:
new Frags = pev(id, pev_frags)PHP Code:
|
Re: Some Shi* - Again
You're making progress. The reason for your problems is most of the time it doesn't know what 'id' is.
You set the task Code:
You'd need to change it to Code:
Also your death_a does not have an id parameter. It should be Code:
Look where you registered the DeathMsg event. It has the flag "a", this means that it is sent to all players at once not a single player, so doesn't come with a specific id number. (messages with the flag b are sent individually (like ResetHUD) so they have an id parameter) Instead to get the id number of the killer you need to the line Code:
Code:
Link to list of events where you can find what number refers to what You'll also need to move your get_user_frags statement inside the loop but before the if statement. This way the loop goes through all the players on the server. First it checks their frags (don't forget players[i]) then it compares if the frags are greater or equal to the limit (make it >= instead of >) and if they are send a message saying they won. Other things you might want to add are.. Once you find a winner (in the loop) add the command [smallbreak[/small] So add a line at the end of the if Frags >... put the break command in. This stops the for loop at that point (whats the point in checking for a winner after you've found one?) A variable to detect a winner has been found. At the top of the code add a variable like.. Code:
Then before the for loop make an if statement like.. Code:
This will quit out of the function and skip the winner check, if a winner has already been found. Then inside your for loop just before the 'break' command ( a winner has been found) add the line Code:
And that should pretty much do it.. |
Re: Some Shi* - Again
Double post cause i don't want to edit the previous one because of the code editing bug.
The first two code sections (about set task should be..) Code:
and Code:
|
Re: Some Shi* - Again
Big thanks!!!
Just 2 Problems - Sorry that i am disturbing you. These doesn't show up: Code:
set_hudmessage(255, 0, 0, -1.0, 0.18, 0, 6.0, 5.0)Code:
set_hudmessage(255, 0, 0, -1.0, 0.20, 0, 6.0, 5.0)Here's the CODE - again: PHP Code:
|
Re: Some Shi* - Again
Try this
Code:
|
| All times are GMT -4. The time now is 10:29. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.