[Ajuda] Tag buga com Admin
#1

Galera eu vi um FS e achei muito top esse aqui > https://sampforum.blast.hk/showthread.php?tid=618044
Entгo eu botei no meu server й bem massa sу que tem um problema ele buga com o chat admin quando o player estб com tag nгo consegue falar no chat admin, cod do chat adm:
PHP код:

    
if(text[0] == '#' && PlayerInfo[playerid][Level] >= 1) {
        new 
string[128]; GetPlayerName(playerid,string,sizeof(string));
        
format(string,sizeof(string),"{FFFF00}.|Chat Administraзгo|.{00FF2F} %s [%i]: %s",string,playerid,text[1]); MessageToAdmins(green,string);
        return 
0;
    } 
nгo entendo o que tenho que fazer pra funcionar o chat adm mesmo com tag '-' aqui estб o cуdigo do bgl de setar tag: http://pastebin.com/n2umQPDZ
Reply
#2

Ve se pega ae

PHP код:
/*
Nгo retire os creditos afinal nгo foi vocк que fez!
Comandos
/SetTag (id) (tag) <-- este comando seta a tag no player
/UnSetTag (id) <-- Escomando retira a tag setada no player
Bom Como nгo uso zcmd nгo testei esse mais deve estar funcionando
*/
//Includes
#include <a_samp>
#include <dini>
#include <zcmd>
#include <sscanf2>
//...
#define LOCAL "tags.txt" //Local onde ficara salvo as tags setadas
#define COR_TAG 00FF00 //Coloque aqui a cor da tag em codigo HEX, Vermelho=FF0000 , Azul=0000FF , Amarelo=FFFF00 , Branco=FFFFFF , Preto=000000
#define LETRAS 3 // Tamanho minimo da tag
// Variaveis
new tag[MAX_PLAYERS];
new 
PlayerTag[MAX_PLAYERS][80];
//============================================================
public OnFilterScriptInit()
{
    for(new 
all 0all MAX_PLAYERS; ++all){if(IsPlayerConnected(all)){OnPlayerConnect(all);}}
    print(
"\n--------------------------------------");
    if (!
dini_Exists(LOCAL)){
    
dini_Create(LOCAL);
    print(
"\nscriptfiles/"#LOCAL" | Criado");
    
}
    print(
"    /SetTag By [$]_Red_[MF] iniciado");
    print(
"--------------------------------------\n");
    return 
1;
}
//============================================================
public OnFilterScriptExit()
{
    
//nada
    
return 1;
}
//============================================================
public OnPlayerConnect(playerid)
{
    
SendClientMessage(playerid, -1"{FFFF00}[TAG]:{FF0000} Este Servidor usa sistema de Tag feito por [$]_Red_[MF]");
     new 
string[80];
     
format(string,sizeof(string),"%s_usetag",pName(playerid));
     
tag[playerid] = dini_Int(LOCALstring);
    
PlayerTag[playerid] = dini_Get(LOCALpName(playerid));
    return 
1;
}
//============================================================
public OnPlayerText(playeridtext[])
{
    if(
tag[playerid] == 1)
    {
        new 
string[164];
        
format(string,sizeof(string),"%s{FFFFFF}-[{"#COR_TAG"}%s{FFFFFF}]-(%i): %s",pName(playerid),PlayerTag[playerid],playerid,text);
        
SendClientMessageToAll(GetPlayerColor(playerid), string);
        }
        else
        {
        
CallRemoteFunction("OnPlayerText""is"playeridtext);
         return 
0;
    }
    return 
0;
}
//============================================================
CMD:settag(playeridparams[]) // Comando usado para setar a tag no player /settag (id) (Tag) ex: /settag (0) (DORITOS)
{
    new 
id,tmp2[80];
    if(
sscanf(params"ds[50]",id,tmp2)) return SendClientMessage(playerid,-1,"Use: /settag [id] [tag]");
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"{FFFF00}[TAG]:{FF0000} Vocк nгo tem permisгo para usar este comando");
    if(!
IsPlayerConnected(id)) return SendClientMessage(playerid, -1"{FF0000}Player nгo conectado!");
    if(
strlen(tmp2) < LETRAS) return SendClientMessage(playerid, -1"{FFFF00}[TAG]:{FFFFFF} A tag tem que ter pelomenos "#LETRAS" Letras");
     
static string[124],str[50];
     
format(str,sizeof(str),"%s",tmp2);
    
format(string,sizeof(string),"%s_usetag",pName(id));
    
dini_Set(LOCALpName(id), str);
    
dini_IntSet(LOCALstring1);
    
tag[id] = 1;
    
PlayerTag[id] = str;
    
format(string,sizeof(string),"{FFFF00}[TAG]:{FFFFFF} Tag: {"#COR_TAG"}%s {FFFFFF}Setada para o player: {"#COR_TAG"}%s",tmp2,pName(id));
    
SendClientMessage(playerid, -1,string);
    return 
true;
}
//============================================================
CMD:unsettag(playeridparams[]) // Comando usado para retirar a tag do player /unsettag (id)
{
    new 
tmp1;
    if(
sscanf(params"d",tmp1)) return SendClientMessage(playerid,-1,"Use: /unsettag [id]");
       if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"{FFFF00}[TAG]:{FF0000} Vocк nгo tem permisгo para usar este comando");
    new 
string[124];
    if(!
IsPlayerConnected(tmp1)) return SendClientMessage(playerid, -1"{FF0000}Player nгo conectado!");
    
format(string,sizeof(string),"%s_usetag",pName(tmp1));
    
dini_IntSet(LOCALstring0);
    
tag[tmp1] = 0;
    
format(string,sizeof(string),"{FFFF00}[TAG]:{FFFFFF} A Tag: {"#COR_TAG"}%s {FFFFFF}Foi retirada de {"#COR_TAG"}%s",PlayerTag[playerid],pName(tmp1));
    
SendClientMessage(playerid, -1,string);
    
PlayerTag[tmp1] = "";
    return 
true;
}
//============================================================
stock pName(playerid){//pega nome do player
static pname[24];GetPlayerName(playeridpname24);
return 
pname;}
//============================================================ 
Reply
#3

vish cara kkkkkkkkkkkkkkkkkkkk
Reply
#4

Quote:
Originally Posted by RedMF
Посмотреть сообщение
Ve se pega ae

PHP код:
/*
Nгo retire os creditos afinal nгo foi vocк que fez!
Comandos
/SetTag (id) (tag) <-- este comando seta a tag no player
/UnSetTag (id) <-- Escomando retira a tag setada no player
Bom Como nгo uso zcmd nгo testei esse mais deve estar funcionando
*/
//Includes
#include <a_samp>
#include <dini>
#include <zcmd>
#include <sscanf2>
//...
#define LOCAL "tags.txt" //Local onde ficara salvo as tags setadas
#define COR_TAG 00FF00 //Coloque aqui a cor da tag em codigo HEX, Vermelho=FF0000 , Azul=0000FF , Amarelo=FFFF00 , Branco=FFFFFF , Preto=000000
#define LETRAS 3 // Tamanho minimo da tag
// Variaveis
new tag[MAX_PLAYERS];
new 
PlayerTag[MAX_PLAYERS][80];
//============================================================
public OnFilterScriptInit()
{
    for(new 
all 0all MAX_PLAYERS; ++all){if(IsPlayerConnected(all)){OnPlayerConnect(all);}}
    print(
"\n--------------------------------------");
    if (!
dini_Exists(LOCAL)){
    
dini_Create(LOCAL);
    print(
"\nscriptfiles/"#LOCAL" | Criado");
    
}
    print(
"    /SetTag By [$]_Red_[MF] iniciado");
    print(
"--------------------------------------\n");
    return 
1;
}
//============================================================
public OnFilterScriptExit()
{
    
//nada
    
return 1;
}
//============================================================
public OnPlayerConnect(playerid)
{
    
SendClientMessage(playerid, -1"{FFFF00}[TAG]:{FF0000} Este Servidor usa sistema de Tag feito por [$]_Red_[MF]");
     new 
string[80];
     
format(string,sizeof(string),"%s_usetag",pName(playerid));
     
tag[playerid] = dini_Int(LOCALstring);
    
PlayerTag[playerid] = dini_Get(LOCALpName(playerid));
    return 
1;
}
//============================================================
public OnPlayerText(playeridtext[])
{
    if(
tag[playerid] == 1)
    {
        new 
string[164];
        
format(string,sizeof(string),"%s{FFFFFF}-[{"#COR_TAG"}%s{FFFFFF}]-(%i): %s",pName(playerid),PlayerTag[playerid],playerid,text);
        
SendClientMessageToAll(GetPlayerColor(playerid), string);
        }
        else
        {
        
CallRemoteFunction("OnPlayerText""is"playeridtext);
         return 
0;
    }
    return 
0;
}
//============================================================
CMD:settag(playeridparams[]) // Comando usado para setar a tag no player /settag (id) (Tag) ex: /settag (0) (DORITOS)
{
    new 
id,tmp2[80];
    if(
sscanf(params"ds[50]",id,tmp2)) return SendClientMessage(playerid,-1,"Use: /settag [id] [tag]");
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"{FFFF00}[TAG]:{FF0000} Vocк nгo tem permisгo para usar este comando");
    if(!
IsPlayerConnected(id)) return SendClientMessage(playerid, -1"{FF0000}Player nгo conectado!");
    if(
strlen(tmp2) < LETRAS) return SendClientMessage(playerid, -1"{FFFF00}[TAG]:{FFFFFF} A tag tem que ter pelomenos "#LETRAS" Letras");
     
static string[124],str[50];
     
format(str,sizeof(str),"%s",tmp2);
    
format(string,sizeof(string),"%s_usetag",pName(id));
    
dini_Set(LOCALpName(id), str);
    
dini_IntSet(LOCALstring1);
    
tag[id] = 1;
    
PlayerTag[id] = str;
    
format(string,sizeof(string),"{FFFF00}[TAG]:{FFFFFF} Tag: {"#COR_TAG"}%s {FFFFFF}Setada para o player: {"#COR_TAG"}%s",tmp2,pName(id));
    
SendClientMessage(playerid, -1,string);
    return 
true;
}
//============================================================
CMD:unsettag(playeridparams[]) // Comando usado para retirar a tag do player /unsettag (id)
{
    new 
tmp1;
    if(
sscanf(params"d",tmp1)) return SendClientMessage(playerid,-1,"Use: /unsettag [id]");
       if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"{FFFF00}[TAG]:{FF0000} Vocк nгo tem permisгo para usar este comando");
    new 
string[124];
    if(!
IsPlayerConnected(tmp1)) return SendClientMessage(playerid, -1"{FF0000}Player nгo conectado!");
    
format(string,sizeof(string),"%s_usetag",pName(tmp1));
    
dini_IntSet(LOCALstring0);
    
tag[tmp1] = 0;
    
format(string,sizeof(string),"{FFFF00}[TAG]:{FFFFFF} A Tag: {"#COR_TAG"}%s {FFFFFF}Foi retirada de {"#COR_TAG"}%s",PlayerTag[playerid],pName(tmp1));
    
SendClientMessage(playerid, -1,string);
    
PlayerTag[tmp1] = "";
    return 
true;
}
//============================================================
stock pName(playerid){//pega nome do player
static pname[24];GetPlayerName(playeridpname24);
return 
pname;}
//============================================================ 
Agora aparece a TAG e da pro admin fala no chat admin mбs quando eu tiro a tag e fala no chat normal da isso:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)