Author |
Message |
tec27 Newbie
Joined: Feb 01 2003 Posts: 13 Offline
|
Posted: Sat Feb 01, 2003 9:25 pm Post subject: Player Position Detection |
|
|
|
|
I'm using mervbot and I was trying to figure out how to make it so that every time a there was a player in a square area on the map, it would start a timer. Any ideas on how to do it? |
|
Back to top |
|
|
SOS Server Help Squatter
Joined: Dec 02 2002 Posts: 329 Offline
|
Posted: Sun Feb 02, 2003 4:31 am Post subject: |
|
|
|
|
EVENT_PlayerMove
Check player's position there (p->tile.x and p->tile.y) _________________ 3y3 4m l33t h4x0r
j0! 3y3 4m t4lking to j00!
fux0red 5cr1pt k1dd13.
-"l33t h41ku" |
|
Back to top |
|
|
k0zy Server Help Squatter
Gender: Joined: Jan 11 2003 Posts: 571 Location: Germany Offline
|
|
Back to top |
|
|
tec27 Newbie
Joined: Feb 01 2003 Posts: 13 Offline
|
Posted: Mon Feb 03, 2003 7:22 am Post subject: |
|
|
|
|
thanks, both of you, it was very helpful. |
|
Back to top |
|
|
ExplodyThingy Server Help Squatter
Age:37 Gender: Joined: Dec 15 2002 Posts: 528 Location: Washington DC Offline
|
Posted: Tue Feb 04, 2003 12:21 pm Post subject: |
|
|
|
|
Can you make it so that a player can only send a command within a block of tiles? It seems to ignore it in a rectanle, but works on a specific tile. (both are within the player level command case in commands.cpp
work:
if ((p->tile.x == 512) && (p->tile.y == 512))
{
if(c->check("command")
{
sendPrivate(p,"command recieved");
}
} |
No work:
if ( ((p->tile.x >> 510) && (p->tile.y >> 510)) && ((p->tile.x << 514) && (p->tile.y << 514)) )
{
if(c->check("command")
{
sendPrivate(p,"command recieved");
}
} |
This isnt cut-and-paste, so ignore missing ";" and such junk. _________________ There are no stupid question, but there are many inquisitive idiots.
Loot
Dr Brain> I hate clean air and clean water. I'm a member of Evil Conservitive Industries |
|
Back to top |
|
|
k0zy Server Help Squatter
Gender: Joined: Jan 11 2003 Posts: 571 Location: Germany Offline
|
Posted: Tue Feb 04, 2003 12:59 pm Post subject: |
|
|
|
|
Its simply "<", and not "<<"...
Try that
Bob Dole.. Bob Dole... Bob Dole...... bob dole.... bob... dole.... |
|
Back to top |
|
|
SOS Server Help Squatter
Joined: Dec 02 2002 Posts: 329 Offline
|
Posted: Tue Feb 04, 2003 2:22 pm Post subject: |
|
|
|
|
Haha |
|
Back to top |
|
|
Mine GO BOOM Hunch Hunch What What
Age:40 Gender: Joined: Aug 01 2002 Posts: 3614 Location: Las Vegas Offline
|
|
Back to top |
|
|
ExplodyThingy Server Help Squatter
Age:37 Gender: Joined: Dec 15 2002 Posts: 528 Location: Washington DC Offline
|
Posted: Tue Feb 04, 2003 2:58 pm Post subject: |
|
|
|
|
Yes, yes, thank you. I got myself tripped up on == and >= and somehow i carried it over to >>. |
|
Back to top |
|
|
|