29.07.2009, 12:02
Ok look this is the problem i got it..
and
This is with Timer So how can i remove it by command ?? like /counter off
Код:
if(strcmp(cmdtext, "/counter", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new tmpcar = GetPlayerVehicleID(playerid) - 1;
if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 5)
{
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_VEH, " You are not in a car.");
return 1;
}
if(DynamicCars[tmpcar][FactionCar] != PlayerInfo[playerid][pFaction])
{
SendClientMessage(playerid, COLOR_VEH, " You are not in a faction vehicle.");
return 1;
}
PlayerActionMessage(playerid,15.0,"turns on the counter.");
SetTimer("countdown",500,0);
}
}
else
{
SendClientMessage(playerid, COLOR_VEH, "Invalid Faction.");
return 1;
}}
Код:
forward countdown(playerid);
public countdown(playerid)
{
static loops = 10;
if (loops)
{
new cdtimer = SetTimer("countdown", 3000, 0);
#pragma unused cdtimer
new str[256];
format(str, sizeof (str), "~w~Counter: %d$", loops);
GameTextForPlayer(playerid,str,1000,4);
for(new i=0; i<MAX_PLAYERS; i++) {
if (IsPlayerConnected(i))
{
}
}
loops++;
}
else
{
for(new i=0; i<MAX_PLAYERS; i++) {
{
if (IsPlayerConnected(i))
{
}
}
loops = 10;
}
}
}

