Author Topic: Engine turning on/off system  (Read 8973 times)

0 Members and 2 Guests are viewing this topic.

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Engine turning on/off system
« on: December 14, 2012, 10:10:46 pm »
Hi, this is Nesk, I'd like to share my engine turning on/off system. It means that player shouldn't re-enter the vehicle to turn on the engine.
Commands are:
!enoff - turn off the vehicle engine
!enon - turn on the engine

[pawn]public OnPlayerText(playerid, text[])
{
   if(strcmp(text, "!enoff", true)==0)
   {
      if(IsPlayerInAnyVehicle(playerid))
      {
         new vehicleid = GetPlayerVehicleID(playerid);
          KillVehicleEngine(vehicleid);
          SendClientMessage(playerid, 0xFF0000AA, "The engine has been turned off.");
          GameTextForPlayer(playerid, "~o~            OFF");
          return 1;
      }
      else
      {
          SendClientMessage(playerid, 0xFF0000AA, "You are not in a vehicle.");
          return 1;
      }
       return 1;
   }
   else if(strcmp(text, "!enon", true)==0)
   {
      if(IsPlayerInAnyVehicle(playerid))
      {
         new vehicleid = GetPlayerVehicleID(playerid);
         RemovePlayerFromVehicle(playerid);
         PutPlayerInVehicle(playerid, vehicleid);
         SendClientMessage(playerid, 0xFF0000AA, "The engine has been turned on.");
         GameTextForPlayer(playerid, "~t~            ON");
         return 0;
      }
      else
      {
          SendClientMessage(playerid, 0xFF0000AA, "You are not in a vehicle.");
          return 0;
      }
      return 1;
   }
   return 1;
}[/pawn]

Good luck on roads!
« Last Edit: January 15, 2013, 05:03:36 pm by NeskWriter »


-Funniest quotes-

Quote from: asad3man
i cant able to understand

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: Engine turning on/off system
« Reply #1 on: December 14, 2012, 10:33:13 pm »
I remember something about this...

oh ye: Robd posted it but in another form. In a better form where he created a new function for this called "ToggleEngine" or something like this.

Anyway, this is another form.

I hope is made by you.

8/10

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: Engine turning on/off system
« Reply #2 on: December 14, 2012, 10:38:01 pm »
Thank you, It was made by me. anyway it's my version  ;)


-Funniest quotes-

Quote from: asad3man
i cant able to understand

Offline [KB]ViceMania

  • Wiseguy
  • **
  • Posts: 53
  • Mega War server administrator
    • View Profile
Re: Engine turning on/off system
« Reply #3 on: December 18, 2012, 03:23:15 pm »
nice :P

Offline mrockxkingbutt

  • Crime Boss
  • ****
  • Posts: 373
  • I AM Best Scripter And You Are Not :P
    • View Profile
Re: Engine turning on/off system
« Reply #4 on: December 26, 2012, 11:11:12 pm »
plz fix it that it can works in gups Too plz :(
My Servers Showroom!
www.jimxvcmpscripts.createaforum.com/

Quote from:  rohanaj60
i m a great script Editor

Rofl! lmao lol

Offline Fuzzy168

  • VC:MP Veteran
  • *****
  • Posts: 729
  • Programming since 2011
    • View Profile
Re: Engine turning on/off system
« Reply #5 on: December 27, 2012, 04:40:14 am »
plz fix it that it can works in gups Too plz :(
GUPS isn't the main script for the VC-MP Pawn server, therefore most of the scripts released are not compatible with GUPS.
I'm beginning to feel like a Lag God, Lag God

Offline aledark24

  • Made Man
  • ***
  • Posts: 206
  • I am a scripter and you have celous of me....so you crashed my servers
    • View Profile
Re: Engine turning on/off system
« Reply #6 on: December 27, 2012, 01:41:27 pm »
plz fix it that it can works in gups Too plz :(
GUPS isn't the main script for the VC-MP Pawn server, therefore most of the scripts released are not compatible with GUPS..

you are wrong because all commands is compatible in gups
only you can't put in the right place and not missed any part of the script
also this command is  wrong in many lines
I am a great scripter and you are celous of my works
.....

Vice City Life Multiplayer By Saint

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: Engine turning on/off system
« Reply #7 on: December 28, 2012, 03:08:07 pm »
plz fix it that it can works in gups Too plz :(
GUPS isn't the main script for the VC-MP Pawn server, therefore most of the scripts released are not compatible with GUPS..

you are wrong because all commands is compatible in gups
only you can't put in the right place and not missed any part of the script
also this command is  wrong in many lines

Tell me where it's wrong


-Funniest quotes-

Quote from: asad3man
i cant able to understand

Offline mrockxkingbutt

  • Crime Boss
  • ****
  • Posts: 373
  • I AM Best Scripter And You Are Not :P
    • View Profile
Re: Engine turning on/off system
« Reply #8 on: December 29, 2012, 11:36:26 am »
here is problem
getplayermodel
and text instead of cmd
plz fix
My Servers Showroom!
www.jimxvcmpscripts.createaforum.com/

Quote from:  rohanaj60
i m a great script Editor

Rofl! lmao lol

Offline mrockxkingbutt

  • Crime Boss
  • ****
  • Posts: 373
  • I AM Best Scripter And You Are Not :P
    • View Profile
Re: Engine turning on/off system
« Reply #9 on: December 29, 2012, 11:48:08 am »
i have finaly install this in gups
with this code
[pawn]   if(strcmp(cmd, "!enoff", true)==0)
   {
      if(IsPlayerInAnyVehicle(playerid))
      {
         new vehicleid = GetPlayerVehicleID(playerid);
          KillVehicleEngine(vehicleid);
          SendClientMessage(playerid, 0xFF0000AA, "The engine has been turned off.");
          GameTextForPlayer(playerid, "~o~            OFF");
          return 1;
      }
      else
      {
          SendClientMessage(playerid, 0xFF0000AA, "You are not in a vehicle.");
          return 1;
      }
       return 1;
   }
   else if(strcmp(cmd, "!enon", true)==0)
   {
      if(IsPlayerInAnyVehicle(playerid))
      {
         new vehicleid = GetPlayerVehicleID(playerid);
         RemovePlayerFromVehicle(playerid);
         PutPlayerInVehicle(playerid, vehicleid);
         SendClientMessage(playerid, 0xFF0000AA, "The engine has been turned on.");
         GameTextForPlayer(playerid, "~t~            ON");
         return 1;
      }
      else
      {
          SendClientMessage(playerid, 0xFF0000AA, "You are not in a vehicle.");
      }
      return 1;
   }[/pawn]
My Servers Showroom!
www.jimxvcmpscripts.createaforum.com/

Quote from:  rohanaj60
i m a great script Editor

Rofl! lmao lol

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: Engine turning on/off system
« Reply #10 on: January 11, 2013, 11:44:42 pm »
Also u can make 2 stocks called TurnOnPlayerVehEngine/TurnOffPlayerVehEngine. This is what I did after :D
« Last Edit: January 11, 2013, 11:51:04 pm by NeskWriter »


-Funniest quotes-

Quote from: asad3man
i cant able to understand

Offline VS

  • Street Thug
  • *
  • Posts: 37
  • Opening Soon - VS Society
    • View Profile
Re: Engine turning on/off system
« Reply #11 on: January 12, 2013, 10:59:37 pm »
let me take a shot


stock SetVehicleEngine(vehicleid, on=1)//0 is off _ 1 is on
{
   switch()
   {
       case 0:
           KillVehicleEngine(vehicleid);
       case 1:
           StartVehicleEngine(vehicleid);
   }
}
stock StartVehicleEngine(vehicleid)
{
    RemovePlayerFromVehicle(playerid);
    PutPlayerInVehicle(playerid,GetPlayerVehicleID(playerid));
}

 forgot playerid you add it
« Last Edit: January 12, 2013, 11:04:32 pm by VS »

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: Engine turning on/off system
« Reply #12 on: January 13, 2013, 02:35:59 am »
let me take a shot


stock SetVehicleEngine(vehicleid, on=1)//0 is off _ 1 is on
{
   switch()
   {
       case 0:
           KillVehicleEngine(vehicleid);
       case 1:
           StartVehicleEngine(vehicleid);
   }
}
stock StartVehicleEngine(vehicleid)
{
    RemovePlayerFromVehicle(playerid);
    PutPlayerInVehicle(playerid,GetPlayerVehicleID(playerid));
}

 forgot playerid you add it

Quote
    RemovePlayerFromVehicle(playerid);
    PutPlayerInVehicle(playerid,GetPlayerVehicleID(playerid));

What kind of vehicle is the guy supposed to drive if you removed him ?
Code: [Select]
[20:23] <habi> later only i heard that lu chatbox is customizable. On my first visit, it appeared ugly.
[20:23] <habi> May be that also be the reason why lu has no players

Offline VS

  • Street Thug
  • *
  • Posts: 37
  • Opening Soon - VS Society
    • View Profile
Re: Engine turning on/off system
« Reply #13 on: January 13, 2013, 02:51:46 am »
Quote

What kind of vehicle is the guy supposed to drive if you removed him ?

if the player is taken out of the vehicle then put back in the vehicle it will be drivable again

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: Engine turning on/off system
« Reply #14 on: January 13, 2013, 10:42:26 am »
Thanks Sherlock Holmes ( sarcasm )



You remove the player from a vehicle, how do you expect to put him in it WHEN you removed him w/o using any variable...
Code: [Select]
[20:23] <habi> later only i heard that lu chatbox is customizable. On my first visit, it appeared ugly.
[20:23] <habi> May be that also be the reason why lu has no players