Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: [Tkiller] on February 27, 2012, 07:46:10 am

Title: How to set time to end an event....
Post by: [Tkiller] 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....
Title: Re: How to set time to end an event....
Post by: DilsonTB on February 27, 2012, 03:28:14 pm
as you did a Finalcuant public function you need to make a CountDown1, CountDown2 etc. :D
Title: Re: How to set time to end an event....
Post by: heekz.shadow 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 );

(http://chifredoboi.files.wordpress.com/2011/02/fuuu2.png)


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
Title: Re: How to set time to end an event....
Post by: [Tkiller] 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.....
Title: Re: How to set time to end an event....
Post by: heekz.shadow on February 28, 2012, 08:05:51 am
I do believe that SetFriendlyFire can be used JUST in OnGameModeInit (IIRC).
Title: Re: How to set time to end an event....
Post by: [Tkiller] 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)
Title: Re: How to set time to end an event....
Post by: heekz.shadow 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
Title: Re: How to set time to end an event....
Post by: [Tkiller] 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..... :-[
Title: Re: How to set time to end an event....
Post by: heekz.shadow 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.
Title: Re: How to set time to end an event....
Post by: [Tkiller] on February 28, 2012, 10:39:04 am
Oh thanks.... :o

[  img ] http://a6.sphotos.ak.fbcdn.net/hphotos-ak-snc7/428622_364395856916866_100000393638744_1258428_149334923_n.jpg [/ img ]
Title: Re: How to set time to end an event....
Post by: stormeus on February 28, 2012, 01:53:31 pm
but without spaces.