19.08.2015, 23:18
Howdy! I'm having a problem with my shooting system and was wondering how I can fix it. Anytime I shoot an object that is not "TrainTarget[0]", It still gives me the message, although I only want it to give me the message when I hit "TrainTarget[0]". Any idea what might be causing this? Thank you!
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid)
{
if(hittype == BULLET_HIT_TYPE_OBJECT)
{
if(IsValidObject(TrainTarget[0]))
{
PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
GameTextForPlayer(playerid, "~g~Nice!" , 1000, 6);
DestroyObject( TrainTarget[0] );
}
}
return 1;
}