Quote:
Originally Posted by Jochemd
You can't use IsPlayerInRangeOfPoint here, though I couldn't. Here's a nice stock which you can use. I don't know who made it originally, but I got it from Jakku.
pawn Код:
stock Float:GetDistanceToHouseOutside(playerid,houseid) { new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2; GetPlayerPos(playerid,x1,y1,z1); x2 = HouseInfo[houseid][PickupOutsidePosX]; y2 = HouseInfo[houseid][PickupOutsidePosY]; z2 = HouseInfo[houseid][PickupOutsidePosZ]; return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2) + floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2)); }
stock Float:GetDistanceToHouseInside(playerid,houseid) { new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2; GetPlayerPos(playerid,x1,y1,z1); x2 = HouseInfo[houseid][PickupInsidePosX]; y2 = HouseInfo[houseid][PickupInsidePosY]; z2 = HouseInfo[houseid][PickupInsidePosZ]; return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2) + floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2)); }
stock IsNearHouseOutside(playerid) { new Float:Distance; for(new house; house < MAX_HOUSES; house++) { Distance = GetDistanceToHouseOutside(playerid,house); if(Distance < 5.0) { return house; } } return -1; }
stock IsNearHouseInside(playerid) { new Float:Distance; for(new house; house < MAX_HOUSES; house++) { Distance = GetDistanceToHouseInside(playerid,house); if(Distance < 5.0 && GetPlayerVirtualWorld(playerid) == HouseInfo[house][VirtualWorld]) { return house; } } return -1; }
I modified them for my use, I don't have original. Edit this to your version.
|
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(33011) : error 029: invalid expression, assumed zero
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(33011) : warning 221: label name "Float" shadows tag name
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(33011) : error 017: undefined symbol "GetDistanceToHouseOutside"
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(33016) : error 017: undefined symbol "houseid"
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(33017) : error 017: undefined symbol "houseid"
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(3301
: error 017: undefined symbol "houseid"
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(33019) : warning 213: tag mismatch
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(33022) : warning 225: unreachable code
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(33022) : error 029: invalid expression, assumed zero
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(33022) : warning 221: label name "Float" shadows tag name
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(33022) : error 017: undefined symbol "GetDistanceToHouseInside"
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(33027) : error 017: undefined symbol "houseid"
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(3302
: error 017: undefined symbol "houseid"
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(33029) : error 017: undefined symbol "houseid"
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(33030) : warning 213: tag mismatch
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(33033) : warning 225: unreachable code
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(33033) : error 029: invalid expression, assumed zero
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(33033) : error 017: undefined symbol "IsNearHouseOutside"
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(33036) : error 017: undefined symbol "MAX_HOUSES"
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(3303
: error 017: undefined symbol "GetDistanceToHouseOutside"
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(33047) : warning 225: unreachable code
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(33047) : error 029: invalid expression, assumed zero
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(33047) : error 017: undefined symbol "IsNearHouseInside"
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(33050) : error 017: undefined symbol "MAX_HOUSES"
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(33052) : error 017: undefined symbol "GetDistanceToHouseInside"
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(33053) : error 017: undefined symbol "VirtualWorld"
C:\Users\hidden\Desktop\Files\sumthin\DGRP\gamemod es\dgrp.pwn(33011) : warning 203: symbol is never used: "Float"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
19 Errors.