Hm, well i don't know about the Bart_SIMPSON stuff. But this MIGHT work
Код:
stock GetPlayerFirstName(playerid)
{
new namestring[2][MAX_PLAYER_NAME];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
split(name, namestring, '_');
return namestring[0];
}
stock GetPlayerLastName(playerid)
{
new namestring[2][MAX_PLAYER_NAME];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
split(name, namestring, '_');
return namestring[1];
}
OnPlayerconnect
Код:
if(RPName(PlayerName(playerid),first,last))
{
SendClientMessage(playerid,COLOR_YELLOW,"____________________________________________________");
SendClientMessage(playerid,COLOR_LIGHTYELLOW2," Immigration: ");
new accstring[128];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(accstring, sizeof(accstring), "CRP_Scriptfiles/Accounts/%s.ini", sendername);
new File: hFile = fopen(accstring, io_read);
if (hFile)
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[INFO:] You are already a citizen, type your password below.");
fclose(hFile);
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[INFO:] You are not a citizen, type your desired password to register.");
}
SendClientMessage(playerid,COLOR_YELLOW,"____________________________________________________");
}
else
{
KickPlayer(playerid,"System","Invalid Name, Correct Format: Firstname_lastname.");
}
return 1;
}
Yes, this was taken directly from Carlito's Roleplay script..