![]() |
custom kills system
How would I script a custom kills system? I can't find a way to check if the player you attack dies. Any ideas?
|
Why not just use the built in playerkills/playerdeaths vars? They can be edited via script.
|
On Galactic Nations we use custom weapons. The deaths register but the kills don't. I'm trying to find a way to fix that.
|
Classic uses a totally custom hit detection/killing system that emulates the built in stuff. We do ours by doing hit detection via the server, thus the server handles when ach player is hit, and as a result, when they die or kill someone.
|
If you follow Stefan's suggestions for a hitpoint system, you could (would) just code it into your hpfunctions class when the player's hurt. :)
|
If the player hp'sstring is: client.playerhp this would work.
if (actionserverside) { if (strequals(#p(0),stats)) { setstring clientr.deaths,#v(strtofloat(#s(clientr.deaths)) + 1); with(getplayer(#p(1))) { setstring clientr.kills,#v(strtofloat(#s(clientr.kills)) + 1); } } } //#CLIENTSIDE if (actionWEAPONACTION) { if (strtofloat(#s(client.playerhp)) == 0) { triggeraction 0,0,serverside,WEAPON-NAME,stats,#p(1),; } } so the weapon trigger should be something like this: triggeraction playerx + 1.5 + vecx(playerdir)*2,playery + 1.5 + vecy(playerdir)*2,WEAPONACTION,#a; when the weapon is fired. I'm not possitive this will work, and I didn't test it offline. |
It works. Thanks :D.
|
Quote:
|
Quote:
|
Because anything on the clientside can be edited with memory editing programs. Including the triggeraction parameters. You have to do it serverside.
|
Quote:
|
You're a fool if you think that it's not important to have a serverside damage system. Important things like damage to players, dealing with items, and dealing with stats all need to be serverside. If this concept is too hard for you to grasp, then give up and stop asking stupid questions.
|
Quote:
|
Quote:
And I honestly do think a damage system, by someone who knows EXACTLY what their doing, can be done mostly clientside aside from the setting the strings and vars for the other player, but even then, this can be a trigger to the other player and done serverside. o-o Thousands of ways to script one thing, all of them are right, not all of them are efficient. Depends on the scripter and the use. :D |
Quote:
What more can you say to help him understand it? |
Quote:
Everything doesn't have to be serverside, just the important stuff. Stuff like a GUI is going to be clientside, but it should be reading from clientr variables for the stats it displays. If you're going to have weapons that do various damage, you can't have those damages set as parameters in the triggeraction. You have to detect what type of attack it is serverside. Otherwise a cheater could edit the damage value of the clientside damage trigger to make the weapon more powerful. You should also never use client. strings for storing important data. You HAVE to use clientr., the r being "read only" which means the client can only read a clientr string, but cannot edit it. |
I said it wasn't a good enough reason because most scripts need clientside. No script with clientside is going to be 100% secure. If I can't use triggeraction in this script because it's too insecure what should I use? I never said I was an all knowing scripter. I just don't see any other way to do it. Maybe if you told me what you would do we could make some progress here.
|
I would use a system similar to what Stefan has posted. I think you're confused about what I mean involving clientside being unsafe...
I realize a lot of scripts need to be clientside. But those scripts are not going to affect other players. Sure, someone could use a memory editing program to change their GUI display, or change some signs and stuff, but they should not be able to change important variables like weapon damage and health and stuff. That's all I'm saying. Obviously you can't script EVERYTHING serverside. Only the stuff that is important. In fact, if you come across a situation where something NEEDS to be serverside and you can't figure out how to make it serverside, you should STILL figure out how to do it serverside, because resorting to clientside is not an option if you care about your server. But by all means, you can script it all clientside and then deal with hackers ruining your server in a matter of days. |
I just finished the script and the only triggeraction parameter I used was #a. The rest of the script (calculating the damage, hurting the player, and changing kills/deaths) is serverside.
|
| All times are GMT +2. The time now is 09:31 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.