03.01.2015, 19:23
Hi!
I created a simple mine system pretty long ago..
But I didn't found any solution to avoid blowing up myself when placing it..
I have tried with that "anti blow up thing"
As shown in the script. But it didn't helped.
I have thouht that I can use a timer too but then when someone steps on it, it will not blow up
directly(?).
Antother thing I have thinking about (It's a kinda TDM GM)
When somone steps on it, it will check the players color and then compare it to the player who steps on it.
If they're equal to each other, they're in same team and will not blow up.
If it's not equal to each other (emeny and and player) the player will blow up (who stepped on it)
Or compare it with some teams. But I'm not fully sure how to do this..
I just know abit of it.
Can someone show a small example?.
Thanks alot!
I created a simple mine system pretty long ago..
But I didn't found any solution to avoid blowing up myself when placing it..
pawn Код:
#define FILTERSCRIPT
#include <a_samp>
#if defined FILTERSCRIPT
new Float:X,Float:Y,Float:Z;
forward bombS(playerid); //Bomb safe so you not blowing up when you plant it.
new atb[MAX_PLAYERS]; //Anti blow up
#define Blue 0x631BE0FF
#define Green 0x29D419FF
public OnFilterScriptInit()
{
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
#endif
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mine", cmdtext, true, 4) == 0)
{
GetPlayerPos(playerid, X, Y, Z);
if(IsPlayerInRangeOfPoint(playerid, 3.0, X, Y, Z))
CreateObject(1006, X, Y, Z,Float:X, Float:Y, Float:Z);
if(atb[playerid] == 1)
{
SetTimerEx("bombS",9000,0,"i",playerid);
atb[playerid]=0; //Anti blow up
CreateExplosion(X, Y, Z, 10, 20.0);
}
return 1;
}
return 0;
}
public bombS(playerid)
{
atb[playerid]=1;
SendClientMessage(playerid, Green, "Your bomb is ready!");
}
As shown in the script. But it didn't helped.
I have thouht that I can use a timer too but then when someone steps on it, it will not blow up
directly(?).
Antother thing I have thinking about (It's a kinda TDM GM)
When somone steps on it, it will check the players color and then compare it to the player who steps on it.
If they're equal to each other, they're in same team and will not blow up.
If it's not equal to each other (emeny and and player) the player will blow up (who stepped on it)
Or compare it with some teams. But I'm not fully sure how to do this..
I just know abit of it.
Can someone show a small example?.
Thanks alot!