Author Topic: (for me) KillEngine = Server Crash  (Read 3769 times)

0 Members and 3 Guests are viewing this topic.

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
(for me) KillEngine = Server Crash
« on: February 05, 2012, 10:26:53 pm »
I will ask more questions cuse i have in my mind a new Gamemode  :)

so ... im sure you will understand from this:

InVehicle isn't IsPlayerInAnyVehicle or IsPlayerInVehicle . Is just a variable.

public OnPlayerEnterVehicle(playerid,vehicleid,ispassenger) :

[pawn]if(vehicleid > 142) {
       if(InVehicle[playerid] == 0) {
         SetVehicleLights(vehicleid,1);
         SetTimer("KillEngine", 1000, false);
       }
   }[/pawn]

The Public:

[pawn]public KillEngine()
{
    for(new i = 0; i <= MAX_PLAYERS; i++) {
        if(IsPlayerInAnyVehicle(i)) {
         new veh = GetPlayerVehicleID(i);
         KillVehicleEngine(veh);
      }
   }
}[/pawn]
« Last Edit: February 05, 2012, 10:30:13 pm by sseebbyy »

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 DilsonTB

  • Made Man
  • ***
  • Posts: 140
  • VC:MP Developer. & SA:MP Currently Developer
    • View Profile
Re: (for me) KillEngine = Server Crash
« Reply #1 on: February 06, 2012, 01:12:11 am »
Dont use timer. timer just bug your script.

[pawn]if(vehicleid > 142) {
       if(InVehicle[playerid] == 0) {
new veh = GetPlayerVehicleID(i);
         SetVehicleLights(vehicleid,1);
                       KillVehicleEngine(veh);   
       }
   }[/pawn]
_______________________________________________
¬ VC:MP Squirrel Developer.
¬ VC:MP pawno Developer.
¬ SA:MP Developer.
¬
¬ Actually developing " San Fierro Roleplay - Latino ", with
my beta team testers, Mapper + Scripter ( me ), 18,000
lines, and is 34% finished. hope to finish it in 4 Or 3 Months.

- MYSQL FULL BASED.
- PCU.
_______________________________________________

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: (for me) KillEngine = Server Crash
« Reply #2 on: February 06, 2012, 01:23:15 am »
the engine don't stop !

I tried this ...

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 DilsonTB

  • Made Man
  • ***
  • Posts: 140
  • VC:MP Developer. & SA:MP Currently Developer
    • View Profile
Re: (for me) KillEngine = Server Crash
« Reply #3 on: February 06, 2012, 01:59:07 am »
Already solved it Lol
_______________________________________________
¬ VC:MP Squirrel Developer.
¬ VC:MP pawno Developer.
¬ SA:MP Developer.
¬
¬ Actually developing " San Fierro Roleplay - Latino ", with
my beta team testers, Mapper + Scripter ( me ), 18,000
lines, and is 34% finished. hope to finish it in 4 Or 3 Months.

- MYSQL FULL BASED.
- PCU.
_______________________________________________

Offline DilsonTB

  • Made Man
  • ***
  • Posts: 140
  • VC:MP Developer. & SA:MP Currently Developer
    • View Profile
Re: (for me) KillEngine = Server Crash
« Reply #4 on: February 06, 2012, 02:05:15 am »
[pawn]public OnPlayerEnterVehicle(playerid,vehicleid, ispassenger)
{
SetTimer("Carengine",1000,false);
      return 0;
}[/pawn]

[pawn]public Carengine(vehicleid)
{
    for(new i = 0; i <= MAX_PLAYERS; i++) {
         KillVehicleEngine(GetPlayerVehicleID(i));
         SendClientMessage(i,COLOR_YELLOW,"The engine of the car is off");
                    }
  }[/pawn]

Your welcome friend
_______________________________________________
¬ VC:MP Squirrel Developer.
¬ VC:MP pawno Developer.
¬ SA:MP Developer.
¬
¬ Actually developing " San Fierro Roleplay - Latino ", with
my beta team testers, Mapper + Scripter ( me ), 18,000
lines, and is 34% finished. hope to finish it in 4 Or 3 Months.

- MYSQL FULL BASED.
- PCU.
_______________________________________________

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: (for me) KillEngine = Server Crash
« Reply #5 on: February 06, 2012, 11:22:01 am »
If someone enters a vehicle, you kill everyone's engine ? BRAINFUCK.
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 DilsonTB

  • Made Man
  • ***
  • Posts: 140
  • VC:MP Developer. & SA:MP Currently Developer
    • View Profile
Re: (for me) KillEngine = Server Crash
« Reply #6 on: February 06, 2012, 01:36:46 pm »
If you dont know be quiet, Cuz moby join my server and ask me for help to KILL ENGINE WHEN YOU ENTER TO VEHICLE.
_______________________________________________
¬ VC:MP Squirrel Developer.
¬ VC:MP pawno Developer.
¬ SA:MP Developer.
¬
¬ Actually developing " San Fierro Roleplay - Latino ", with
my beta team testers, Mapper + Scripter ( me ), 18,000
lines, and is 34% finished. hope to finish it in 4 Or 3 Months.

- MYSQL FULL BASED.
- PCU.
_______________________________________________

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: (for me) KillEngine = Server Crash
« Reply #7 on: February 06, 2012, 04:00:02 pm »
Lol... what you made :


[pawn]public OnPlayerEnterVehicle(playerid,vehicleid, ispassenger)
{
SetTimer("Carengine",1000,false);
      return 0;
}[/pawn]

[pawn]public Carengine(vehicleid)
{
    for(new i = 0; i <= MAX_PLAYERS; i++) {
         KillVehicleEngine(GetPlayerVehicleID(i));
         SendClientMessage(i,COLOR_YELLOW,"The engine of the car is off");
                    }
  }[/pawn]

Your welcome friend

and wath i made :

public OnPlayerEnterVehicle(playerid,vehicleid,ispassenger) :

[pawn]if(vehicleid > 142) {
       if(InVehicle[playerid] == 0) {
         SetVehicleLights(vehicleid,1);
         SetTimer("KillEngine", 1000, false);
       }
   }[/pawn]

The Public:

[pawn]public KillEngine()
{
    for(new i = 0; i <= MAX_PLAYERS; i++) {
        if(IsPlayerInAnyVehicle(i)) {
         new veh = GetPlayerVehicleID(i);
         KillVehicleEngine(veh);
      }
   }
}[/pawn]

have done the same with minor difference...

anyway, Shadow helped me by email.

The problem was the timer... need to be 3 - 4 seconds not just one .


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.