Author Topic: How to set time to end an event....  (Read 3965 times)

0 Members and 1 Guest are viewing this topic.

Offline [Tkiller]

  • Street Thug
  • *
  • Posts: 15
    • View Profile
How to set time to end an event....
« on: February 27, 2012, 07:46:10 am »
I make an auto event Royal rumble,But the problem is that i want when event started the friendly fire set to be 0(same skin players kill same skin players) for only 5 minutes,after that friendly fire set to be 1(same skin player cannot be able to kill same skin players)...


On gamemodeinit i put this,
[pawn]SetTimer("RoyalRumble",200000,1);[/pawn]


In function i put that,
[pawn]public RoyalRumble()
{
new playerid;
for(new i = 0; i <= MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) SetPlayerPos(i,-1723.20898,-156.52439,14.86832,0,0);
SetPlayerFriendlyFire(1);
TogglePlayerControllable(playerid, 0);
SetPlayerWeapon(i, 21, 999);
SetPlayerWeapon(i, 23, 999);
SetPlayerWeapon(i, 26, 999);
SendClientMessageToAll(RED,"Event Started Kill every one to Be a winner");
SetTimer( "CountRace1", 1000, 0 );
SetTimer( "CountRace2", 2000, 0 );
SetTimer( "CountRace3", 3000, 0 );
SetTimer( "FinalCountRace", 4000, 0 );
}
return 1;
}[/pawn]


And in final count i put that For Toggle player controllable

[pawn]public FinalCountRace()
{
new plr;
   GameTextForAll("==~o~Go ~p~Go! ~x~Go==" );
   TogglePlayerControllable(plr, 1);
}[/pawn]


Please Help me....

Offline DilsonTB

  • Made Man
  • ***
  • Posts: 140
  • VC:MP Developer. & SA:MP Currently Developer
    • View Profile
Re: How to set time to end an event....
« Reply #1 on: February 27, 2012, 03:28:14 pm »
as you did a Finalcuant public function you need to make a CountDown1, CountDown2 etc. :D
_______________________________________________
¬ 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: How to set time to end an event....
« Reply #2 on: February 27, 2012, 07:17:55 pm »
I make an auto event Royal rumble,But the problem is that i want when event started the friendly fire set to be 0(same skin players kill same skin players) for only 5 minutes,after that friendly fire set to be 1(same skin player cannot be able to kill same skin players)...


On gamemodeinit i put this,
[pawn]SetTimer("RoyalRumble",200000,1);[/pawn]


In function i put that,
[pawn]public RoyalRumble()
{
new playerid;
for(new i = 0; i <= MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) SetPlayerPos(i,-1723.20898,-156.52439,14.86832,0,0);
SetPlayerFriendlyFire(1);
TogglePlayerControllable(playerid, 0);
SetPlayerWeapon(i, 21, 999);
SetPlayerWeapon(i, 23, 999);
SetPlayerWeapon(i, 26, 999);
SendClientMessageToAll(RED,"Event Started Kill every one to Be a winner");
SetTimer( "CountRace1", 1000, 0 );
SetTimer( "CountRace2", 2000, 0 );
SetTimer( "CountRace3", 3000, 0 );
SetTimer( "FinalCountRace", 4000, 0 );
}
return 1;
}[/pawn]


And in final count i put that For Toggle player controllable

[pawn]public FinalCountRace()
{
new plr;
   GameTextForAll("==~o~Go ~p~Go! ~x~Go==" );
   TogglePlayerControllable(plr, 1);
}[/pawn]


Please Help me....

Quote
[pawn]SetTimer("RoyalRumble",200000,1);[/pawn]

Quote
SetTimer( "CountRace1", 1000, 0 );
SetTimer( "CountRace2", 2000, 0 );
SetTimer( "CountRace3", 3000, 0 );
SetTimer( "FinalCountRace", 4000, 0 );

Quote
SetTimer( "CountRace1", 1000, 0 );
SetTimer( "CountRace2", 2000, 0 );
SetTimer( "CountRace3", 3000, 0 );




You use waaaayyy to much timers, amd about the friendly fire thing, I don't think it works.


Ohh and a note: We cannot pass playerid from function to timer

This is totally wrong as it will refer to 0

Quote
for(new i = 0; i <= MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) SetPlayerPos(i,-1723.20898,-156.52439,14.86832,0,0);
SetPlayerFriendlyFire(1);
TogglePlayerControllable(i, 0);
SetPlayerWeapon(i, 21, 999);
SetPlayerWeapon(i, 23, 999);
SetPlayerWeapon(i, 26, 999);
SendClientMessageToAll(RED,"Event Started Kill every one to Be a winner");
SetTimer( "CountRace1", 1000, 0 );
SetTimer( "CountRace2", 2000, 0 );
SetTimer( "CountRace3", 3000, 0 );
SetTimer( "FinalCountRace", 4000, 0 );

This is the correct version

SOO... Conclusion:

You use too much timers which lag the server, I will use just one...


But the idea is original and good
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 [Tkiller]

  • Street Thug
  • *
  • Posts: 15
    • View Profile
Re: How to set time to end an event....
« Reply #3 on: February 28, 2012, 07:59:44 am »
Quote
You use waaaayyy to much timers, amd about the friendly fire thing, I don't think it works.


Ohh and a note: We cannot pass playerid from function to timer

This is totally wrong as it will refer to 0

Quote

    for(new i = 0; i <= MAX_PLAYERS; i++) {
    if(IsPlayerConnected(i)) SetPlayerPos(i,-1723.20898,-156.52439,14.86832,0,0);
    SetPlayerFriendlyFire(1);
    TogglePlayerControllable(i, 0);
    SetPlayerWeapon(i, 21, 999);
    SetPlayerWeapon(i, 23, 999);
    SetPlayerWeapon(i, 26, 999);
    SendClientMessageToAll(RED,"Event Started Kill every one to Be a winner");
    SetTimer( "CountRace1", 1000, 0 );
    SetTimer( "CountRace2", 2000, 0 );
    SetTimer( "CountRace3", 3000, 0 );
    SetTimer( "FinalCountRace", 4000, 0 );


This is the correct version

SOO... Conclusion:

You use too much timers which lag the server, I will use just one...


But the idea is original and good



Thanks,
But still the fucking Friendly fire problem.....

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: How to set time to end an event....
« Reply #4 on: February 28, 2012, 08:05:51 am »
I do believe that SetFriendlyFire can be used JUST in OnGameModeInit (IIRC).
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 [Tkiller]

  • Street Thug
  • *
  • Posts: 15
    • View Profile
Re: How to set time to end an event....
« Reply #5 on: February 28, 2012, 08:48:07 am »
Lol....
I know it's set in Gmaemodeinit,but i want to set it for My event man,you don't get it(o_0)

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: How to set time to end an event....
« Reply #6 on: February 28, 2012, 08:55:17 am »
I do believe that SetFriendlyFire can be used JUST in OnGameModeInit (IIRC).

So badly people cannot read the bold letters
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 [Tkiller]

  • Street Thug
  • *
  • Posts: 15
    • View Profile
Re: How to set time to end an event....
« Reply #7 on: February 28, 2012, 09:15:46 am »
Quote
    I do believe that SetFriendlyFire can be used JUST in OnGameModeInit (IIRC).


So badly people cannot read the bold letters

Oh,Sorry,I can't focus my mind..... :-[

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: How to set time to end an event....
« Reply #8 on: February 28, 2012, 10:35:46 am »
No problem, also, an off-topic tip: Try to put [ img  ] [  /img  ] before and after your image


so it should look like

[  img ] http://a6.sphotos.ak.fbcdn.net/hphotos-ak-snc7/428622_364395856916866_100000393638744_1258428_149334923_n.jpg [/ img ]

but without spaces.
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 [Tkiller]

  • Street Thug
  • *
  • Posts: 15
    • View Profile

Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
Re: How to set time to end an event....
« Reply #10 on: February 28, 2012, 01:53:31 pm »
Do not PM me for support.