@ Licolas
- agradeзo imenso a ajuda pela sua parte. mas dб alguns erros
Aqui estб o FS:
Код:
#include <a_samp>
forward VoltarAFK(playerid);
new TempoAFK;
gettime(TempoAFK);
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, "/afk", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFF0000AA, "USE: /afk [Minutos] [Motivo]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /afk [Minutos] [Motivo]");
return 1;
}
format(string, sizeof(string), "ADMIN CMD: %s Ficou AFK Por %d Minutos Motivo: %s", giveplayer, TempoAFK, sendername, (result));
SendClientMessageToAll(0xFF0000AA, string);
SetTimer("VoltarAFK",TempoAFK,false);
return 1;
}
}
}
return 1;
}
if (strcmp("/voltar", cmdtext, true, 10) == 0)
{
if(Afk[playerid]==1){
Afk[playerid]=0;
Timer[playerid] = SetTimer("SendMessage",100,0);
TogglePlayerControllable(playerid,1);
format(string, sizeof(string), "%s voltou para o server", Name);
SendClientMessageToAll(0x33CCFFAA, string);
}else{SendClientMessage(playerid,0xFF0000AA, "Voltaste ao servidor, continuaзao de um Bom RP*.");}
return 1;
}
if (strcmp("/listafk", cmdtext, true, 10) == 0)
{
if(IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, 0x33CCFFAA, "Jogadores AFK:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(Afk[i]==1)
{
GetPlayerName(i, Name, sizeof(Name));
format(string, 256, "Jogador: %s | Tempo: %d | Motivo: %s", Name,TempoAFK,(result));
SendClientMessage(playerid, 0xFFFFFFAA, string);
}
}
}
}
return 1;
}
public VoltarAFK(playerid)
{
TempoAFK = Kick(playerid);
SendClientMessage(playerid, 0xFF0000AA, "[AVISO] Fostes kickado por exceder o tempo limite de minutos AFK!");
return 1;
}
Код:
C:\Users\Pedro Nobre\Desktop\sistafk.pwn(4) : error 021: symbol already defined: "gettime"
C:\Users\Pedro Nobre\Desktop\sistafk.pwn(8) : error 017: undefined symbol "cmd"
C:\Users\Pedro Nobre\Desktop\sistafk.pwn(12) : error 017: undefined symbol "tmp"
C:\Users\Pedro Nobre\Desktop\sistafk.pwn(12) : error 017: undefined symbol "strtok"
C:\Users\Pedro Nobre\Desktop\sistafk.pwn(13) : error 017: undefined symbol "tmp"
C:\Users\Pedro Nobre\Desktop\sistafk.pwn(18) : error 017: undefined symbol "giveplayerid"
C:\Users\Pedro Nobre\Desktop\sistafk.pwn(18) : error 017: undefined symbol "ReturnUser"
C:\Users\Pedro Nobre\Desktop\sistafk.pwn(19) : error 017: undefined symbol "giveplayerid"
C:\Users\Pedro Nobre\Desktop\sistafk.pwn(21) : error 017: undefined symbol "giveplayerid"
C:\Users\Pedro Nobre\Desktop\sistafk.pwn(23) : error 017: undefined symbol "giveplayerid"
C:\Users\Pedro Nobre\Desktop\sistafk.pwn(23) : error 017: undefined symbol "giveplayer"
C:\Users\Pedro Nobre\Desktop\sistafk.pwn(23) : error 029: invalid expression, assumed zero
C:\Users\Pedro Nobre\Desktop\sistafk.pwn(23) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
13 Errors.