12.08.2014, 22:10
Hello.
I'm making bomber system, all work good but when i press bomb 3-4 times 1 bomb explode, on other i just see objects. Didn't explode..
I'm making bomber system, all work good but when i press bomb 3-4 times 1 bomb explode, on other i just see objects. Didn't explode..
Код:
new Rocket[ MAX_PLAYERS ]; // The Rocket
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if( newkeys == KEY_YES ) { new Float:x, Float:y, Float:z, vehicleid, Float:Angle; GetPlayerPos( playerid, x, y, z ); vehicleid = GetPlayerVehicleID(playerid); GetVehicleZAngle(vehicleid, Angle); Rocket[playerid] = CreateObject(354, x, y, z-3.0, 0, 0, Angle+90); z = 0.0; GetPointZPos( x, y, z ); MoveObject(Rocket[playerid], x, y, z, 32.0 ); } return 1; }
Код:
public OnObjectMoved(objectid) { new playerid; new Float:x, Float:y, Float:z; GetObjectPos( Rocket[playerid], x, y, z ); CreateExplosion( x, y, z, 4, 40 ); DestroyObject( Rocket[playerid] ); return 1; }