boom on wrong position -
legodude - 02.02.2010
i have the script like this:
Код:
{
new Float:X;
new Float:Y;
new Float:Z;
GetPlayerPos(playerid, X, Y, Z);
new mine = CreateObject(1213, X, Y, Z, 0, 0, 96);
if (strcmp("/mine", cmdtext, true, 10) == 0)
{
CreateObject(mine, X, Y, Z, 0, 0, 96);
return 1;
}
new Float:mineactiveX;
new Float:mineactiveY;
new Float:mineactiveZ;
GetObjectPos(mine, mineactiveX, mineactiveY, mineactiveZ);
new mineactive = CreateObject(mine, mineactiveX, mineactiveY, mineactiveZ, 0, 0, 96);
if (strcmp("/mineactivate", cmdtext, true, 10) == 0)
{
CreateObject(mineactive, mineactiveX, mineactiveY, mineactiveZ, 0, 0, 96);
{
if(IsPlayerInRangeOfPoint(playerid, 1.0, mineactiveX, mineactiveY, mineactiveZ))
CreateExplosion(mineactiveX, mineactiveY, mineactiveZ, 4, 10.0);
}
return 1;
}
return 0;
}
but when i do /mineactivate it explodes me!!
how to solve that??
Re: boom on wrong position -
legodude - 02.02.2010
bumpa...
Re: boom on wrong position - lameguy - 02.02.2010
pawn Код:
if (strcmp("/mineactivate", cmdtext, true, 10) == 0)
{
CreateObject(mineactive, mineactiveX, mineactiveY, mineactiveZ, 0, 0, 96);
{
if(IsPlayerInRangeOfPoint(playerid, 1.0, mineactiveX, mineactiveY, mineactiveZ))
CreateExplosion(mineactiveX, mineactiveY, mineactiveZ, 4, 10.0);
}
return 1;
}
I really don't see whats the point of that code,
when you type /mineactive, it creates object at your position, and because you are in mineactiveX, mineactiveY, mineactiveZ location at the time of creation of object,
it always explodes you. So could you say what you really want it to do.
For now, it's just one way to do suicide.
Re: boom on wrong position -
legodude - 02.02.2010
its when a player is near the thing where u planted it
then it explodes but it creates it again when you type /mineactivate
Re: boom on wrong position -
legodude - 03.02.2010
bumpa...
Re: boom on wrong position -
legodude - 04.02.2010
bump?
Re: boom on wrong position -
SamAlexSam - 04.02.2010
Give use Coordinates you want it,
Re: boom on wrong position -
legodude - 06.02.2010
Quote:
Originally Posted by SamAlexSam
Give use Coordinates you want it,
|
wtf?
dont get that
the activated mine should be placed on the place of the unactivated mine
Re: boom on wrong position -
¤Adas¤ - 06.02.2010
All the code is wrong, I think...
Re: boom on wrong position - lameguy - 08.02.2010
I got one question:
Do you want it to explode when you type /mineactive, if some player is at same pos as mine,
or like that, that when mine is activated, its like armed mine, (explodes when someone goes on it and no command is needed)