This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

ForceEdictIndex


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nail
BANNED
Join Date: May 2008
Location: PetrovЪ GradЪ
Old 06-23-2011 , 13:58   ForceEdictIndex
Reply With Quote #1

native CreateEntityByName(const String:classname[], ForceEdictIndex=-1);

http://docs.sourcemod.net/api/index....ad=show&id=45&

Default value:
ForceEdictIndex = -1
I do not quite understand what it means.
I think if the "-1" then the index is not reserved for creating entity. And if the later will create another entity, it assigns itself this index. Thus I can no longer refer to the first entity. When I use the index I will refer to the second entity.
Am I right?

Why when I specify "1" my server always crashes?
new iEnt = CreateEntityByName("prop_dynamic", 1);

Last edited by Nail; 06-23-2011 at 14:47.
Nail is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 06-23-2011 , 15:15   Re: ForceEdictIndex
Reply With Quote #2

If you specify an index that is already in use by another entity the server will crash.

I don't recommend to use it anyway, leave it as -1.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
Nail
BANNED
Join Date: May 2008
Location: PetrovЪ GradЪ
Old 06-23-2011 , 15:22   Re: ForceEdictIndex
Reply With Quote #3

How can I book this index?. For me it is very important that the other entity could not use it later. If another entity appears on the server later, the server is terrible.... I can not destroy and control the creation earlier entityes. I can't even put out a burning players

Last edited by Nail; 06-23-2011 at 15:27.
Nail is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 06-23-2011 , 15:25   Re: ForceEdictIndex
Reply With Quote #4

You can't book it, you can only create an entity with this index, if there is an entity using this index, other entities can't use it.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
Nail
BANNED
Join Date: May 2008
Location: PetrovЪ GradЪ
Old 06-23-2011 , 15:30   Re: ForceEdictIndex
Reply With Quote #5

Is it possible to change the index for the entity?
Why when create a new entity, it is assigned is already used index? Is it possible to block?
How can I regain control entity if it has lost its index? Hook_SetTransmit not working when index gets another entity... and nothing works

Last edited by Nail; 06-23-2011 at 15:40.
Nail is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 06-23-2011 , 15:42   Re: ForceEdictIndex
Reply With Quote #6

It's not possible.

An other entity can't takeover the index. It's more likely that your entity gets killed before. Why are you hazzling around with entity indexes anyway ? What are you trying to achieve ?
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
Nail
BANNED
Join Date: May 2008
Location: PetrovЪ GradЪ
Old 06-23-2011 , 15:54   Re: ForceEdictIndex
Reply With Quote #7

Okay I will describe the situation in more detail. At round start I create entity (prop_dynamic). I can do with it what I want. But if the game later joins the player. I see that this entity index is not prop_dynamic, this is weapon_knife.
But where is my prop_dynamic? I see him in the game, but I can not destroy it when I need it.
There are ways to solve this problem?
I tried to block the player spawn after round start. It did not work because in the game later spawn other entityes (The player has bought weapons)

A similar problem:
http://forums.alliedmods.net/showthr...ty+index+issue

Last edited by Nail; 06-23-2011 at 16:05.
Nail is offline
lokizito
Veteran Member
Join Date: Dec 2010
Location: Brazil
Old 06-23-2011 , 16:04   Re: ForceEdictIndex
Reply With Quote #8

What you can do is create an entity with the index you want. Then, when you need it, remove the other entity and create the needed on with the index used before.
It maybe works, don't know.
__________________
[CS:S] RankMe - Why pay for a rank plugin if you can have one for free?
[CS:S] RankMe Connect Announcer - Announce when a player connect
Translation Project - Let's make the plugins to be international
lokizito is offline
Nail
BANNED
Join Date: May 2008
Location: PetrovЪ GradЪ
Old 06-23-2011 , 16:16   Re: ForceEdictIndex
Reply With Quote #9

How is it possible to do?
Nail is offline
lokizito
Veteran Member
Join Date: Dec 2010
Location: Brazil
Old 06-23-2011 , 16:18   Re: ForceEdictIndex
Reply With Quote #10

The same way you create the prop_dynamic. Also, you should use higher values of the edict index. Since most probably there will be nothing.
Do you save the index of the created entity? If not, do it and hook that entity every time is created (every round).
__________________
[CS:S] RankMe - Why pay for a rank plugin if you can have one for free?
[CS:S] RankMe Connect Announcer - Announce when a player connect
Translation Project - Let's make the plugins to be international
lokizito is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:40.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode