Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*************************************************************
- Chemtrails Filterscript
- -» Author : robin_be (yugecin)
- -» Release Date : 25th March 2012
- -» Description : Chemtrails for planes (not at-400 and andromada)
- -» Video : http://www.youtube.com/watch?v=r0MTiZ9xppU
- -» forum post : http://forum.sa-mp.com/showthread.php?t=328612
- **************************************************************/
- #include <a_samp>
- new ctrails[MAX_PLAYERS][2];
- public OnFilterScriptInit() return print("[FS]ChemTrails Loaded!");
- public OnFilterScriptExit() {
- for(new i=0; i < MAX_PLAYERS+1; i++){
- if(ctrails[i][0]){
- DestroyObject(ctrails[i][0]);
- DestroyObject(ctrails[i][1]);
- ctrails[i][0] = 0;
- }
- }
- return print("[FS]ChemTrails Unloaded!");
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp(cmdtext, "/ctrails", true)) {
- //460 skimmer
- //520 hydra
- //511 beagle
- //512 cropduster
- //513 stuntplane
- //593 dodo
- //553 nevada
- //476 rustler
- //519 shamal
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "[Chemtrails] {FFFFFF}You must be in a supported plane!");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xFF0000AA, "[Chemtrails] {FFFFFF}You must be the driver!");
- new Float:x, Float:y, Float:z;
- switch(GetVehicleModel(GetPlayerVehicleID(playerid))){
- case 460: {
- x = 5.3;
- y = 0.0;
- z = -0.6;
- }
- case 476: {
- x = 5.3;
- y = 0.9;
- z = -2.0;
- }
- case 511: {
- x = 10.3;
- y = -1.0;
- z = -1.25;
- }
- case 512: {
- x = 5.3;
- y = 1.0;
- z = -0.4;
- }
- case 513: {
- x = 4.0;
- y = 0.0;
- z = -1.0;
- }
- case 519: {
- x = 9.7;
- y = -2.0;
- z = -1.8;
- }
- case 520: {
- x = 4.75;
- y = -1.0;
- z = -2.0;
- }
- case 553: {
- x = 14.0;
- y = 0.5;
- z = -1.25;
- }
- case 593: {
- x = 6.0;
- y = 0.0;
- z = -0.5;
- }
- default: return SendClientMessage(playerid, 0xFF0000AA, "[Chemtrails] {FFFFFF}You have to be in a supported plane!");
- }
- if(ctrails[playerid][0]){
- DestroyObject(ctrails[playerid][0]);
- DestroyObject(ctrails[playerid][1]);
- ctrails[playerid][0] = 0;
- return 1;
- }
- ctrails[playerid][0] = CreateObject(18728, 0.0, 0.0, 0.0, 0.0, 0.0, 256.0);
- ctrails[playerid][1] = CreateObject(18728, 0.0, 0.0, 0.0, 0.0, 0.0, 256.0);
- AttachObjectToVehicle(ctrails[playerid][0], GetPlayerVehicleID(playerid), x, y, z, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(ctrails[playerid][1], GetPlayerVehicleID(playerid), -x, y, z, 0.0, 0.0, 0.0);
- return 1;
- }
- return 0;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT){
- if(ctrails[playerid][0]){
- DestroyObject(ctrails[playerid][0]);
- DestroyObject(ctrails[playerid][1]);
- ctrails[playerid][0] = 0;
- }
- }
- if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_WASTED){
- if(ctrails[playerid][0]){
- DestroyObject(ctrails[playerid][0]);
- DestroyObject(ctrails[playerid][1]);
- ctrails[playerid][0] = 0;
- }
- }
- return 1;
- }
- public OnPlayerConnect(playerid) ctrails[playerid][0] = 0;
- public OnPlayerDisconnect(playerid, reason)
- {
- if(ctrails[playerid][0]){
- DestroyObject(ctrails[playerid][0]);
- DestroyObject(ctrails[playerid][1]);
- ctrails[playerid][0] = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement