22.01.2017, 21:23
pode fazer assim tambйm:
PHP код:
CMD:vernick(playerid, params[])
{
new tmp[34], arquivo[30], name[MAX_PLAYER_NAME];
if(sscanf(params,"s[23]",tmp))
return SendClientMessage(playerid, -1, "Digite: [vernick (id/nick)]");
if(IsNumeric(tmp))
{
if(IsPlayerConnected(strval(tmp))
{
GetPlayerName(strval(tmp), name, MAX_PLAYER_NAME);
format(arquivo, sizeof(arquivo), "Contas/%s.ini", name);
if(DOF2_FileExists(arquivo)) return SendClientMessage(playerid, -1, "Your account have been registered.");
SendClientMessage(playerid, -1, "Your name isnt not found on our data");
}
else return SendClientMessage(playerid, -1, "ID invalido");
}
else
{
format(arquivo, sizeof(arquivo), "Contas/%s.ini", tmp);
if(DOF2_FileExists(arquivo)) return SendClientMessage(playerid, -1, "Your account have been registered.");
SendClientMessage(playerid, -1, "Your name isnt not found on our data");
}
return 1;
}
stock IsNumeric(text[])
{
for(new a; a < strlen(text); ++a)
{
if(text[a] < '0' || text[a] > '9') return false;
}
return true;
}