SA-MP Forums Archive
putting isplayerinrange with this? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: putting isplayerinrange with this? (/showthread.php?tid=177919)



putting isplayerinrange with this? - WillyP - 19.09.2010

okay so i got this:
pawn Код:
//more code  
  if(IsAttached[i] == true)
                {
                    if(GetPlayerVehicleID(playerid) == i)
                    {
                        new i2 = GetPlayerVehicleID(playerid);
                        (VehCameraPos[i2][0]+(VehVectorPos[i2][0] * Dist),VehCameraPos[i2][1]+(VehVectorPos[i2][1] * Dist),VehCameraPos[i2][2]+(VehVectorPos[i2][2] * Dist),7,100);
                        new Float:armour, Float:newarmour;
                        GetPlayerArmour(i,armour);
                        if(armour > 0){
                        newarmour = armour - -5;
                        SetPlayerArmour(i,newarmour);
                                                //more code
but i get this warning

Quote:

C:\Documents and Settings\Will\Desktop\DeathRace0.3b\filterscripts\ minigun2.pwn(7 : warning 215: expression has no effect
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.

on this line

pawn Код:
(VehCameraPos[i2][0]+(VehVectorPos[i2][0] * Dist),VehCameraPos[i2][1]+(VehVectorPos[i2][1] * Dist),VehCameraPos[i2][2]+(VehVectorPos[i2][2] * Dist),7,100);
but i was wondering if you could add isplayerinrangeofpoint with a object that was created?


Re: putting isplayerinrange with this? - [XST]O_x - 19.09.2010

Should be something like:
pawn Код:
if(IsPlayerInRangeOfPoint(i,RANGE,VehCameraPos[i2][0]+(VehVectorPos[i2][0] * Dist),VehvCameraPos[i2][1]+(VehVectorPos[i2][1] * Dist),VehCameraPos[i2][2]+(VehVectorPos[i2][2]*Dist)))
Is that from my tankveh code? xD


Re: putting isplayerinrange with this? - WillyP - 19.09.2010

Quote:
Originally Posted by [XST]O_x
Посмотреть сообщение
Should be something like:
pawn Код:
if(IsPlayerInRangeOfPoint(i,RANGE,VehCameraPos[i2][0]+(VehVectorPos[i2][0] * Dist),VehvCameraPos[i2][1]+(VehVectorPos[i2][1] * Dist),VehCameraPos[i2][2]+(VehVectorPos[i2][2]*Dist))
Is that from my tankveh code? xD
yes, yes it is xD

edit

Quote:

C:\Documents and Settings\Will\Desktop\DeathRace0.3b\filterscripts\ minigun2.pwn(7 : error 017: undefined symbol "RANGE"
C:\Documents and Settings\Will\Desktop\DeathRace0.3b\filterscripts\ minigun2.pwn(7 : warning 215: expression has no effect
C:\Documents and Settings\Will\Desktop\DeathRace0.3b\filterscripts\ minigun2.pwn(7 : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Will\Desktop\DeathRace0.3b\filterscripts\ minigun2.pwn(7 : error 029: invalid expression, assumed zero
C:\Documents and Settings\Will\Desktop\DeathRace0.3b\filterscripts\ minigun2.pwn(7 : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.




Re: putting isplayerinrange with this? - Vince - 19.09.2010

Where does this script come from? Because I know I have commented lately on a thread which addressed exactly the same problem ..


Re: putting isplayerinrange with this? - WillyP - 19.09.2010

Quote:
Originally Posted by Vince
Посмотреть сообщение
Where does this script come from? Because I know I have commented lately on a thread which addressed exactly the same problem ..
https://sampforum.blast.hk/showthread.php?tid=174082

but mines uber edited


Re: putting isplayerinrange with this? - [XST]O_x - 19.09.2010

Quote:
Originally Posted by [FU]Victious
Посмотреть сообщение
yes, yes it is xD

edit

STUFF
Yes I've edited my code I missed a bracket on the end.
Recopy it!

And RANGE is the range you specify.. 8.0 for example.


Re: putting isplayerinrange with this? - WillyP - 19.09.2010

Quote:
Originally Posted by [XST]O_x
Посмотреть сообщение
Yes I've edited my code I missed a bracket on the end.
Recopy it!

And RANGE is the range you specify.. 8.0 for example.
yeah, i thought it was distance xD

anyway:

Quote:

C:\Documents and Settings\Will\Desktop\DeathRace0.3b\filterscripts\ minigun2.pwn(7 : error 017: undefined symbol "VehvCameraPos"
C:\Documents and Settings\Will\Desktop\DeathRace0.3b\filterscripts\ minigun2.pwn(7 : warning 215: expression has no effect
C:\Documents and Settings\Will\Desktop\DeathRace0.3b\filterscripts\ minigun2.pwn(7 : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Will\Desktop\DeathRace0.3b\filterscripts\ minigun2.pwn(7 : error 029: invalid expression, assumed zero
C:\Documents and Settings\Will\Desktop\DeathRace0.3b\filterscripts\ minigun2.pwn(7 : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.




Re: putting isplayerinrange with this? - [XST]O_x - 19.09.2010

pawn Код:
if(IsPlayerInRangeOfPoint(i,RANGE,VehCameraPos[i2][0]+(VehVectorPos[i2][0] * Dist),VehCameraPos[i2][1]+(VehVectorPos[i2][1] * Dist),VehCameraPos[i2][2]+(VehVectorPos[i2][2]*Dist)))
Misspelled Veh as Vehv..


Re: putting isplayerinrange with this? - WillyP - 19.09.2010

Quote:
Originally Posted by [XST]O_x
Посмотреть сообщение
pawn Код:
if(IsPlayerInRangeOfPoint(i,RANGE,VehCameraPos[i2][0]+(VehVectorPos[i2][0] * Dist),VehCameraPos[i2][1]+(VehVectorPos[i2][1] * Dist),VehCameraPos[i2][2]+(VehVectorPos[i2][2]*Dist)))
Misspelled Veh as Vehv..
yeah, i tried that before, now i get 7 errors about the stuff underneath it isnt defined


EDITTTT FIXED!!!!!