boom on wrong position
#1


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??
Reply
#2

bumpa...
Reply
#3

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.
Reply
#4

its when a player is near the thing where u planted it
then it explodes but it creates it again when you type /mineactivate
Reply
#5

bumpa...
Reply
#6

bump?
Reply
#7

Give use Coordinates you want it,
Reply
#8

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
Reply
#9

All the code is wrong, I think...
Reply
#10

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)
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)