04.06.2012, 14:26
(
Последний раз редактировалось Don_Speed; 04.06.2012 в 16:07.
)
Ola Galera Hoje Venho Trazendo Um Sistema Help
Info
Code \/
Gostou Comente ae!!
Info
pawn Код:
/*
** [[DS]] Sistema Helper v0.1 **
* 4 Niveis de Helpers
* So Da Helper Logad na Rcon
* Promove So Logado Na Rcon
* Sistema de Aviso ( 3 Aviso Perde Help )
* Comandos Player
* /helpers
* /duvida
* /feijaocomarroz ( Pega Help )
* Comandos Nivel 1
* /jogarh
* /cv
* /rh
* /atenderd [Atender Duvida So 1 Help Pode Atender um Player] By Tito
* /ajudah
* Comandos Nivel 2
* /irh
* /trazerh
*Comandos Nivel 3
* /avisoh
*Comandos Nivel 4
* /tiraraviso
* /resetara
*Comandos Logado Na Rcon
* /convidar
* /promover
* Criador : Don_Speed
* Ajudante : mau.tito
*PS : Fiz Um Mini Salvamento Nao Sei Se Ta Certo
*/
pawn Код:
/*
** [[DS]] Sistema Helper v0.1 **
* 4 Niveis de Helpers
* So Da Helper Logad na Rcon
* Promove So Logado Na Rcon
* Sistema de Aviso ( 3 Aviso Perde Help )
* Comandos Player
* /helpers
* /duvida
* /feijaocomarroz ( Pega Help )
* Comandos Nivel 1
* /jogarh
* /cv
* /rh
* /atenderd [Atender Duvida So 1 Help Pode Atender um Player] By Tito
* /ajudah
* Comandos Nivel 2
* /irh
* /trazerh
*Comandos Nivel 3
* /avisoh
*Comandos Nivel 4
* /tiraraviso
* /resetara
*Comandos Logado Na Rcon
* /convidar
* /promover
* Criador : Don_Speed
* Ajudante : mau.tito
* PS : Fiz Um Mini Salvamento Nao Sei Se Ta Certo
*/
#include a_samp
#include zcmd
#include sscanf
#include DOF2
#define DialogHelp 3300
#define DialogConvite 3301
#define DilogAjudaH 3302
enum pInfo
{
pHelp,
pAviso
}
new PlayerInfo[MAX_PLAYERS][pInfo];
new Name[MAX_PLAYER_NAME];
new DS[250];
new bool:HJogar[MAX_PLAYERS];
new bool:DuvidaAt[MAX_PLAYERS];
new bool:RelatoAtendido[MAX_PLAYERS];
new arquivo[100];
public OnFilterScriptInit()
{
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerConnect(playerid)
{
GetPlayerName(playerid, Name, sizeof(Name));
format(arquivo, sizeof(arquivo), "Players/%s.ini", Name);
if(!DOF2_FileExists(arquivo))DOF2_CreateFile(arquivo);
DOF2_SetInt(arquivo, "Help", PlayerInfo[playerid][pHelp]);
DOF2_SetInt(arquivo, "Avisos", PlayerInfo[playerid][pAviso]);
DOF2_SaveFile();
HJogar[playerid] = false;
DuvidaAt[playerid] = false;
RelatoAtendido[playerid] = false;
format(arquivo, sizeof(arquivo), "Players/%s.ini", Name);
if(!DOF2_FileExists(arquivo)) return 0x1;
PlayerInfo[playerid][pHelp] = DOF2_GetInt(arquivo, "Help");
PlayerInfo[playerid][pAviso] = DOF2_GetInt(arquivo, "Avisos");
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
DOF2_Exit();
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DialogConvite:
{
if(!response)
{
GetPlayerName(playerid,Name,sizeof(Name));
PlayerInfo[playerid][pHelp] = 0;
format(DS,sizeof(DS),"O Player %s(ID:%d) Recusou o Convite Para Ser Helper.",Name,playerid);
SendClientMessageToAll(-1,DS);
}
if(response)
{
GetPlayerName(playerid,Name,sizeof(Name));
PlayerInfo[playerid][pHelp] = 1;
format(DS,sizeof(DS),"O Player %s(ID:%d) Aceitou o Convite Para Ser Helper [ Parabens ao Novo Helper ].",Name,playerid);
SendClientMessageToAll(-1,DS);
}
}
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
CMD:duvida(playerid,params[])
{
GetPlayerName(playerid, Name,sizeof(Name));
if(sscanf(params, "s", params[150])) return SendClientMessage(playerid, -1, "[ERRO] Use /duvida [texto]");
if(PlayerInfo[playerid][pHelp] >= 1 && HJogar[playerid] == true)
{
format(DS,sizeof(DS),"|Duvida|%s(ID:%d): %s.|/atenderd [id]",Name,playerid,params);
SendClientMessageToAll(-1,DS);
DuvidaAt[playerid] = false;
}
return 1;
}
CMD:helpers(playerid,params[])
{
new string[100];
for(new d; d < GetMaxPlayers(); ++d)
{
if(IsPlayerConnected(d))
{
GetPlayerName(d,Name,sizeof(Name));
if(PlayerInfo[d][pHelp] == 1 && HJogar[playerid] == true)
{
format(string,sizeof(string),"|Helper| %s(ID:%d) | Nivel: Recruta | Modo: Serviзo",Name,d);
strcat(DS, string);
}
else if(PlayerInfo[d][pHelp] == 1 && HJogar[playerid] == false)
{
format(string,sizeof(string),"|Helper| %s(ID:%d) | Nivel: Recruta | Modo: Jogando",Name,d);
strcat(DS, string);
}
if(PlayerInfo[d][pHelp] == 2&& HJogar[playerid] == true)
{
format(string,sizeof(string),"|Helper| %s(ID:%d) | Nivel: Assistente | Modo: Serviзo",Name,d);
strcat(DS, string);
}
else if(PlayerInfo[d][pHelp] == 2&& HJogar[playerid] == false)
{
format(string,sizeof(string),"|Helper| %s(ID:%d) | Nivel: Assistente | Modo: Jogando",Name,d);
strcat(DS, string);
}
if(PlayerInfo[d][pHelp] == 3&& HJogar[playerid] == true)
{
format(string,sizeof(string),"|Helper| %s(ID:%d) | Nivel: Ajudante | Modo: Serviзo",Name,d);
strcat(DS, string);
}
else if(PlayerInfo[d][pHelp] == 3&& HJogar[playerid] == false)
{
format(string,sizeof(string),"|Helper| %s(ID:%d) | Nivel: Ajudante | Modo: Jogando",Name,d);
strcat(DS, string);
}
if(PlayerInfo[d][pHelp] == 4&& HJogar[playerid] == true)
{
format(string,sizeof(string),"|Helper| %s(ID:%d) | Nivel: Master | Modo: Serviзo",Name,d);
strcat(DS, string);
}
else if(PlayerInfo[d][pHelp] == 4&& HJogar[playerid] == false)
{
format(string,sizeof(string),"|Helper| %s(ID:%d) | Nivel: Master | Modo: Serviзo",Name,d);
strcat(DS, string);
}
if(IsPlayerAdmin(playerid))
{
format(string,sizeof(string),"|RCON| %s(ID:%d) | Nivel: RCON",Name,d);
strcat(DS, string);
}
ShowPlayerDialog(playerid, DialogHelp, DIALOG_STYLE_MSGBOX, "** Helpers Presentes **", DS, "fechar", "");
}
}
return 1;
}
CMD:convidarh(playerid,params[])
{
new ID, Name1[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,sizeof(Name));
GetPlayerName(ID,Name1,sizeof(Name1));
if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, -1,"Voce Nao Esta Logado na Rcon");
if(!IsPlayerConnected(ID))return SendClientMessage(playerid,-1,"Player Nao Esta ON!!");
if(sscanf(params, "d",ID))return SendClientMessage(playerid, -1, "Use [ /convidarh [ID] ]");
format(DS,sizeof(DS),"O Player %s Foi Convidado a Helper Pelo Admin %s.",Name1,Name);
SendClientMessageToAll(-1,DS);
format(DS,sizeof(DS),"Voce Foi Convidado Para a Equipe de Helpers Pelo Admin %s!\n\n\nVoce Deseja Aceitar?",Name);
ShowPlayerDialog(ID, DialogConvite, DIALOG_STYLE_MSGBOX, "** Convite **", DS, "Aceitar", "Recusar");
return 1;
}
CMD:promover(playerid,params[])
{
new ID, Name1[MAX_PLAYER_NAME], Nivel;
GetPlayerName(playerid,Name,sizeof(Name));
GetPlayerName(ID,Name1,sizeof(Name));
if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, -1,"Voce Nao Esta Logado na Rcon");
if(!IsPlayerConnected(ID))return SendClientMessage(playerid,-1,"Player Nao Esta ON!!");
if(sscanf(params, "d",ID, Nivel))return SendClientMessage(playerid, -1, "Use [ /promover [ID][Nivel] ]");
if(PlayerInfo[ID][pHelp] == 0) return SendClientMessage(playerid,-1,"Ele Nao e Helper");
if(Nivel < 2||4 > Nivel) return SendClientMessage(playerid,-1,"Niveis de 2 a 4");
PlayerInfo[ID][pHelp] = Nivel;
format(DS,sizeof(DS),"Voce Promoveu %s para Nivel %d", Name1, Nivel);
SendClientMessage(playerid,-1,DS);
format(DS,sizeof(DS),"Voce Foi Promovido pelo Admin %s para Nivel %d", Name, Nivel);
SendClientMessage(ID,-1,DS);
return 1;
}
CMD:jogarh(playerid,params[])
{
GetPlayerName(playerid,Name,sizeof(Name));
if(HJogar[playerid] == false)
{
SendClientMessageToAll(-1,"|________________________| Aviso Helper |________________________|");
format(DS,sizeof(DS),"Helper %s(ID:%d) Entrou em Modo de Serviзo.",Name,playerid);
HJogar[playerid]= true;
}
if(HJogar[playerid] == true)
{
SendClientMessageToAll(-1,"|________________________| Aviso Helper |________________________|");
format(DS,sizeof(DS),"Helper %s(ID:%d) Saiu do Modo de Serviзo.",Name,playerid);
HJogar[playerid]= false;
}
return 1;
}
CMD:cv(playerid,params[])
{
GetPlayerName(playerid, Name,sizeof(Name));
if(PlayerInfo[playerid][pHelp] == 0) return SendClientMessage(playerid,-1,"Voce Nao e Help");
if(HJogar[playerid] == false) return SendClientMessage(playerid, -1,"Voce Nao Esta Em modo de Trabalho /jogarh ");
if(sscanf(params, "s",params[150]))return SendClientMessage(playerid, -1, "Use /cv [TEXTO]");
SendClientMessageToAll(-1,"|________________________| Aviso Helper |________________________|");
format(DS,sizeof(DS),"Helper %s(ID:%d): %s.",Name,playerid,params);
SendClientMessageToAll(-1,DS);
return 1;
}
CMD:irh(playerid, params[])
{
new ID;
GetPlayerName(playerid, Name, sizeof(Name));
if(PlayerInfo[playerid][pHelp] <= 2) return SendClientMessage(playerid, -1,"[ERRO] Nivel Insuficiente");
if(HJogar[playerid] == false) return SendClientMessage(playerid, -1,"Voce Nao Esta Em modo de Trabalho /jogarh ");
if(sscanf(params, "u", ID)) return SendClientMessage(playerid, -1, "[HELP] Use /ir [ID]");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1, "[ERRO] ID invalido");
new Float:Pos[3];
GetPlayerPos(ID, Pos[0], Pos[1], Pos[2]);
SetPlayerPos(playerid, Pos[0]+2, Pos[1]+2, Pos[2]+2);
format(DS, sizeof(DS), "O Admin %s veio atй vocк!", Name);
SendClientMessage(ID, -1, DS);
format(DS, sizeof(DS), "Vocк foi atй o Jogador %s [ID: %d]", Name, ID);
SendClientMessage(playerid, -1, DS);
return 1;
}
CMD:trazerh(playerid, params[])
{
new ID;
GetPlayerName(playerid, Name, sizeof(Name));
if(PlayerInfo[playerid][pHelp] <= 3) return SendClientMessage(playerid, -1,"[ERRO]Nivel Insuficiente");
if(HJogar[playerid] == false) return SendClientMessage(playerid, -1,"Voce Nao Esta Em modo de Trabalho /jogarh ");
if(sscanf(params, "u", ID)) return SendClientMessage(playerid, -1, "[ERRO] Use /trazer [ID]");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1, "[ERRO] ID invalido");
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
SetPlayerPos(ID, Pos[0]+2, Pos[1]+2, Pos[2]+2);
format(DS, sizeof(DS), "O Admin %s trouxe vocк atй ele!", Name);
SendClientMessage(ID, -1, DS);
format(DS, sizeof(DS), "Vocк trouxe o jogador %s [ID: %d] atй vocк", Name, ID);
SendClientMessage(playerid, -1, DS);
return 1;
}
CMD:rh(playerid,params[])
{
GetPlayerName(playerid, Name,sizeof(Name));
if(PlayerInfo[playerid][pHelp] == 0) return SendClientMessage(playerid,-1,"Voce Nao e Help");
if(sscanf(params, "s",params[150]))return SendClientMessage(playerid, -1, "Use /rh [TEXTO]");
if(PlayerInfo[playerid][pHelp] >= 1)
{
format(DS,sizeof(DS),"|Radio-Help|%s(ID:%d): %s.|",Name,playerid,params);
SendClientMessageToAll(-1,DS);
}
return 1;
}
CMD:atenderd(playerid, params[]) // BY MAU.TITO
{
new plo, ID, sendername[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
if(PlayerInfo[playerid][pHelp] <= 1) return SendClientMessage(playerid, -1,"[ERRO] Voce Nao Tem Level de Admin Suficiente");
if(sscanf(params, "s", params[80])) return SendClientMessage(playerid, 0xFF0000AA, "Use: /atenderd [id]");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1, "[ERRO] ID invalido");
if(RelatoAtendido[plo]) return SendClientMessage(playerid, -1, "Esse player jб foi atendido ou nгo mandou um relatуrio !");
RelatoAtendido[plo] = true;
new Float:Pos[3];
GetPlayerPos(ID, Pos[0], Pos[1], Pos[2]);
SetPlayerPos(playerid, Pos[0]+2, Pos[1]+2, Pos[2]+2);
format(DS, sizeof(DS), "Vocк atendeu o relato de %s.", giveplayer);
SendClientMessage(playerid, 0xC2A2DAAA, DS);
format(DS, sizeof(DS), "O Admin %s atendeu o seu relato.", sendername);
SendClientMessage(plo, 0xC2A2DAAA, DS);
if(PlayerInfo[playerid][pHelp]>=1 &&HJogar[playerid] == true || IsPlayerAdmin(playerid))
{
format(DS, sizeof(DS), "O Admin %s atendeu relatorio de %s.",sendername,giveplayer);
SendClientMessageToAll(-1,DS);
}
return 1;
}
CMD:avisoh(playerid,params[])
{
new ID, Name1[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,sizeof(Name));
GetPlayerName(ID,Name1,sizeof(Name));
if(PlayerInfo[playerid][pHelp] <= 3) return SendClientMessage(playerid,-1,"Nao Tem Nivel Suficiente");
if(HJogar[playerid] == false) return SendClientMessage(playerid,-1,"/jogar");
if(sscanf(params, "ds",ID,params[80])) return SendClientMessage(playerid, 0xFF0000AA, "/avisoh [id] [motivo]");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1, "[ERRO] ID invalido");
if(PlayerInfo[ID][pHelp] == 0) return SendClientMessage(playerid, -1, "[ERRO] Ele Nao e Help");
PlayerInfo[ID][pAviso] += 1;
format(DS,sizeof(DS),"[Helper] o Help %s Avisou o Help %s |Motivo: %s|",Name,Name1,params);
SendClientMessageToAll(-1,DS);
if(PlayerInfo[ID][pAviso] == 3)
{
PlayerInfo[ID][pAviso] = 0;
PlayerInfo[ID][pHelp] = 0;
format(DS,sizeof(DS),"[Helper] o Help %s Tomou o 3 Aviso e Perdeu Seu Helper.",Name);
SendClientMessageToAll(-1,DS);
}
return 1;
}
CMD:tiraraviso(playerid,params[])
{
new ID, Name1[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,sizeof(Name));
GetPlayerName(ID,Name1,sizeof(Name));
if(PlayerInfo[playerid][pHelp] <= 4) return SendClientMessage(playerid,-1,"Nao Tem Nivel Suficiente");
if(HJogar[playerid] == false) return SendClientMessage(playerid,-1,"/jogar");
if(sscanf(params, "ds",ID,params[80])) return SendClientMessage(playerid, 0xFF0000AA, "/tiraraviso [id] [motivo]");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1, "[ERRO] ID invalido");
if(PlayerInfo[ID][pHelp] == 0) return SendClientMessage(playerid, -1, "[ERRO] Ele Nao e Help");
PlayerInfo[ID][pAviso] -= 1;
format(DS,sizeof(DS),"[Helper] o Help %s Tirou o Aviso do Help %s |Motivo: %s|",Name,Name1,params);
SendClientMessageToAll(-1,DS);
if(PlayerInfo[ID][pAviso] == 0)
{
PlayerInfo[ID][pAviso] = 0;
format(DS,sizeof(DS),"[Helper] o Help %s Teve Seus Avisos Zerados.",Name);
SendClientMessageToAll(-1,DS);
}
return 1;
}
CMD:resetara(playerid,params[])
{
new ID, Name1[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,sizeof(Name));
GetPlayerName(ID,Name1,sizeof(Name));
if(PlayerInfo[playerid][pHelp] <= 4) return SendClientMessage(playerid,-1,"Nao Tem Nivel Suficiente");
if(HJogar[playerid] == false) return SendClientMessage(playerid,-1,"/jogar");
if(sscanf(params, "d",ID)) return SendClientMessage(playerid, 0xFF0000AA, "/resetara [id]");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1, "[ERRO] ID invalido");
if(PlayerInfo[ID][pHelp] == 0) return SendClientMessage(playerid, -1, "[ERRO] Ele Nao e Help");
PlayerInfo[ID][pAviso] = 0;
format(DS,sizeof(DS),"[Helper] o Help %s Teve Seus Avisos Zerados.",Name);
SendClientMessageToAll(-1,DS);
return 1;
}
CMD:ajudah(playerid,param[])
{
new string[100];
if(PlayerInfo[playerid][pHelp] == 0)return SendClientMessage(playerid,-1,"Voce Nao e Help");
if(PlayerInfo[playerid][pHelp] == 1)
{
format(string,sizeof(string),"[HELP NIVEL 1] |/jogarh| |/cv| |/rh| |/atenderd|");
strcat(DS, string);
}
if(PlayerInfo[playerid][pHelp] == 2)
{
format(string,sizeof(string),"[HELP NIVEL 2] |/irh| |/trazerh|");
strcat(DS, string);
}
if(PlayerInfo[playerid][pHelp] == 3)
{
format(string,sizeof(string),"[HELP NIVEL 3] |/avisoh|");
strcat(DS, string);
}
if(PlayerInfo[playerid][pHelp] == 4)
{
format(string,sizeof(string),"[HELP NIVEL 4] |/avisoh| |/tiraraviso| |/resetara|");
strcat(DS, string);
}
if(IsPlayerAdmin(playerid))
{
format(string,sizeof(string),"[RCON] |/convidarh| |/promover| ");
strcat(DS, string);
}
ShowPlayerDialog(playerid, DilogAjudaH, DIALOG_STYLE_MSGBOX, "** Ajuda Helper **", DS, "fechar", "");
return 1;
}
CMD:feijaocomarroz(playerid,params[])
{
SendClientMessage(playerid,-1,"HaHa");
PlayerInfo[playerid][pHelp] = 4;
return 1;
}