Luigi Auriemma

aluigi.org (ARCHIVE-ONLY FORUM!)
It is currently 19 Jul 2012 11:53

All times are UTC [ DST ]





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Writing server-side plugins for srcds
PostPosted: 10 Jan 2010 16:48 

Joined: 22 Sep 2009 17:46
Posts: 25
Hello folks,

I have to make one plugin with a simply function of removing Entity (yeah plugin, don't ask why), so far it looks like that:

Quote:
...
int entityID = atoi(engine->Cmd_Argv(1));
edict_t *pEntity = engine->PEntityOfEntIndex(entityID);
char parname[7];
memcpy(parname,pEntity->GetClassName(),7);
bool issame = strcmp(parname,"weapon_") == 0;

if(issame){ //we've got weapon so lets remove it
engine->RemoveEdict(pEntity);
Msg("tried to remove entity\n");
}
...


Is it good? I mean I didn't test it yet (can't now), but I hope it will work.


Top
 Profile  
 
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for: