18.08.2013, 22:03
Assim galera eu vo kikar um player ai Aparece q ele tomo ban alguem poder ajudar ai agradeзo !!1
Eu acho q e simples
Vou deixar aqui as stock , Defines e comandos.
defines
Stock se tiver algo q nгo tenha haver ignore .
Comando
Eu acho q e simples
Vou deixar aqui as stock , Defines e comandos.
defines
pawn Код:
#define Kick(%0) SetTimerEx("Kicka", 100, false, "i", %0)
#define Ban(%0) SetTimerEx("Banir", 100, false, "i", %0)
pawn Код:
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
adminspec_strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
SalvarPlayer(playerid)
{
new String[256];
format(String, sizeof(String), CONTAS, Nome(playerid));
DOF2_SetInt(String,"Administrador", PlayerInfo[playerid][pAdmin]);
DOF2_SetInt(String,"DRT", PlayerInfo[playerid][pDRT]);
DOF2_SetInt(String,"BTR", PlayerInfo[playerid][pBTR]);
return 1;
}
SetarPlayer(playerid)
{
new String[256];
format(String, sizeof(String), CONTAS, Nome(playerid));
PlayerInfo[playerid][pAdmin] = DOF2_GetInt(String, "Administrador");
PlayerInfo[playerid][pDRT] = DOF2_GetInt(String, "DRT");
PlayerInfo[playerid][pBTR] = DOF2_GetInt(String, "BTR");
return 1;
}
public PlayersOn()
{
AntiDeAMX();
new players, dinho[20];
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i)) players++;
}
format(dinho,sizeof(dinho)," Players On: %d",players);
TextDrawSetString(Textdraw10, dinho);
}
public Relogio(playerid)
{
AntiDeAMX();
new
string[256],
year,
month,
day,
hour,
minute,
second;
getdate(year, month, day);
gettime(hour, minute, second);
format(string, sizeof string, "~w~%d/%s%d/2013", day, ((month < 10) ? ("0") : ("")), month);
TextDrawSetString(Textdraw8, string);
format(string, sizeof string, "~w~%s%d:%s%d:%s%d", (hour < 10) ? ("0") : (""), hour, (minute < 10) ? ("0") : (""), minute, (second < 10) ? ("0") : (""), second);
TextDrawSetString(Textdraw9, string);
}
stock GetDistanceBetweenPlayers(playerid,playerid2)
{
AntiDeAMX();
new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
new Float:tmpdis;
GetPlayerPos(playerid,x1,y1,z1);
GetPlayerPos(playerid2,x2,y2,z2);
tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
return floatround(tmpdis);
}
forward Kicka(p);
public Kicka(p)
{
AntiDeAMX();
#undef Kick
Kick(p);
return 1;
}
forward Banir(p);
public Banir(p)
{
AntiDeAMX();
#undef Ban
Ban(p);
return 1;
}
stock Nome(playerid)
{
AntiDeAMX();
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
return name;
}
AntiDeAMX()
{
new a[][] =
{
"Unarmed (Fist)",
"Brass K"
};
#pragma unused a
}
pawn Код:
if(strcmp(cmd,"/kick",true) == 0)
{
if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid,COLOR_RED,"Erro: Vocк nгo tem permissгo.");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COR_USOCORRETO, "Uso correto: /ban [id do player] [motivo]");
return 1;
}
giveplayerid = strval(tmp);
giveplayerid = strval(tmp);
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid,COLOR_RED,"Erro: Este id estб offline.");
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))
{
result = "N/A";
}
new cargos[64];
if(PlayerInfo[playerid][pAdmin] == 1) { cargos = "Administrador"; }
if(PlayerInfo[playerid][pAdmin] == 2) { cargos = "Administrador"; }
if(PlayerInfo[playerid][pAdmin] == 3) { cargos = "Administrador"; }
if(PlayerInfo[playerid][pAdmin] == 4) { cargos = "Sub Game Master"; }
if(PlayerInfo[playerid][pAdmin] == 5) { cargos = "Game Master"; }
format(string, sizeof(string), "AdmCMD: %s foi banido pelo %s %s | Motivo: %s", Nome(giveplayerid),cargos,Nome(playerid),result);
SendClientMessageToAll(0xFF7777AA, string);
Ban(giveplayerid);
return 1;
}
if(strcmp(cmd,"/kick",true) == 0)
{
if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pDRT] < 1) return SendClientMessage(playerid,COLOR_RED,"Erro: Vocк nгo tem permissгo.");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COR_USOCORRETO, "Uso correto: /kick [id do player] [motivo]");
return 1;
}
giveplayerid = strval(tmp);
giveplayerid = strval(tmp);
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid,COLOR_RED,"Erro: Este id estб offline.");
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))
{
result = "N/A";
}
new cargos[64];
if(PlayerInfo[playerid][pDRT] == 1) { cargos = "Diretor"; }
if(PlayerInfo[playerid][pAdmin] == 1) { cargos = "Administrador"; }
if(PlayerInfo[playerid][pAdmin] == 2) { cargos = "Administrador"; }
if(PlayerInfo[playerid][pAdmin] == 3) { cargos = "Administrador"; }
if(PlayerInfo[playerid][pAdmin] == 4) { cargos = "Sub Game Master"; }
if(PlayerInfo[playerid][pAdmin] == 5) { cargos = "Game Master"; }
format(string, sizeof(string), "AdmCMD: %s foi kickado pelo %s %s | Motivo: %s", Nome(giveplayerid),cargos,Nome(playerid),result);
SendClientMessageToAll(0xFF7777AA, string);
Kick(giveplayerid);
return 1;
}