11.10.2013, 12:40
Add an Id to the timer and kill it when the player is inside the area then start it again,
pawn Код:
new TimerId[MAX_PLAYERS];
TimerId[playerid] = SetTimerEx("VRepair",500,true,"i",playerid);
pawn Код:
new str[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(str, sizeof(str), "{09F7DF}(/cs) {ffd700}%s {09F7DF}has Teleported to Counter-Strike Deathmatch",pName);
GameTextForPlayer(playerid,"~y~Welcome to ~n~~b~Counter-Strike",2000,3);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
SetPlayerVirtualWorld(playerid, 11);
SetPlayerInterior(playerid, 0);
SetCameraBehindPlayer(playerid);
SaveWeapons(playerid);
ResetPlayerWeapons(playerid); //must be added before this
GivePlayerWeapon(playerid, 41, 100000);
GivePlayerWeapon(playerid, 24, 100000);
GivePlayerWeapon(playerid, 26, 100000);
GivePlayerWeapon(playerid, 28, 100000);
GivePlayerWeapon(playerid, 30, 100000);
GivePlayerWeapon(playerid, 33, 100000);
DestroyVehicle(GetPlayerVehicleID(playerid));
SendClientMessageToAll(0xFFFFFFFF, str);
new Random = random(sizeof(RandomSpawnCsDM));
SetPlayerPos(playerid, RandomSpawnCsDM[Random][0], RandomSpawnCsDM[Random][1], RandomSpawnCsDM[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawnCsDM[Random][3]);
KillTimer(TimerId[playerid]); // Here to stop repairing the car, You have to set the timer again when player leave the area
return 1;
}