[Ajuda] OnPlayerConnect
#1

Iae galera, й o seguinte eu pesso ajuda de vocs para um sistema que quando o player entrasse no servidor checase no arquivo, exemplo: "Usuarios.ini" se o nick dele estiver nesse arquivo ele entra no servidor normal mas se o nick dele nгo estiver nesse arquivo ele seria kickado, Obrigado
Reply
#2

Topo:
PHP код:
#include SII 
OnPlayerConnect:
PHP код:
new Arquivo[20];new sendername[MAX_PLAYERS];
GetPlayerName(playeridsendernamesizeof(sendername));
format(Arquivosizeof(Arquivo),"%s.ini",sendername);
if(
INI_Exist(Arquivo))
{
SpawnPlayer(playerid);
SetSpawnInfo(playerid0,0,0.0,0.0,0.0,0.0,-1,-1,-1,-1,-1,-1);
}
else
{
Kick(playerid);

ta aew.. (Nгo testei..)
Reply
#3

Vlw mano funcionou aki + rep pra vocк
Reply
#4

Precisar tamos aew
Reply
#5

Troque isto.
PHP код:
new Arquivo[96];new sendername[24]; 
Reply
#6

GReeN_WOoD tem que deixa new sendername[MAX_PLAYER_NAME];

Nгo precisa trocar ¬¬'
Reply
#7

Toni vocк nгo colocou MAX_PLAYER_NAME, vocк colocou MAX_PLAYERS.
Se o Mбximo dele for 800, ele tб fudido --' kkk'
Reply
#8

Tanto variavel MAX_PLAYER_NAME , como variбveis numericas , acho que nao tem diferenзa ao Uso.
Reply
#9

Tб sabendo legal em Toni...

pawn Код:
new sendername[MAX_PLAYER_NAME];
new sendername[24];
Segue como o Green falou...

Exemplo:
pawn Код:
public OnPlayerConnect ( playerid )
{
    new to_send [ 30 ] , name [ 24 ];
    GetPlayerName ( playerid , name , MAX_PLAYER_NAME ) ;
    format ( to_send , sizeof ( to_send ) , "%s.ini" , name ) ;
    if ( !fexist ( to_send ) )
    {
        //...
        Kick ( playerid ) ;
        //Conta nгo existe...
        return 1 ;
    }
    return 1 ;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)