It would be like this:
The file:
Код:
User1 User2 User3 ... User76
Then you would read it with your script, and if player name is found, he has ability to spawn with a class.
I would do it with these comands
Код:
public OnPlayerConnect(playerid)
{
new PNameC[MAX_PLAYER_NAME];
GetPlayerName(playerid,PNameC,sizeof(PNameC));
new File:cFile = fopen("classfile.ini",io_read);
//I would read it as text in whole.
new cStr[1000],cStr2[MAX_PLAYER_NAME+2];
fread(cFile,cStr,sizeof(cStr));
format(cStr2,sizeof(cStr2),"i'%s'",PNameC);
if(!sscanf(cStr,cStr2))
{
//Allow using other skins
}
return 1;
}
Now i'll give it a test to see if it works. - It doesn't because it doesn't mind not finding something.
Sorry, it seems that i can't help you.. althought you could use strfind(cStr," User "); But strfind may be slow, and renember that you have to format user's name in spaces, otherwise - one and onetwo will make confusion in script. cause they will be separated by spaces, but you will not be searching " one ", you will search "one" and then onetwo fits!
Код:
new PNameC[MAX_PLAYER_NAME];
GetPlayerName(playerid,PNameC,sizeof(PNameC));
new File:cFile = fopen("classfile.ini",io_read);
//I would read it as text in whole.
new cStr[1000],cStr2[MAX_PLAYER_NAME+2];
fread(cFile,cStr,sizeof(cStr));
format(cStr2,sizeof(cStr2)," %s ",PNameC);
SendClientMessage(playerid,0x000000FF,cStr2);
if(strfind(cStr,cStr2) != -1)
{
SendClientMessage(playerid,0x000000FF,"Pass");
//Allow using other skins
}
Works - tested
My classfile.ini: