26.10.2012, 02:54
pawn Код:
if(!strcmp(cmd, "/relatorio", true) || !strcmp(cmd, "/relatorio", true))
{
if(gPlayerLogged[playerid] == 0)
return SendClientMessage(playerid, COLOR_GREY, "Vocк nгo estб logado!");
if(IsPlayerFlooding(playerid, 5)){
return SendClientMessage(playerid, -1,"SPAMM (5s)");
}
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))
return SendClientMessage(playerid, COLOR_GRAD2, "USE: /relatorio [texto]");
if(PlayerInfo[playerid][pVIP] == 1)
{
new lol;
lol = PlayerInfo[playerid][pVIP];
format(string, sizeof(string), "Relatorio VIP de %s - ID[%d]: %s ", sendername, playerid, lol, (result));
//HelperBroadCast(COLOR_YELLOW,string,1);
ABroadCast(COLOR_LIGHTBLUE,string,1);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Seu relatorios VIP foi enviado aos admins..");
}
else if(PlayerInfo[playerid][pVIP] == 2)
{
new lol;
lol = PlayerInfo[playerid][pVIP];
format(string, sizeof(string), "Relatorio VIP-POWER de %s - ID[%d]: %s ", sendername, playerid, lol, (result));
//HelperBroadCast(COLOR_YELLOW,string,1);
ABroadCast(COLOR_LIGHTBLUE,string,1);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Seu relatorio VIP-POWER foi enviado aos admins..");
}
else
{
format(string, sizeof(string), "Relatorio de %s(%d): %s ", sendername, playerid, (result));
//HelperBroadCast(COLOR_YELLOW,string,1);
ABroadCast(COLOR_YELLOW,string,1);
SendClientMessage(playerid, COLOR_YELLOW, "Seu relatorio foi enviado aos admins..");
}
}
return true;
}
Final:
PHP код:
stock IsPlayerFlooding(p, time){
static
getMessageTime [ MAX_PLAYERS char ]
;
if ( getMessageTime { p } != 0 ) {
if ( ( gettime() - getMessageTime { p } ) < time ){
getMessageTime { p } = gettime ( ) ;
return !false ;
}
}
getMessageTime { p } = gettime ( ) ;
return !true ;
}