31.12.2014, 12:26
PHP код:
#include <a_samp>
new TrainingObj[MAX_PLAYERS];
#define DIALOG_ID_TRAINING (20)
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(IsValidPlayerObject(playerid, TrainingObj[playerid]))
DestroyPlayerObject(playerid, TrainingObj[playerid]);
return 1;
}
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(weaponid == WEAPON_SNIPER && hittype == BULLET_HIT_TYPE_OBJECT && hitid == TrainingObj[playerid])
{
DestroyPlayerObject(playerid, TrainingObj[playerid]);
TrainingObj[playerid] = CreatePlayerObject(playerid, 902, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 200.0); // Then I will set random positions
}
return 1;
}