Dynamic House System
#1

First, sorry about my English.
I got problem with my dynamic house system.
I build everything. Player commands, Admin commands, but i got problem, how to take a pickup, and make him a house.
I did this.
OnPlayerPickUpPickup:
Код:
	for(new i; i < MAX_HOUSES; i++) if(pickupid == house[i][hpickup])
{
	player[playerid][whouseid] = i;
}
Works fine.
But when i leave pickup it's not changed.
So i did this:
OnPlayerUpdate:
Код:
new uid = player[playerid][whouseid];
if(uid != -1 && !IsPlayerInRangeOfPoint(playerid, 2, house[uid][outpos][0], house[uid][outpos][1], house[uid][outpos][2]))
{
	player[playerid][whouseid] = -1;
}
Can someone help me? please.
Reply
#2

I don't understand what you are trying to do?
Reply
#3

Quote:
Originally Posted by Facerafter
Посмотреть сообщение
I don't understand what you are trying to do?
I'm tring to connect the house to the pickup.
When player enter pickup - the variable will be the houseid, it's work.
But i don't know how to do something like "OnPlayerLeavePickup"..
Reply
#4

Maybe something like this?
pawn Код:
new Float:x, Float:y , Float:z;
GetPlayerPos(playerid,x,y,z);
    x -= house[uid][outpos][0];
    y -= house[uid][outpos][1];
    z -= house[uid][outpos][2];
    if(x > 4 || x < -4 || y > 4 || y < -4);
Im not 100% sure it will work. But its worth a shot.
Reply
#5

Quote:
Originally Posted by Facerafter
Посмотреть сообщение
Maybe something like this?
pawn Код:
new Float:x, Float:y , Float:z;
GetPlayerPos(playerid,x,y,z);
    x -= house[uid][outpos][0];
    y -= house[uid][outpos][1];
    z -= house[uid][outpos][2];
    if(x > 4 || x < -4 || y > 4 || y < -4);
Im not 100% sure it will work. But its worth a shot.
Thanks guy! it's work fine, just what i need is to play with the numbers, because the area is too big
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)