#include <ADM/3DTryg>
#include <Stingers>
CreateDynamicStinger(type,Float:x,Float:y,Float:z,Float:rx,Float:ty,Float:rz,worldid=-1,interiorid=-1,playerid=-1,Float:streamdistance=100.0,teamid=ANY_TEAM,byplayerid=INVALID_PLAYER_ID);
DestroyDynamicStinger(mobid);
bool:IsDynamicStingerActive(mobid);
GetDynamicStingerObjectID(mobid);
GetDynamicStingerTeam(mobid);
SetDynamicStingerTeam(mobid,teamid);
GetDynamicStingerPlayerID(mobid);
SetDynamicStingerPlayerID(mobid,byplayerid);
GetPlayerActiveDynamicStinger(playerid);
ToggleDynamicStingerDamage(mobid,bool:toggle);
//called on vehicle damage updated by stinger
OnVehicleDamageByStinger(playerid,killerid,mobid,old_tires,new_tires);
STINGER_TYPE_SMALL //Object: 2899
STINGER_TYPE_BIG //Object: 2892
public OnVehicleDamageByStinger(playerid,killerid,mobid,old_tires,new_tires){
if(killerid != INVALID_PLAYER_ID){
new p_name[MAX_PLAYER_NAME],string[144];
GetPlayerName(killerid,p_name,sizeof(p_name));
format(string,sizeof(string),"{00AAFF}Your vehicle has been damaged by {00FF00}%s {00AAFF}stinger.",p_name);
SendClientMessage(playerid,-1,string);
}
return 1;
}
new StingerObj[MAX_PLAYERS];
public OnPlayerDisconnect(playerid,reason){
if(StingerObj[playerid] != 0){
DestroyDynamicStinger(StingerObj[playerid]);
StingerObj[playerid] = 0;
}
return 1;
}
CMD:stinger(playerid,params[]){
if(!strcmp(params,"destroy",true)){
DestroyDynamicStinger(StingerObj[playerid]);
StingerObj[playerid] = 0;
return SendClientMessage(playerid,-1,"Stinger Destroyed");
}
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,-1,"First get out of the vehicle");
if(GetPlayerActiveDynamicStinger(playerid)) return SendClientMessage(playerid,-1,"You are near another stinger");
new type;
if(!strcmp(params,"big",true)){
type = STINGER_TYPE_BIG;
} else if(!strcmp(params,"small",true)){
type = STINGER_TYPE_SMALL;
} else {
if(!IsGM(playerid)){
return SendClientMessage(playerid,-1,"Usage /stinger <big/small/destroy>");
} else {
return SendClientMessage(playerid,-1,"Usage /stinger <big/small/destroy>");
}
}
new Float:x,Float:y,Float:z,Float:z_angle;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,z_angle);
DestroyDynamicStinger(StingerObj[playerid]);
StingerObj[playerid] = CreateDynamicStinger(type,x,y,z-0.9,0.0,0.0,CompRotationFloat(z_angle+90.0),-1,-1,-1,100.0,ANY_TEAM,playerid);
return SendClientMessage(playerid,-1,"Stinger added");
}
//called on vehicle damage updated by stinger
OnVehicleDamageByStinger(playerid,killerid,mobid,old_tires,new_tires);
GetPlayerActiveDynamicStinger(playerid);
ToggleDynamicStingerDamage(mobid,bool:toggle);
public OnVehicleDamageByStinger(playerid,killerid,mobid,old_tires,new_tires){
if(killerid != INVALID_PLAYER_ID && new_tires == 15){
new p_name[MAX_PLAYER_NAME],string[144];
GetPlayerName(killerid,p_name,sizeof(p_name));
format(string,sizeof(string),"{00AAFF}Your vehicle has been damaged by {00FF00}%s {00AAFF}stinger.",p_name);
SendClientMessage(playerid,-1,string);
}
return 1;
}
Nice, very nice!
Can you add to prevent damage for a certain team(cops)? |
public OnVehicleDamageByStinger(playerid,killerid,mobid,old_tires,new_tires){
if(killerid != INVALID_PLAYER_ID && GetPlayerTeam(killerid) == GetPlayerTeam(playerid)){
// set the vehicle tire status to old_tires
}
return 1;
}
Nice, very nice!
Can you add to prevent damage for a certain team(cops)? |
CreateDynamicStinger(type,Float:x,Float:y,Float:z,Float:rx,Float:ty,Float:rz,worldid=-1,interiorid=-1,playerid=-1,Float:streamdistance=100.0, teamid=ANY_TEAM,byplayerid=INVALID_PLAYER_ID);
PHP Code:
|
Title is so missleading I thought they are missiles lol :P
Good job anyways |