[Pedido] Nick RPG
#1

Gostaria de um cуdigo que permitisse um jogador entrar apenas com Nome_Sobrenome no servidor.

Esses dias atrбs eu peguei um no Cуdigos ъteis, mбs deu um erro lб, ai acabei que deixei pra lб.
Mas eu gostaria de colocar isso novamente no meu GM.

Se alguйm quiser me ajudar, eu fico agradecido!
Reply
#2

pawn Code:
new pName[MAX_PLAYER_NAME], sstring[256];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);        
    if(strfind(pName, "_", true) == -1)
    {
        format(sstring, 256, "%s foi kickado pelo servidor. | Motivo: Nome RPG Invбlido (Ex. Nome_Sobrenome).", pName);
        SendClientMessageToAll(-1, sstring);       
        Kick(playerid);
        return 1;
    }
Reply
#3

Quote:
Originally Posted by Douglas_prt
View Post
pawn Code:
new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    if(strfind(pName, "_", true) == -1)
    {
        format(sstring, 128, "%s foi kickado pelo servidor. | Motivo: Nome RPG Invбlido (Ex. Luis_Cardoso).", pName);
        SendClientMessageToAll(KICKCOR, sstring);
        SendClientMessage(playerid, -1, "Coloca um nome RPG. Ex: Luis_Cardoso");
        Kick(playerid);
        return 1;
    }
E onde coloco mesmo?
Reply
#4

pawn Code:
//OnPlayerConnect


new Name[24];
GetPlayerName(playerid,Name,24);
if(strfind(name,"_",false)) return SendClientMessage(playerid,-1,"USE RP NAME: Nome_Sobrenome"),Kick(playerid);
Teste.
Reply
#5

Coloca em OnPlayerConnect.
Reply
#6

Quote:
Originally Posted by Gustavo_Araujo
View Post
pawn Code:
//OnPlayerConnect


new Name[24];
GetPlayerName(playerid,Name,24);
if(strfind(name,"_",false)) return SendClientMessage(playerid,-1,"USE RP NAME: Nome_Sobrenome"),Kick(playerid);
Teste.
Seu cуdigo deu certo aqui, mбs mesmo eu entrando com Nome_Sobrenome, eu continuo a tomar kick.

Quote:
Originally Posted by Douglas_prt
View Post
pawn Code:
new pName[MAX_PLAYER_NAME], sstring[256];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);        
    if(strfind(pName, "_", true) == -1)
    {
        format(sstring, 256, "%s foi kickado pelo servidor. | Motivo: Nome RPG Invбlido (Ex. Nome_Sobrenome).", pName);
        SendClientMessageToAll(-1, sstring);       
        Kick(playerid);
        return 1;
    }
O seu estб a dar o seguinte error: error 021: symbol already defined: "sstring"
Reply
#7

UP Ajuda?
Reply
#8

Tenta
pawn Code:
new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);        
    if(strfind(pName, "_", true) == -1)
    {
        new string[126];
        format(string, 256, "%s foi kickado pelo servidor. | Motivo: Nome RPG Invбlido (Ex. Nome_Sobrenome).", pName);
        SendClientMessageToAll(-1, string);        
        Kick(playerid);
        return 1;
    }
Reply
#9

Quote:
Originally Posted by Ley
View Post
Tenta
pawn Code:
new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);        
    if(strfind(pName, "_", true) == -1)
    {
        new string[126];
        format(string, 256, "%s foi kickado pelo servidor. | Motivo: Nome RPG Invбlido (Ex. Nome_Sobrenome).", pName);
        SendClientMessageToAll(-1, string);        
        Kick(playerid);
        return 1;
    }
Obrigado, deu super certo aqui.
Reply
#10

Quote:
Originally Posted by Rijin
View Post


Obrigado, deu super certo aqui.
Nada
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)