27.12.2010, 21:28
hey [HiC]TheKiller
can you help me quickly
i want to make a automaticly race stop after one minute if the first player finish the race i use this I use iht with a timer whish activeds the RaceEnd Public but it didnt work i pud the timer in the OnPlayerEnterRaceCheckpoint public
if(LastCP[playerid] == 1)
{
new TimeM, TimeS;
TimeS = RaceTime[playerid];
while(TimeS > 59)
{
TimeS = TimeS - 60;
TimeM ++;
}
DisablePlayerRaceCheckpoint(playerid);
RacePos ++;
new Str[150], Str2[150];
if(TimeM < 1)
{
format(Str, 100, "~g~Youll have finished the race!~n~~y~Position: %d Time:%d seconds", RacePos, TimeS);
format(Str2, 100, "You have finished the race! Position:%d Time:%d seconds", RacePos, TimeS);
}
if(TimeM > 0)
{
if(TimeS < 10)
{
format(Str, 100, "~g~Youaa have finished the race!~n~~y~Position: %d Time:%d:0%d", RacePos, TimeM, TimeS);
format(Str2, 100, "You have finished the race! Position: %d Time:%d:0%d", RacePos, TimeM, TimeS);
}
if(TimeS > 9)
{
format(Str, 100, "~g~Youee have finished the race!~n~~y~Position: %d Time:%d:%d", RacePos, TimeM, TimeS);
format(Str2, 100, "You have finished the race! Position: %d Time:%d:%d", RacePos, TimeM, TimeS);
}
}
SendClientMessage(playerid, 0x00D300AA, Str2);
GameTextForPlayer(playerid, Str, 3000, 3);
InRace[playerid] = 0;
LastCP[playerid] = 0;
RaceCPS[playerid] = -2;
new Yesss;
for(new i; i<MAX_PLAYERS; i++)
{
if(InRace[i] == 1) Yesss = 1;
}
if(Yesss == 0)
{
CurrentRace = -1;
KillTimer(Time53);
KillTimer(Racee);
SetTimerEx("RaceEnd",60000 , false, "ii", playerid);
}
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid ), 0);
SetPlayerVirtualWorld(playerid, 0);
RaceTime[playerid] = 0;
}
if(RaceCPS[playerid] != 0 && RaceCPS[playerid] != RaceI[CurrentRace][CPNUM] -1)
{
SetPlayerRaceCheckpoint(playerid, 0, RaceI[CurrentRace][X][RaceCPS[playerid] + 1], RaceI[CurrentRace][Y][RaceCPS[playerid] + 1], RaceI[CurrentRace][Z][RaceCPS[playerid] + 1], RaceI[CurrentRace][X][RaceCPS[playerid]+ 2], RaceI[CurrentRace][Y][RaceCPS[playerid] +2], RaceI[CurrentRace][Z][RaceCPS[playerid]+2], ;
RaceCPS[playerid] ++;
}
if(RaceCPS[playerid] == 0)
{
GameTextForPlayer(playerid, "~y~Welcome to the race!~n~~r~Stay in the red checkpoint!", 3000, 3);
}
if(RaceCPS[playerid] == RaceI[CurrentRace][CPNUM]-1)
{
SetPlayerRaceCheckpoint(playerid, 1, RaceI[CurrentRace][X][RaceCPS[playerid]], RaceI[CurrentRace][Y][RaceCPS[playerid]], RaceI[CurrentRace][Z][RaceCPS[playerid]], RaceI[CurrentRace][X][RaceCPS[playerid]+ 1], RaceI[CurrentRace][Y][RaceCPS[playerid] +1], RaceI[CurrentRace][Z][RaceCPS[playerid]+1], ;
LastCP[playerid] = 1;
}
return 1;
}
SetTimerEx("RaceEnd",60000 , false, "ii", playerid);
is the timer
can you help me quickly
i want to make a automaticly race stop after one minute if the first player finish the race i use this I use iht with a timer whish activeds the RaceEnd Public but it didnt work i pud the timer in the OnPlayerEnterRaceCheckpoint public
if(LastCP[playerid] == 1)
{
new TimeM, TimeS;
TimeS = RaceTime[playerid];
while(TimeS > 59)
{
TimeS = TimeS - 60;
TimeM ++;
}
DisablePlayerRaceCheckpoint(playerid);
RacePos ++;
new Str[150], Str2[150];
if(TimeM < 1)
{
format(Str, 100, "~g~Youll have finished the race!~n~~y~Position: %d Time:%d seconds", RacePos, TimeS);
format(Str2, 100, "You have finished the race! Position:%d Time:%d seconds", RacePos, TimeS);
}
if(TimeM > 0)
{
if(TimeS < 10)
{
format(Str, 100, "~g~Youaa have finished the race!~n~~y~Position: %d Time:%d:0%d", RacePos, TimeM, TimeS);
format(Str2, 100, "You have finished the race! Position: %d Time:%d:0%d", RacePos, TimeM, TimeS);
}
if(TimeS > 9)
{
format(Str, 100, "~g~Youee have finished the race!~n~~y~Position: %d Time:%d:%d", RacePos, TimeM, TimeS);
format(Str2, 100, "You have finished the race! Position: %d Time:%d:%d", RacePos, TimeM, TimeS);
}
}
SendClientMessage(playerid, 0x00D300AA, Str2);
GameTextForPlayer(playerid, Str, 3000, 3);
InRace[playerid] = 0;
LastCP[playerid] = 0;
RaceCPS[playerid] = -2;
new Yesss;
for(new i; i<MAX_PLAYERS; i++)
{
if(InRace[i] == 1) Yesss = 1;
}
if(Yesss == 0)
{
CurrentRace = -1;
KillTimer(Time53);
KillTimer(Racee);
SetTimerEx("RaceEnd",60000 , false, "ii", playerid);
}
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid ), 0);
SetPlayerVirtualWorld(playerid, 0);
RaceTime[playerid] = 0;
}
if(RaceCPS[playerid] != 0 && RaceCPS[playerid] != RaceI[CurrentRace][CPNUM] -1)
{
SetPlayerRaceCheckpoint(playerid, 0, RaceI[CurrentRace][X][RaceCPS[playerid] + 1], RaceI[CurrentRace][Y][RaceCPS[playerid] + 1], RaceI[CurrentRace][Z][RaceCPS[playerid] + 1], RaceI[CurrentRace][X][RaceCPS[playerid]+ 2], RaceI[CurrentRace][Y][RaceCPS[playerid] +2], RaceI[CurrentRace][Z][RaceCPS[playerid]+2], ;
RaceCPS[playerid] ++;
}
if(RaceCPS[playerid] == 0)
{
GameTextForPlayer(playerid, "~y~Welcome to the race!~n~~r~Stay in the red checkpoint!", 3000, 3);
}
if(RaceCPS[playerid] == RaceI[CurrentRace][CPNUM]-1)
{
SetPlayerRaceCheckpoint(playerid, 1, RaceI[CurrentRace][X][RaceCPS[playerid]], RaceI[CurrentRace][Y][RaceCPS[playerid]], RaceI[CurrentRace][Z][RaceCPS[playerid]], RaceI[CurrentRace][X][RaceCPS[playerid]+ 1], RaceI[CurrentRace][Y][RaceCPS[playerid] +1], RaceI[CurrentRace][Z][RaceCPS[playerid]+1], ;
LastCP[playerid] = 1;
}
return 1;
}
SetTimerEx("RaceEnd",60000 , false, "ii", playerid);
is the timer