[HELP]GetPlayerNameByPhone - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]GetPlayerNameByPhone (
/showthread.php?tid=95833)
[HELP]GetPlayerNameByPhone -
kevin974 - 05.09.2009
Код:
#define MIN_PHONE_NUM 100000
#define MAX_PHONE_NUM 999999
stock GetPlayerNameByPhone(phonenumb)
{
new phone[64], name[MAX_PLAYER_NAME] = "Nobody";
for(new p = MIN_PHONE_NUM; p <= MAX_PHONE_NUM; p++)
{
format(phone, sizeof(phone), "/Phones/%s.dini.save", GetName(p));
if(dini_Int(phone, "Number") == phonenumb) { name = GetName(p); }
}
return name;
}
Ok, Well i want this command to get a players name by the phone number saved in there file. But i want to get be able to get it even though the other player is not in the game.
Basically my real problem is how the hell do i loop through 888888 player files?
Re: [HELP]GetPlayerNameByPhone -
Balon - 05.09.2009
Use a database.