11.07.2012, 20:45
Eu queria um timer (sabe akeles negocio de /contar dai 3,2,1 go)so para adm level3 pra cima e que quando o timer for acionado,ninguem podera se mecher assim nao havera trapaзa,Podem azer isso por gentileza para mim??
new tempo = 3;
CMD:contar(playerid) {
Contar();
SendClientMessage(playerid, -1, "Contagem iniciada!");
for(new i; i < MAX_PLAYERS; ++i) {
TogglePlayerControllable(i, false);
}
return true;
}
forward Contar();
public Contar() {
if(!tempo) {
tempo = 3;
GameTextForAll("GO !", 2000, 4);
for(new i; i < MAX_PLAYERS; ++i) {
TogglePlayerControllable(i, true);
}
return false;
}
new s[128];
format(s, 128, "%i", tempo);
GameTextForAll(s, 2000, 4);
SetTimer("Contar", 1000, false);
tempo --;
return true;
}
pawn Код:
|
if (strcmp(cmdtext, "/contar", true)==0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] > 0){
if(Count >= 3)
{
SendClientMessage(playerid, 0x33AA33AA, "(INFO) Contador й iniciado!");
CountDown();
return 1;
}else{
SendClientMessage(playerid, 0xAA3333AA, "(ERRO) Contador jб estб ativado!");
return 1;
}
}
}
if (strcmp(cmdtext, "/contar", true)==0)
{
Contar();
SendClientMessage(playerid, -1, "Contagem iniciada!");
for(new i; i < MAX_PLAYERS; ++i) {
TogglePlayerControllable(i, false);
}
return true;
}
forward Contar();
public Contar() {
if(!tempo) {
tempo = 3;
GameTextForAll("GO !", 2000, 4);
for(new i; i < MAX_PLAYERS; ++i) {
TogglePlayerControllable(i, true);
}
return false;
}
new s[128];
format(s, 128, "%i", tempo);
GameTextForAll(s, 2000, 4);
SetTimer("Contar", 1000, false);
tempo --;
return true;
}
Topo do GM:
new tempo = 3; Bota dentro da public OnPlayerCommandText: pawn Код:
pawn Код:
|
De nada , mas lembrando que do jeito que tб aн todo mundo vai poder usar o comando, manda algum comando seu de admin para adaptar se quizer.
|
if(strcmp(cmd,"/minigun",true)==0){
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] == 4 || pAdmin[playerid] == 5){
GivePlayerWeapon(playerid, 38, 999999);
return 1;
}
}