25.10.2011, 20:12
PHP код:
CMD:screenname(playerid,params[]){
new string[128],string1[128],id,name[50];
if(PlayerInfo[playerid][pLaptop] == 0) return SendClientMessage(playerid,COLOR_GRAY,"You do not have a laptop!");
else if(sscanf(params,"s",name)) return SendClientMessage(playerid,COLOR_GRAY,"Syntax: /Screenname [name]");
else
for(new i = 500; i < MAX_PLAYERS; i++)
{
new INI:File = INI_Open(UserPath(id));
format(string,sizeof(string),"%s",name);
INI_WriteInt(File,"Screenname",string);
if(PlayerInfo[i][pLaptopon] == 1){
format(string1,sizeof(string1),"%s has changed their screenname to %s",GetName(playerid),name);
SendClientMessage(i,COLOR_YELLOW,string1);
INI_Close(File);
}
}
return 1;
}