need help with making user specific cvars
Hey guys,
I do a lot of plugin making, and i am making my first ever "mod" and i am trying to make it so an admin can do "amx_wanted" and make a user "Wanted" (EX: Player Bob is wanted for TKing. Bounty: $1000) and i want to make it so it checks: if when a player is killed, is he wanted? so far i have the easy stuff like: Code:
register_event("DeathMsg", "hook_death", "a", "1>0")Code:
new Killer = read_data(1)if so, then give Killer $1000 else plugin_continued If you guys could help me with this... that would be great :) Thanks Guys, Strake |
Make a variable, let's say "new wanted[33];". The array size is 33 so that we can store ids from 1-32, each representing a player in the game.
In the command that handles amx_wanted, use cmd_target to get the target. Set wanted[theirplayerid] to 1. When a player leaves, make sure to reset wanted[theirplayerid] back to 0. On death, see if wanted[theirplayerid] is 1. |
yeah, but how do i do that... how do i make is so the array is the users id? thats the part that i dont understand....
|
Code:
|
No, v3x, no... :-\
Code:
Using that setup, you can check if wanted[Victim] is 1 or not on DeathMsg to see if they are wanted. |
That man... i've always wondered how to do this, but never had a chance to sit down and learn how to do that... i'll study the code, learn, then put into my plugin...
Thanks!, Strake |
| All times are GMT -4. The time now is 10:01. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.