Raised This Month: $32 Target: $400
 8% 

Create a room?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Simba
Junior Member
Join Date: Dec 2010
Old 07-27-2011 , 16:41   Create a room?
Reply With Quote #1

How can I create a "room" at the given x/y/z coordinates with a fixed size to which I can teleport players (for a knife duel)?
Simba is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 07-28-2011 , 02:16   Re: Create a room?
Reply With Quote #2

It's not exactly a very realistic idea. I doubt anyone would want to make the models for each wall.
Perhaps you could try taking a look at the knife duel plugin and change the opponent distance check to check the distance from where you and your opponent started, so effectively you'd have an invisible wall around the players.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Simba
Junior Member
Join Date: Dec 2010
Old 07-28-2011 , 07:38  
Reply With Quote #3

Well I just want to make simple walls with one color or a transparent box. I've been searching the forums and found this (edited a little):
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>

public plugin_init() {
    
register_clcmd("create""create")
}

public 
create(id) {
new 
sx[8], sy[8], sz[8]
new 
Float:origin[3]
read_argv(1,sx,7)
read_argv(2,sy,7)
read_argv(3,sz,7)
origin[0] = str_to_float(sx)
origin[1] = str_to_float(sy)
origin[2] = str_to_float(sz)
new 
ent create_entity("info_target");
entity_set_string(entEV_SZ_classname"safebox_blue");
entity_set_int(entEV_INT_solidSOLID_BBOX);
entity_set_int(entEV_INT_movetypeMOVETYPE_FLY);
entity_set_origin(entorigin);

new 
Float:mins[3] = {-255.0, -115.0, -71.0}
new 
Float:maxs[3] = {255.0115.071.0}

entity_set_size(entminsmaxs);

mins[0] = origin[0] - 255.0;
mins[1] = origin[1] - 115.0;
mins[2] = origin[2] - 71.0;

maxs[0] = origin[0] + 255.0;
maxs[1] = origin[1] + 115.0;
maxs[2] = origin[2] + 71.0;

message_begin(MSG_BROADCASTSVC_TEMPENTITY);
write_byte(TE_BOX);
write_coord(floatround(mins[0])); // boxmins
write_coord(floatround(mins[1]));
write_coord(floatround(mins[2]));
write_coord(floatround(maxs[0])); // boxmaxs
write_coord(floatround(maxs[1]));
write_coord(floatround(maxs[2]));
write_short(999999); // life in 0.1 s
write_byte(255); // r
write_byte(0); // g
write_byte(0); // b
message_end();

It creates a box with no walls, only the edges:



But the server crashes when I touch it or shoot at it.
Simba is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 07-28-2011 , 08:05   Re: Create a room?
Reply With Quote #4

Quote:
Originally Posted by Simba View Post
But the server crashes when I touch it or shoot at it.
Show us the think forward for the entity.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Simba
Junior Member
Join Date: Dec 2010
Old 07-28-2011 , 08:20   Re: Create a room?
Reply With Quote #5

There isn't any. That is the whole code.
Simba is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 07-28-2011 , 09:25   Re: Create a room?
Reply With Quote #6

There is two ways to do this. You can make one entity which you let only the two players to get inside ( it is solid for others ) or make solid entities for each wall. The question is do you want the knife fighting players to be able to leave the room and do you want that everyone sees the room walls? I would like to see some real models and solid walls, but it is you who needs to get the model.
SnoW is offline
Send a message via MSN to SnoW
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-28-2011 , 10:05   Re: Create a room?
Reply With Quote #7

Your code will only create a solid box, not 6 walls where players can run inside.
You should give the entity a model as well.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Simba
Junior Member
Join Date: Dec 2010
Old 07-28-2011 , 10:34  
Reply With Quote #8

Quote:
Originally Posted by Exolent[jNr] View Post
Your code will only create a solid box, not 6 walls where players can run inside.
You should give the entity a model as well.
How can I make an empty box? Is making 6 separate walls the only way to do it? And why does my code crash the server?
Simba is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-28-2011 , 10:35   Re: Create a room?
Reply With Quote #9

Quote:
Originally Posted by Simba View Post
How can I make an empty box? Is making 6 separate walls the only way to do it? And why does my code crash the server?
You have to use 6 separate walls since hollow entities aren't possible.

Your code crashes the server most likely because there is no model.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 08:27.


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