30.04.2017, 12:57
(
Last edited by AbyssMorgan; 26/09/2019 at 05:00 PM.
Reason: added command
)
Hello, I would like to present you the Stingers Script (Cops and Robbers)
Video:
https://www.youtube.com/watch?v=nslVT5RC3J0
Download:
Stingers.inc
3DTryg.inc Thread
Installation:
Functions:
Callbacks:
Definitions:
Example code:
Issues:
- Stinger can not be located near to another stinger
Notice:
Filterscript not exist because filterscripts have limits.
This has been replaced by include, having automatic installation, efficient GameMode/FilterScript.
Non-Registered Users:
Bug Report
Video:
https://www.youtube.com/watch?v=nslVT5RC3J0
Download:
Stingers.inc
3DTryg.inc Thread
Installation:
PHP Code:
#include <ADM/3DTryg>
#include <Stingers>
PHP Code:
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);
PHP Code:
//called on vehicle damage updated by stinger
OnVehicleDamageByStinger(playerid,killerid,mobid,old_tires,new_tires);
PHP Code:
STINGER_TYPE_SMALL //Object: 2899
STINGER_TYPE_BIG //Object: 2892
PHP Code:
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");
}
- Stinger can not be located near to another stinger
Notice:
Filterscript not exist because filterscripts have limits.
This has been replaced by include, having automatic installation, efficient GameMode/FilterScript.
Non-Registered Users:
Bug Report