CMD:vernick(playerid, params[]) { new tmp[34], arquivo[30]; if(sscanf(params,"s[23]",tmp)) return SendClientMessage(playerid, -1, "Digite: [vernick (id/nick)]"); printf("Digitou: %s",tmp); format(arquivo, sizeof(arquivo), "Contas/%s.ini", tmp); if(DOF2_FileExists(arquivo)) { SendClientMessage(playerid, -1, "Your account have been registered."); }else{ SendClientMessage(playerid, -1, "Your name isnt not found on our data"); } return 1; }
stock IsNumeric(const str[]) { for(new i, len = strlen(str); i < len; i++) { if(!('0' <= str[i] <= '9')) return false; } return true; }
CMD:vernick(playerid, params[]) { new id, arquivo[60]; if(!sscanf(params,"d",id)) { if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "ID invбlido!"); GetPlayerName(id, arquivo, sizeof(arquivo)); format(arquivo, sizeof(arquivo), "Contas/%s.ini", arquivo); } else if(!sscanf(params,"s[24]",arquivo)) { format(arquivo, sizeof(arquivo), "Contas/%s.ini", arquivo); } else return SendClientMessage(playerid, -1, "Digite: [vernick (id/nick)]"); if(DOF2_FileExists(arquivo)) { SendClientMessage(playerid, -1, "Your account have been registered."); } else { SendClientMessage(playerid, -1, "Your name isnt not found on our data"); } return 1; }
stock bool:IsNumeric(const str[])
{
new tmp;
for(sscanf(str,"d",tmp))return true;
return false;
}
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;
}
new tmp[34], arquivo[30]; if(sscanf(params,"s[23]",tmp)) return SendClientMessage(playerid, -1, "Digite: [vernick (id/nick)]"); |