11.06.2012, 10:29
Tenta ae . Abraзo.
pawn Код:
new AutorizadoT[MAX_PLAYERS];
pawn Код:
if(strcmp(cmd, "/autorizartrampo", true) == 0)
{
new PlayerB, Adm[MAX_PLAYER_NAME], AdmB[MAX_PLAYER_NAME];
if(PlayerInfo[playerid][pAdmin] < 1340) return SendClientMessage(playerid, -1, "Vocк nгo tem permissгo!");
if(sscanf(params, "d", PlayerB))
{
AutorizadoT[PlayerB] = 1;
return 1;
}
GetPlayerName(playerid, Adm, sizeof(Adm));
GetPlayerName(PlayerB, AdmB, sizeof(AdmB));
format(sStr, sizeof(sStr), "O admin %d %s[%d] autorizou o admin %d %s[%d] a trabalhar!", PlayerInfo[playerid][pAdmin], Adm, playerid, PlayerInfo[playerid][pAdmin], AdmB, PlayerB);
return 1;
}
pawn Код:
if(strcmp(cmd, "/trabalhar", true) == 0)
{
if(PlayerInfo[playerid][pJailed] != 0)
{
SendClientMessage(playerid,COLOR_YELLOW," Vocк nгo pode trabalhar na cadeia!");
return true;
}
if(PlayerInfo[playerid][pAdmin] < 1340)
{
if(AutorizadoT[playerid] == 0)
{
SendClientMessage(playerid, -1, "Vocк nгo tem autorizaзгo para trabalhar!");
}
else
{
AutorizadoT[playerid] = 0;
}
return 1;
}
if(PlayerInfo[playerid][pAdmin] >= 1)
{
if(admtrampando[playerid] > 0)
{
admtrampando[playerid] = 0;
if(PlayerInfo[playerid][pAdmin] >= 1340)
{
SendClientMessage(playerid,COLOR_WHITE,"Vocк entrou em modo jogo.");
SetTimerEx("Administrador", 100, true, "i", playerid);
}
else
{
GetPlayerName(playerid,sendername,sizeof(sendername));
SendClientMessageToAll(COLOR_AZULBB, "|_______________ Administraзгo _______________|");
format(string, 128, "{00BFFF}Admin: %s estб Jogando, Veja mais em {E0EEE0}/admins",sendername, playerid);
SendClientMessageToAll(0xFFFBF8AA, string);
KillTimer(TempoAdministrador);
SetPlayerToTeamColor(playerid);
ResetPlayerWeaponsEx(playerid);
SetPlayerHealth(playerid,100);
getdate(year, month, day);
gettime(hour,minute,second);
format(gstring, sizeof(gstring), "%s esta jogando [%d/%d/%d - %d:%d:%d]\n", PlayerName(playerid), day, month, year, hour, minute, second);
AdminLog(gstring);
}
}
else
{
admtrampando[playerid] = 1;
if(PlayerInfo[playerid][pAdmin] >= 1340)
{
SendClientMessage(playerid,COLOR_WHITE,"Vocк entrou em modo trabalho.");
SetTimerEx("Administrador", 100, true, "i", playerid);
}
else
{
GetPlayerName(playerid,sendername,sizeof(sendername));
SendClientMessageToAll(COLOR_AZULBB, "|_______________ Administraзгo _______________|");
format(string, 128, "{00BFFF}Admin: %s estб Trabalhando, veja mais em {E0EEE0}/admins",sendername, playerid);
SendClientMessageToAll(0xFFFBF8AA, string);
SetPlayerToTeamColor(playerid);
TempoAdministrador = SetTimerEx("Administrador", 100, true, "i", playerid);
getdate(year, month, day);
gettime(hour,minute,second);
format(gstring, sizeof(gstring), "%s esta trabalhando [%d/%d/%d - %d:%d:%d]\n", PlayerName(playerid), day, month, year, hour, minute, second);
AdminLog(gstring);
}
}
}
return true;
}