02.11.2014, 20:50
Some things are useless tho. The timer, ShotFire, for example isn't needed because you can do this:
Or even better .. You don't need "FireShot". All what you need to check is if the object of the player exists. One less variable then If the player fired the laser, then the object is valid right ?
So you could delete these lines:
... and it should still work.
pawn Code:
public OnObjectMoved(objectid)
{
for(new i;i<MAX_PLAYERS;i++)
{
if(objectid == gRocketObj[i])
{
new
Float:x,
Float:y,
Float:z;
GetObjectPos(gRocketObj[i], x, y, z);
CreateExplosion(x, y, z, 11, 3.0);
DestroyObject(gRocketObj[i]);
FireShot[i] = 0;
}
}
}
So you could delete these lines:
pawn Code:
new FireShot[MAX_PLAYERS];
FireShot[playerid] = 1;
SetTimerEx("ShotFire", 1000, 0, "i", playerid);
forward ShotFire(playerid);
public ShotFire(playerid)
{
FireShot[playerid] = 0;
return 1;
}