AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Tasks (https://forums.alliedmods.net/showthread.php?t=73664)

Scherzo 07-03-2008 15:27

Tasks
 
38 Attachment(s)
Tasks 1.02 (with extensions)


Description
You can define tasks for players and award for making them. Now only for kill enemies or survive rounds. It could be prize for using different weapons, not typical kill (fe. Headshots with nade), for player who good evade death or whatever you want.
Now you can define Multi-Tasks.
Default task can be one activity, but if you change constant MAXEXT (read lower about constants) from 0 to 1,2,3....you can add some extenstions.

Thanks

-Texnux for suggestions
- Slim-T for translation [sv]
- helderpostiga1 for translation [pb]

New feature:
If player make task, next award will be more than standard.

n - count of made tasks
NEXT_AWARD = STANDARD_AWARD + n*STANDARD_AWARD*0.25

Adding task:
Create config with list of task define by command add_task (read lower about it), tasks.cfg is default (no required!), but not only this file can contain it. You can use other plugins (fe. http://forums.alliedmods.net/showthread.php?p=379510) to add different tasks on different maps.

Installation
  • tasks.amxx put into plugins folder
  • add tasks.amxx into configs/plugins.ini
  • tasks.txt put into amxmodx/data/lang folder
  • if you want put sounds into sound/tasks folder
  • create or download my config and put as amdmodx/configs/tasks.cfg file or other execute on start server/load map and write there lines with tasks
Required modules
  • <cstrike>
  • <csx>
  • <fakemeta>
  • <engine>
Server Commands/Cvars
  • amx_taskaward 0|1|2
    • 0 - standard (money on de_, cs_ and as_ maps; alternative on other)
    • 1 - money
    • 2 - alternative
  • amx_altaward <num> //work only if amx_taskaward is not 1
    • 0 - random
    • 1 - medkit
    • 2 - increase max health
    • 3 - chance on Berserker Mode
      • more speed
      • extra hp
      • extra knife damage
      • if attacker is next to (< 2m) get slap
Later I will attach video from launch berserker mode
  • amx_taskmedkithp NUM
    • one medkit restore NUM hp
  • add_task args...
    • adding new task
  • add_extend2task args...
    • adding extension for last added task, it accept MAXEXT(look at constants list, lower) extensions
Using:
Quote:

add_task Award What How_many_times [Weapon] [With_hs]
Quote:

add_extend2task What How_many_times [Weapon] [With_hs]
Award - AWARD$ or AWARD/100 medkits, max HP or chance on Berserker Mode
What - KILL or SURVIVE
How_many_times - how many times repeat activity
Weapon* (optional) - weapon with which player kill enemy
  • Weapon can be any of CS . You can see list on http://www.amxmodx.org/funcwiki.php?...d=4#const_cswp without CSW_ prefix, you cant use flashbang, smoke grenade ,c4 and kevlars...i hope that dont need give reason :wink:. If kill can be done with any weapon write dm (doesnt matter) as 4th argument
With_hs* (optional) - if 1 victim must be killed with headshot

* only for KILL task

examples of single tasks:

Task:kill 2 enemies with usp for 300$ or 3 alternative award
Quote:

add_task 300 kill 2 usp 0
Task:survive 3 rounds for 500$ or 5 alternative award
Quote:

add_task 500 survive 3
Task:kill 7 enemies with Kalashnikov with headshot for 1000$ or 10 alternative award
Quote:

add_task 1000 kill 7 ak47 1
exaxples of tasks with extensions: (for this examples MAXEXT must be '1')

Task: survive 5 round AND kill 6 enemies for 800$ or 8 alternative award
Quote:

add_task 800 survive 5
add_extend2task kill 6
Task: kill 3 enemies with usp with headshot AND kill 6 enemies with m4a1 for 1000$ or 10 alternative award
Quote:

add_task 1000 kill 3 usp
add_extend2task kill 6 m4a1
Task: survive 5 round for 800$ or 8 alternative award
(bad order of commands)
Quote:

add_extend2task kill 6
add_task 800 survive 5
!IMPORTANT:
this command can be used only on few seconds after load map (in start config only) because changing rules during game is bad :down:
Client Commands
  • tasks - display list of tasks
  • medichelp - display very short manual about using medkits
  • medic - use medkits
Presentation
tasks.sma
Code:

...
#define MAXEXT 2
...

tasks.cfg
Code:

add_task 500 kill 3 dm 1

add_task 400 kill 2 mac10 1
add_extend2task kill 2 tmp

add_task 400 kill 3 MP5NAVY 1
add_extend2task kill 4 m4a1
add_extend2task kill 4 famas 1

add_task 300 kill 2 scout

add_task 800 survive 5
add_extend2task kill 6

Effect:
http://forums.alliedmods.net/attachm...6&d=1215376288

Sounds
Any sounds of plugins are optional, if you dont want any of them simply dont put it on your server (without any problems)
Languages
  • EN
  • PL
  • SV
  • PB
Constants
  • ( 14 ) #define MAXPLAYERS 32
    • if your server have less change it and recompile
  • ( 16 ) #define MAXTASKC 70
    • max count of tasks, the same effect as MAXPLAYERS - less memory using
  • ( 17 ) #define MAXEXT 0
    • define how much extension are accept
  • ( 19 ) #define messInterval 80.0
    • interval info messages (in seconds)
Change Log
  • 1.0 - Base
  • 1.01 - Fixed few bugs
  • 1.02 - Clean code, repair base, two new awards
Note: In code i write author 'R3X' because it is my real nick, 'Scherzo' i was using on forums when i registered (long ago).

YamiKaitou 07-03-2008 15:51

Re: Tasks
 
Please upload the file to this post. It makes it easier to update.

Also, it is best to use pcvars all the time. Even if the cvar is already registered, you can use get_cvar_pointer("cvar") to generate the pcvar part of it.

Scherzo 07-04-2008 07:00

Re: Tasks
 
Quote:

Even if the cvar is already registered, you can use get_cvar_pointer("cvar") to generate the pcvar part of it.
Ok, done. Thanks :)

I fixed few bugs and uploaded correct sounds.

//Edit
@down
I had that earlier, but changed. Repaired.

YamiKaitou 07-04-2008 10:44

Re: Tasks
 
Get the pointer during plugin_init. There is no need to keep getting them when you can do it just once.

AntiBots 07-04-2008 12:21

Re: Tasks
 
Exelent. Very good Idea.

Texnux 07-04-2008 20:19

Re: Tasks
 
Pretty interresting plugin you got there!

Great with awards for killing people with a special weapon!

What would make this plugin outstanding would be features like this:
- Random award for completing a task
- More awards - armor/godmode/noclip and the like
- More tasks
- Special rewards for completing multiple tasks
- Sound effects to some task, example when you are granted godmode it emits one sound

- Texnux

Scherzo 07-05-2008 09:21

Re: Tasks
 
Thanks.

Idea is based on Condition Zero Single Player game.

I will add random award option when got more types of award :). Thx for suggestion.

Sounds already exists for complete task and use medkit. Later add more on new events.

I`m thinking about Multi-task. I only need time to write it.

More tasks...At start write plugin I had award for doing scenario task, but I was working only on de_ maps (planting, defusing etc), so I deleted it. Maybe later I add more task, now I focus on awards. If somebody got any idea please post it there.

Scherzo 07-06-2008 13:43

Re: Tasks
 
Updated.

//Edit
And again.

//Edit2
Fixed two little bugs.

Update
No more two ways to catch death event. Now it work only with register_event() - (client_death deleted).

Styles 07-08-2008 04:50

Re: Tasks
 
Scherzo fakemeta! Don't use FUN :P

Scherzo 07-08-2008 06:10

Re: Tasks
 
Oh, so I cant use it? I found on function list 'set_user_health' and added medkits :D


Fixed. Now it is using fakemeta.


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

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