16.03.2008, 23:35
Quote:
Originally Posted by !damo!spiderman
It basically depends on why and when you create a file using a players name. Basically all that script does is kick them OnConnect if they have one of the many names which will crash a windows server when trying to create a file by that name. Some systems may create files OnPlayerDisconnect which is still called when someone is kicked. Basically the best solution for everyone is to use a different file naming convention than player names or prefix a extra letter to their name
|
Tho there is an downside on this when releasing the source, meaning there will be also a lot of people who will go out and crash windows servers afther see-ing the source. I am not the one who will be responsible for that - the server owners are. They just have to stay more up to date;
pawn Code:
#include <a_samp>
main(){}
new IllegalNames[][7] = {
"com1","com2","com3",
"com4","com5","com6",
"com7","com8","com9",
"lpt1","lpt2","lpt3",
"lpt4","lpt5","lpt6",
"lpt7","lpt8","lpt9",
"nul","clock$","aux",
"prn","con"
};
public OnPlayerConnect(playerid)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
for(new i = 0; i < sizeof(IllegalNames); i++)
{
if(!strcmp(pName, IllegalNames[i] , true))
{
Kick(playerid);
}
}
return 0;
}