04.08.2010, 17:26
Bem , eu tenho um GM do Caio Cartaxo ja a algum tempo e tal , ele tem um sistema de afk mas й para toda gente , eu queria colocar esse sistema sу para os admins '-'
Aqui fica o codigo '-'
Se precisarem de um codigo de um comando que precisa ser admin , fica aki o de kickar
Aqui fica o codigo '-'
pawn Код:
if(strcmp(cmdtext, "/afk", true) == 0)
{
if(AFK[playerid]==0)
{
AFK[playerid]=1;
SetPlayerVirtualWorld(playerid, 1);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid,0);
TextDrawShowForPlayer(playerid,AfkText);
TextDrawShowForPlayer(playerid,AfkBackText);
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s (%d) Estб AFK (/AFK)", playername, playerid);
SendClientMessageToAll(COLOR_RED, string);
}
else
{
SendClientMessage(playerid,COLOR_RED,"Vocк jб estб AFK");
return 1;
}
return 1;
}
if (strcmp(cmdtext, "/online", true) == 0)
{
if(AFK[playerid]==1)
{
AFK[playerid]=0;
SetPlayerVirtualWorld(playerid, 0);
//SpawnPlayer(playerid);
TogglePlayerControllable(playerid,1);
TextDrawHideForPlayer(playerid,AfkText);
TextDrawHideForPlayer(playerid,AfkBackText);
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s (%d) Voltou a jogar (/online)", playername, playerid);
SendClientMessageToAll(VERDE, string);
}
else
{
SendClientMessage(playerid,COLOR_RED,"Vocк ja estб online!");
return 1;
}
return 1;
}
pawn Код:
if(strcmp(cmd, "/skick", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /skick [Id Do Jogador] [motivo]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
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: /skick [Id Do Jogador] [motivo]");
return 1;
}
new year, month,day;
getdate(year, month, day);
format(string, sizeof(string), "(AdminCmd) - %s Foi kickado Por %s, Motivo: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
KickLog(string);
format(string, sizeof(string), "(AdminCmd) - %s Foi Kickado Por %s, Motivo: %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
Kick(giveplayerid);
return 1;
}
}
}
else
{
format(string, sizeof(string), " %d Nгo estб on.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}