![]() |
Question involving custom damage scripts.
Okay, so I have a weapon that uses triggeraction and whatnot clientside, but in my class, where it calculates the damage to be taken, its only using the variables of the person hit. What kind of function or w/e would I use to find the variable of another player? findplayer? and how would i go about telling it what player to find?
|
findplayer(str) - returns object
findplayerbycommunityname(str) - returns object findplayerbyid(int) - returns object You'd need to use testplayer(x, y) or something similar to see which player you want to get. testplayer() returns an integer so you'd need to use findplayerbyid() if you want to use it. |
Send the attacker as a parameter with the triggeraction?
|
Quote:
In your melee weapon system: triggeraction(x, y, "damage", damageAmount, player.account); Then in your damage system that catches the damage triggers: PHP Code:
|
Usually it's best to just send the account of the attacker and the weapon they're using if you're using a clientside melee system since they can change the damage to whatever they want. For example,
PHP Code:
|
urg. i tried this today. i cant even get it to to hit the player that has it. !pissed!
What am i doing wrong in this? PHP Code:
|
Quote:
Also probably not the best idea to be doing this on a constant timeout beyond testing. |
Yeah the timeout is purely for testing. I'll try your suggestion.
|
Also, I don't think it'll work at the players x,y because that location doesn't actually touch a player. Try x+1.5, y+1.5
|
I don't know what exactly you're trying to do but I think this might be it
PHP Code:
|
| All times are GMT +2. The time now is 01:15 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.