Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <dini>
- #include <zcmd>
- #include <sscanf>
- #define cPadrao 0xE9433FFF
- #define MAX_CHAR 5
- #define LOCAL_TAGCONF "Tags/config.ini"
- CheckPrefix(playerid)
- {
- new pref[16], Name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
- format ( pref, sizeof ( pref ), dini_Get(LOCAL_TAGCONF, Name));
- return pref;
- }
- public OnFilterScriptInit()
- {
- if ( !fexist(LOCAL_TAGCONF))
- {
- dini_Create(LOCAL_TAGCONF);
- if ( !fexist(LOCAL_TAGCONF))
- {
- print("Config.ini nao pode ser criado. ( Diretorio Inexistente )");
- print("No diretorio scriptfiles crie uma pasta: TAGS");
- return 1;
- }
- }
- return 1;
- }
- CMD:setprefix(playerid, params[])
- {
- if ( !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, cPadrao, "Você precisar ser um admin para usar isso.");
- new ide, prefix[16];
- if ( sscanf ( params, "us", ide, prefix)) return SendClientMessage(playerid, cPadrao, "Parametros errados");
- if ( !IsPlayerConnected(ide)) return SendClientMessage(playerid, cPadrao, "ID não encontrado");
- if ( strlen( prefix ) > MAX_CHAR ) return SendClientMessage(playerid, cPadrao, "Você estourou o limite de caracteres.");
- new Str[128], Name[MAX_PLAYER_NAME];
- GetPlayerName(ide, Name, MAX_PLAYER_NAME);
- format ( Str, sizeof ( Str ), "Sua TAG foi alterada para: {E9433F}%s",prefix);
- SendClientMessage(ide, -1, Str);
- format ( Str, sizeof ( Str ), "Você alterou a tag de {E9433F}%s{FFFFFF} para{E9433F} %s", Name, prefix);
- SendClientMessage(playerid, -1, Str);
- dini_Set(LOCAL_TAGCONF, Name, prefix);
- return 1;
- }
- CMD:prefixoff(playerid, params[])
- {
- if ( !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, cPadrao, "Você precisar ser um admin para usar isso.");
- new Name[MAX_PLAYER_NAME], prefix[16];
- if ( sscanf ( params, "ss", Name, prefix)) return SendClientMessage(playerid, cPadrao, "Parametros errados");
- dini_Set( LOCAL_TAGCONF, Name, prefix);
- new Str[128];
- format ( Str, 128, "Você setou o a tag de %s para %s", Name, prefix);
- SendClientMessage(playerid, cPadrao, Str);
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if ( strcmp(CheckPrefix(playerid), "None", false))
- {
- new Str[128], Name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
- format ( Str, sizeof ( Str ), "%s%s: %s", CheckPrefix(playerid), Name, text);
- SendClientMessageToAll(-1, Str);
- return 0;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement