[Ajuda] OnPlayerConnect -
Smith. - 05.05.2012
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
Re: [Ajuda] OnPlayerConnect -
tonisantolia - 05.05.2012
Topo:
OnPlayerConnect:
PHP код:
new Arquivo[20];new sendername[MAX_PLAYERS];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(Arquivo, sizeof(Arquivo),"%s.ini",sendername);
if(INI_Exist(Arquivo))
{
SpawnPlayer(playerid);
SetSpawnInfo(playerid, 0,0,0.0,0.0,0.0,0.0,-1,-1,-1,-1,-1,-1);
}
else
{
Kick(playerid);
}
ta aew.. (Nгo testei..)
Re: [Ajuda] OnPlayerConnect -
Smith. - 05.05.2012
Vlw mano funcionou aki + rep pra vocк
Re: [Ajuda] OnPlayerConnect -
tonisantolia - 05.05.2012
Precisar tamos aew
Re: [Ajuda] OnPlayerConnect -
GReeN_WOoD - 05.05.2012
Troque isto.
PHP код:
new Arquivo[96];new sendername[24];
Re: [Ajuda] OnPlayerConnect -
tonisantolia - 05.05.2012
GReeN_WOoD tem que deixa new sendername[MAX_PLAYER_NAME];
Nгo precisa trocar ¬¬'
Re: [Ajuda] OnPlayerConnect -
GReeN_WOoD - 05.05.2012
Toni vocк nгo colocou MAX_PLAYER_NAME, vocк colocou MAX_PLAYERS.
Se o Mбximo dele for 800, ele tб fudido --' kkk'
Re: [Ajuda] OnPlayerConnect -
.FuneraL. - 05.05.2012
Tanto variavel MAX_PLAYER_NAME , como variбveis numericas , acho que nao tem diferenзa ao Uso.
Re: [Ajuda] OnPlayerConnect -
WLSF - 05.05.2012
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 ;
}