[FilterScript] Dynamic Stingers System
#1

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:
PHP Code:
#include <ADM/3DTryg>
#include <Stingers> 
Functions:
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); 
Callbacks:
PHP Code:
//called on vehicle damage updated by stinger
OnVehicleDamageByStinger(playerid,killerid,mobid,old_tires,new_tires); 
Definitions:
PHP Code:
STINGER_TYPE_SMALL //Object: 2899
STINGER_TYPE_BIG   //Object: 2892 
Example code:
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");

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
Reply


Messages In This Thread
Dynamic Stingers System - by AbyssMorgan - 30.04.2017, 12:57
Re: Dynamic Stingers System - by IlanZ - 30.04.2017, 13:28
Re: Dynamic Stingers System - by JessThompson - 02.05.2017, 08:01
Re: Dynamic Stingers System - by coool - 03.05.2017, 17:06
Re: Dynamic Stingers System - by AbyssMorgan - 17.05.2017, 06:58
Re: Dynamic Stingers System - by JR_Junior - 29.09.2017, 18:44
Re: Dynamic Stingers System - by Meller - 29.09.2017, 18:48
Re: Dynamic Stingers System - by AbyssMorgan - 29.09.2017, 18:49
Re: Dynamic Stingers System - by AzaMx - 30.09.2017, 02:19
Re: Dynamic Stingers System - by Crystallize - 03.10.2017, 04:29
Re: Dynamic Stingers System - by AbyssMorgan - 03.10.2017, 06:15

Forum Jump:


Users browsing this thread: 1 Guest(s)