Forum
CS2D General Ideas for CS2D - READ THE FIRST POST (OP)!tweenstate:
0 - Tween completed - the animation is done
1 - Tween cancelled - when the round restarts, the image gets freed or the respective function is used to reset the image (For example:
tween_pos = imagepos).
2 - Tween abrupted - when another tween is called and resets the animation
Or you could do this with a hook (
tweenhook) as well, though less efficient.
In that case also add a tweenstate for starting the tween.
Or do both!
os.clock * 1000 + tweenTimerand then check timer, to get info if a image is animating or not.
Gaios has written
@ Mami Tomoe: You can save
os.clock * 1000 + tweenTimerand then check timer, to get info if a image is animating or not.
Not reliable.
Mami Tomoe has written
When you follow a friend through the USGN friend list, once you join the server the spectated player should be the friend (if possible).
Maybe can add a function :
follow a friend by Steam , if click "follow a friend",they can join your friend server.
A new feature for spectating (similar to the fog button toggle).
When enabled, and the spectated player:
> Uses a scope; you will see the scope.
> Gets flash banged; you will be blinded.
When disabled (default), and the spectated player:
> Uses a scope; you will not see the scope.
> Gets flash banged; you will not be blinded.
And more if you find more ideal things to add, also switching the mode while flash banged will remove the effect from the spectator.
EDIT:
Caption parameter for kill
That way custom kills (weapon = 250) can also, be managed.
EDIT:
The ability to set a NPC's team, so it will either only attack CT's or T's.
edited 5×, last 05.01.21 05:33:53 pm
Killer - Weapon - Victim - Assistors
Example 1:
parse('customkill "1" "pp" "2" "3" "4" "5"')
Example 2:
parse('customkill "1" "pp" "2,3,4,5"')
Hook: itemremove - the opposite of spawn, after hook collect, (...)
Hook: objectspawn - similar to itemspawn
Hook: objectremove - similar to itemremove
=========================================================================
player(0, 'mouse')command to get mouse x,y positions of all players in a single API call. Also same for player's mouse, mousemap, map position, tile map position...
It could do performance boost imho, but SQ told me that returning array could be even slower.
Eg. array of:
1
2
3
4
5
2
3
4
5
{ { id = 1, x = 0, y = 0 }, { id = 2, x = 0, y = 0 }, { id = 32, x = 0, y = 0 }, }
edited 3×, last 25.01.21 11:04:41 am
Gives the disconnected player's ID.
itemremove for instance is covered by itemfadeout and collect. I think the only other way to get rid of items is to remove them manually with commands (you don't need a hook then because you know what you're doing) or round restarts (which remove everything anyway).
@ Mami Tomoe: what do you need that for? leave should basically be exactly that. Only with the advantage that you still can access the player data. The data is however removed instantly afterwards in the very same frame. So if you intend to do cleanup or things alike, leave is the right hook for you.
If you however want to do cleanup - or other things - WITHOUT the removed player being listed (in calls like player(0, "table")), you could use a timer with a time of 0. It should be executed at the end of the same frame when the player data is gone.
I didn't test that though. Maybe it doesn't work like that.
I need it to delete player data from the ID.
Such as:
player_data[id] = nil
But for my case, if the player exists, the script may try to load instead of remove the player data.
(Example: player data was deleted, but a function requests data right after, because the player exists.
The function that will return the data, checks if the player has data, if it doesn't it will check if the player exists, and assume the player is joining, and return the data, but then, the player already left and the data was loaded, causing issues.)
tl;dr: It would be great to have it without using timers.
Mami Tomoe has written
Why not do it inside a leave hook as DC said? Did it many times just like many others, so far no game-breaking issues, or not even minor ones if that matters. It is safe to say a player who has left the server shouldn't be triggering anything anyway. I need it to delete player data from the ID.
Such as:
Such as:
player_data[id] = nil
edited 1×, last 01.02.21 09:58:08 pm
player(p, 'exists')function call, I'd rather load and delete players using hooks and that's how I know if they exist.
My problem comes when a player leaves, they may trigger other hooks (such as drop) and that causes various problems with my method.
Anyways, I'd rather have a proper "delete player" hook, disconnect would be perfect for that.
player_data[id]exists or not. Or if you want to take it one step further, do use metatables and check if the player exists of the specific data whenever the data table is accessed. Thinking about it now, that'd be simply brilliant.