Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Contagem regressiva, by Stewie`
- #include <a_samp>
- new
- COUNT_TIME,
- COUNT_INDEX;
- main() {
- return 1;
- }
- public OnPlayerSpawn(playerid) {
- Contar(20);
- return 1;
- }
- stock Contar(segundos) {
- if(COUNT_TIME)
- return false;
- COUNT_INDEX = segundos;
- return (COUNT_TIME = SetTimer("Loop", 1000, true));
- }
- forward Loop();
- public Loop() {
- if(COUNT_INDEX == -1) {
- SendClientMessageToAll(-1, "Vai Vai!");
- KillTimer(COUNT_TIME);
- COUNT_TIME = 0;
- return 1;
- }
- new msg[60];
- format(msg, sizeof(msg), "Contagem: %d", COUNT_INDEX);
- SendClientMessageToAll(-1, msg);
- COUNT_INDEX --;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment