23.08.2011, 08:41
Good morning.
I have a small explosive boxes system is too complicated to explain.
Basically, a player can make a small box (1 X 1) explosive (an explosive player when he passes on).
(my GM is a bit special ^ ^ ")
So I have a command that opens a menu with the second choice (listitem 1) is to make an explosive box.
The problem is that when going on an explosive box, all is well. But if I make an explosive case here, when I make another explosive, it explodes immediately (without delay of 10 seconds) and it will explode quite a few times (every 200ms, I have several times the message of timer, it is repeated, then, the most bizare is that the message was in the condition of IsPlayerInRectangle, while the blast us out ...).
I wish it were possible to make explosives as many boxes as you want, but they explode many times in a row!
Thank you!
I have a small explosive boxes system is too complicated to explain.
Basically, a player can make a small box (1 X 1) explosive (an explosive player when he passes on).
(my GM is a bit special ^ ^ ")
So I have a command that opens a menu with the second choice (listitem 1) is to make an explosive box.
The problem is that when going on an explosive box, all is well. But if I make an explosive case here, when I make another explosive, it explodes immediately (without delay of 10 seconds) and it will explode quite a few times (every 200ms, I have several times the message of timer, it is repeated, then, the most bizare is that the message was in the condition of IsPlayerInRectangle, while the blast us out ...).
Code:
// Top new Npowers = 0, Float:powersX[1000], Float:powersY[1000], Float:powersZ[1000], powersT[1000]; forward ActiveCheck(w); forward DestroyCheck(w); // OnDialogResponse if(listitem == 1) { new query[400], pName[126], req[20], dialog[400], nPowers; GetPlayerName(playerid, pName, 126); format(query, 400, "SELECT powers FROM `members_powers` WHERE pseudo = '%s'", pName); mysql_query(query); mysql_store_result(); if(mysql_num_rows() == 1) { while(mysql_fetch_row_format(query,"|")) { mysql_fetch_field_row(req, "powers"); nPowers = strval(req); } if(nMine > 0) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); Npowers++; powersX[Npowers] = x; powersY[Npowers] = y; powersZ[Npowers] = z; SendClientMessage(playerid, SUCCESS, "The box will be explosive in 10 seconds. Go to the hotel box!"); SetTimerEx("ActiveCheck", 1000*10, false, "i", Npowers); } else { // I display my menu } } else { SendClientMessage(playerid, ERROR, "Error..."); } mysql_free_result(); } // Bottom public ActiveCheck(w) { powersT[Npowers] = SetTimerEx("DestroyCheck", 200, true, "i", w); return 1; } public DestroyCheck(w) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(IsPlayerInRectangle(i, powersX[Npowers] - 2, powersY[Npowers] - 2, powersX[Npowers] + 2, powersY[Npowers] + 2)) { new Float:x, Float:y, Float:z; GetPlayerPos(i, x, y, z); if(z < powersZ[Npowers] + 5) { if(IsPlayerInAnyVehicle(i)) SetVehicleHealth(GetPlayerVehicleID(i), 300.0); SetPlayerHealth(i, 25.0); CreateExplosion(powersX[Npowers], powersY[Npowers], powersZ[Npowers] - 0.5, 2, 100); CreateExplosion(powersX[Npowers], powersY[Npowers], powersZ[Npowers] - 3, 7, 150); SendClientMessage(i, INFO, "You went on a square explosive ... The challenge will begin !"); KillTimer(powersT[Npowers]); } } } } return 1; }
Thank you!