Thread: Tasks
View Single Post
Plugin Info:     Modification:          Category:          Approver:   v3x (159)
Scherzo
Senior Member
Join Date: Feb 2007
Location: Kwidzyn, Poland
Old 07-03-2008 , 15:27   Tasks
Reply With Quote #1

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


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).
Attached Thumbnails
Click image for larger version

Name:	screen.JPG
Views:	10914
Size:	37.7 KB
ID:	28466  
Attached Files
File Type: sma Get Plugin or Get Source (tasks.sma - 2061 views - 21.5 KB)
File Type: cfg tasks.cfg (839 Bytes, 916 views)
File Type: txt tasks.txt (4.1 KB, 844 views)
File Type: rar sounds.rar (102.4 KB, 965 views)

Last edited by Scherzo; 12-21-2008 at 16:24. Reason: update
Scherzo is offline