[AJUDA]Nome e sobrenome pra entrar no server
#1

galera eu to usando um sistema que tenque ter nome e sobrenome pra entrar no server mais estou tendo erros ao compilar

pawn Код:
public OnPlayerConnect(playerid)
{
    new nome[24];
    GetPlayerName(playerid, nome, 24);
    if(strfind(nome, "_", true)) {
    Kick(playerid);
    new pname[MAX_PLAYER_NAME], string[30 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
        format(string, sizeof(string), "[STR] » %s Conectou ao servidor", pname);
    SendClientMessageToAll(0xAAAAAAAA, string);
    GameTextForPlayer(playerid,"Bem vindo a Streme Drift Brasil Sempre Inovando!!!",6000,3);
    SetPlayerMapIcon(playerid, 38, 1222.5375, -2036.8712, 65.2266, 38, 0);
    return 1;
}
Reply
#2

if(strfind(nome, "_", true)) {

abriu a chave e nгo fechou.
Reply
#3

pawn Код:
public OnPlayerConnect(playerid)
{
    new nome[24];
    GetPlayerName(playerid, nome, 24);
    if(strfind(nome, "_", true)){
    Kick(playerid);}
    new pname[MAX_PLAYER_NAME], string[30 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
        format(string, sizeof(string), "[STR] » %s Conectou ao servidor", pname);
    SendClientMessageToAll(0xAAAAAAAA, string);
    GameTextForPlayer(playerid,"Bem vindo a Streme Drift Brasil Sempre Inovando!!!",6000,3);
    SetPlayerMapIcon(playerid, 38, 1222.5375, -2036.8712, 65.2266, 38, 0);
    return 1;
}
Reply
#4

Codigo do panico622 melhorado:
pawn Код:
public OnPlayerConnect(playerid)
{
    new nome[24];
    GetPlayerName(playerid, nome, 24);
    if(strfind(nome, "_", true)){
    Kick(playerid);}
    format(string, sizeof(string), "[STR] » %s Conectou ao servidor", nome);
    SendClientMessageToAll(0xAAAAAAAA, string);
    GameTextForPlayer(playerid,"Bem vindo a Streme Drift Brasil Sempre Inovando!!!",6000,3);
    SetPlayerMapIcon(playerid, 38, 1222.5375, -2036.8712, 65.2266, 38, 0);
    return 1;
}
Reply
#5

Quote:
Originally Posted by (A)rray
Посмотреть сообщение
Codigo do panico622 melhorado:
pawn Код:
public OnPlayerConnect(playerid)
{
    new nome[24];
    GetPlayerName(playerid, nome, 24);
    if(strfind(nome, "_", true)){
    Kick(playerid);}
    format(string, sizeof(string), "[STR] » %s Conectou ao servidor", nome);
    SendClientMessageToAll(0xAAAAAAAA, string);
    GameTextForPlayer(playerid,"Bem vindo a Streme Drift Brasil Sempre Inovando!!!",6000,3);
    SetPlayerMapIcon(playerid, 38, 1222.5375, -2036.8712, 65.2266, 38, 0);
    return 1;
}
esqueceu do new string[MAX_PLAYERS]; nгo?
Reply
#6

Dei fail D:
Peзo desculpa
No "new nome[24]" adicione "string[128]"
Reply
#7

Quote:
Originally Posted by Panico622
Посмотреть сообщение
pawn Код:
public OnPlayerConnect(playerid)
{
    new nome[24];
    GetPlayerName(playerid, nome, 24);
    if(strfind(nome, "_", true)){
    Kick(playerid);}
    new pname[MAX_PLAYER_NAME], string[30 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
        format(string, sizeof(string), "[STR] » %s Conectou ao servidor", pname);
    SendClientMessageToAll(0xAAAAAAAA, string);
    GameTextForPlayer(playerid,"Bem vindo a Streme Drift Brasil Sempre Inovando!!!",6000,3);
    SetPlayerMapIcon(playerid, 38, 1222.5375, -2036.8712, 65.2266, 38, 0);
    return 1;
}
Vlw mano o seu fucionou +rep

@EDIT

quando eu entro no jogo sem sobrenome ele nгo conecta mais quando eu entro com nome e sobrenome o samp_server fecha alguem ajuda aee


pawn Код:
new nome[24];
    GetPlayerName(playerid, nome, 24);
    if(strfind(nome, "_", true)){
    SendClientMessage(playerid,0xD8D8D8FF,"[STR] » Vocк tenque ter um nome e um sobrenome exemplo %s_xD", nome);
    GameTextForPlayer(playerid,"Vocк presisa de um nome e um sobrenome para conectar no servidor",6000,3);
    Kick(playerid);}
Reply
#8

ele fecha por que vc deve ter algum sistema de salvamento de dados, no qual quando vc entra, com esse nome ele nгo consegue achar o arquivo. creio.

posta o onplayerconect
Reply
#9

Eu Uso Assim :
pawn Код:
new VNome[MAX_PLAYER_NAME];
GetPlayerName(playerid, VNome, sizeof(VNome));
if(strfind(VNome, "_", true) == -1)
{
    SendClientMessage(playerid,-1, "Nick Invбlido!");
    SendClientMessage(playerid,-1, "Seu Nick deve conter ' _ ' (Andeline)!");
    Kick(playerid);
    return 1;
}
Acho que й isso que vocк quer. Nгo li tudo (:
Reply
#10

Quote:
Originally Posted by OwnPlaay
Посмотреть сообщение
Eu Uso Assim :
pawn Код:
new VNome[MAX_PLAYER_NAME];
GetPlayerName(playerid, VNome, sizeof(VNome));
if(strfind(VNome, "_", true) == -1)
{
    SendClientMessage(playerid,-1, "Nick Invбlido!");
    SendClientMessage(playerid,-1, "Seu Nick deve conter ' _ ' (Andeline)!");
    Kick(playerid);
    return 1;
}
Acho que й isso que vocк quer. Nгo li tudo (:
cara seu codigo deu erro alguem ae tem esse sistema que fucione? ta ae minha public

pawn Код:
public OnPlayerConnect(playerid)
{
    new pname[MAX_PLAYER_NAME], string[30 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "[STR] » %s Conectou ao servidor", pname);
    SendClientMessageToAll(0xAAAAAAAA, string);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)