13.02.2015, 16:10
(
Последний раз редактировалось Maximus0; 13.02.2015 в 18:00.
)
OnPlayerShotTeamVeh
IntroductionThis include can check if a player is shooting his team mate's vehicle. Easy and simple but will be useful in RP servers.
Functions
Код:
forward OnPlayerShotTeamVeh(playerid, targetid, weaponid, vehid);
On many RP servers, you don't want a player to shoot his team player's tire/vehicle. On that case you can return 0 to apply no effect.
Example code
pawn Код:
public OnPlayerShotTeamVeh(playerid, targetid, weaponid, vehid)
{
new String[400];
new name[MAX_PLAYER_NAME];
new tname[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(playerid, tname, sizeof(tname));
format(String, sizeof( String ), "%s has shoted %s who is in vehicleid %i with weaponid %i", name, tname, vehid, weaponid);
SendClientMessageToAll(0xFF0000FF, String);
}
pawn Код:
public OnPlayerShotTeamVeh(playerid, targetid, weaponid, vehid)
{
new vehicle;
new Float:health;
vehicle = GetPlayerVehicleID(targetid);
GetVehicleHealth(vehicle, health);
SetVehicleHealth(vehicle, health);
}
Maximus
MediaFire
PasteBin