17.10.2010, 17:07
So i made this suicide bomber system, works like a charm.But then when i used the same structure to make a car bombb it didnt turn out so good:
That is my Car Bomb timer and this is the cmd (also works for the onfoot):
Help pl0x
pawn Код:
public CarBomb(playerid, vehicleid)
{
new Float: Pos[3];
new pname[246];
GetPlayerName(playerid, pname, sizeof(pname));
GetVehiclePos(vehicleid, Pos[0], Pos[1], Pos[2]);
CreateLoopingExplosion(Pos[0], Pos[1], Pos[2], 6, 60.0, 5);
SendClientMessageToAll(COLOR_RED, "lol");
return 1;
}
pawn Код:
if (strcmp("/explode", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new pname[245];
SetTimer("CarBomb", 5000, false);
format(pname, sizeof(pname),"%s Detonated a Car bomb!", pname);
SendClientMessageToAll(COLOR_RED, pname);
return 1;
}
else
{
new Float: Pos[3];
new pname[246];
GetPlayerName(playerid, pname, sizeof(pname));
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
CreateLoopingExplosion(Pos[0], Pos[1], Pos[2], 6, 60.0, 5);
format(pname, sizeof(pname),"%s Exploded himself (Suicide Bomber)", pname);
SendClientMessageToAll(COLOR_RED, pname);
}
return 1;
}