Dynamic House System - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dynamic House System (
/showthread.php?tid=455731)
Dynamic House System -
AfikAtashga - 02.08.2013
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.
Re: Dynamic House System -
Facerafter - 02.08.2013
I don't understand what you are trying to do?
Re: Dynamic House System -
AfikAtashga - 02.08.2013
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"..
Re: Dynamic House System -
Facerafter - 03.08.2013
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.
Re: Dynamic House System -
AfikAtashga - 03.08.2013
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