Raised This Month: $ Target: $400
 0% 

Remove a block in a map


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-10-2009 , 08:26   Re: Remove a block in a map
Reply With Quote #1

To keep people from playing a map on a different server you can remove the spawn entities from the downloaded version of the map.
__________________
fysiks is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 04-10-2009 , 09:29   Re: Remove a block in a map
Reply With Quote #2

Or you could make the map with a solid block like you said on the spawn points and set it to a func_wall entity and give it a name, then in an ammx plugin search for those entites and remove them... easy...

but, for experienced mappers and/or scripters other people can remove that block too... they can get the name of the block and all that :}
__________________
Hunter-Digital is offline
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 04-10-2009 , 09:49   Re: Remove a block in a map
Reply With Quote #3

Yea but can atleast try
Do you know how to do it? and if so could you show me the code with maybe small notes to understand?
micke1101 is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 04-10-2009 , 11:28   Re: Remove a block in a map
Reply With Quote #4

You know how to do the map ?

As for the code...
PHP Code:
#include <amxmodx>
#include <engine>
 
#define SECURENAME "map_block_name"
 
// ...
 
public plugin_precache()
{
         new 
ententName[32]
 
         while((
ent find_ent_by_class(ent"func_wall")) != 0// search through all func_wall entities
         
{
                  
pev(entpev_targetnameentName31// get it's name
 
                  
if(!equal(entNameSECURENAME)) // if it's not your block name, continue to the next one
                           
continue
 
                  
remove_entity(ent// if it is, remove it...
         
}

Don't really know if this works but it's a starting point
__________________
Hunter-Digital is offline
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 04-10-2009 , 11:48   Re: Remove a block in a map
Reply With Quote #5

Yes i know how to do the map
But it didnt compile at least not in the webcompiler

Last edited by micke1101; 04-10-2009 at 12:04.
micke1101 is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 04-10-2009 , 12:46   Re: Remove a block in a map
Reply With Quote #6

compile it locally and see what errors it returns...

also add plugin_init() ...
__________________
Hunter-Digital is offline
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 04-10-2009 , 13:37   Re: Remove a block in a map
Reply With Quote #7

Code:
#include <amxmodx>
#include <engine>
 
#define SECURENAME "copyright_block"

public plugin_init()
{
    register_plugin("moon_base_copyright","1.0","Hunter-Digital")
}
public plugin_precache()
{
         new ent, entName[32]
 
         while((ent = find_ent_by_class(ent, "func_wall")) != 0) // search through all func_wall entities
         {
                  pev(ent, pev_targetname, entName, 31) // get it's name
 
                  if(!equal(entName, SECURENAME)) // if it's not your block name, continue to the next one
                           continue
 
                  remove_entity(ent) // if it is, remove it...
         }
}
Quote:
Originally Posted by compiler
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/home/groups/amxmodx/tmp3/textwrxxcu.sma(16) : error 017: undefined symbol "pev"
/home/groups/amxmodx/tmp3/textwrxxcu.sma(16) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/textwrxxcu.sma(16) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/textwrxxcu.sma(16) : error 001: expected token: ";", but found ")"
/home/groups/amxmodx/tmp3/textwrxxcu.sma(16) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/textwrxxcu.sma(16) : fatal error 107: too many error messages on one line

Compilation aborted.
4 Errors.
micke1101 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 02:16.


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