05.07.2012, 14:57
pawn Код:
if(strcmp(cmd, "/relatorio", true) == 0) {
if(IsPlayerConnected(playerid)) {
if(gPlayerLogged[playerid] == 0) {
SendClientMessage(playerid, COLOR_GREY, "Voce nгo estб logado!");
return 1;
}
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: /relatorio [texto]");
return 1;
}
if(gettime() - GetPVarInt(playerid, #lastCMD) < 10) {
SendClientMessage(playerid, COLOR_GRAD2, "Aguarde 10 segundos..");
}
format(string, sizeof(string), "[ATENЗГO] ==> Relatorio de %s(%d): %s", sendername, playerid, (result));
ABroadCast(COLOR_LIGHTBLUE,string,1);
SendClientMessage(playerid, COLOR_YELLOW, "Sua mensagem foi enviada б administraзгo,Aguarde uma resposta.");
SetPVarInt(playerid, #lastCMD, gettime());
}
return 1;
}