little help
#1

hi guys.this code for my clan news but i have one problem.

update code:
Код:
stock UpdateClanNews(playerid,text[]){
    if(strlen(text)>1024)return SendClientMessage(playerid,COLOR_RED,"Only 1024 characters for the clan's news allowed.");
    new str[256],str2[256],nfile[256];
	GetPVarString(playerid,"Clanname",str,sizeof(str));
	format(nfile,sizeof(nfile),ClanNewsFile,str);
	dini_Remove(nfile);
	dini_Create(nfile);
	new File:file=fopen(nfile,io_append);
	fwrite(file,text);
	fclose(file);
	foreach(Player,i){
	    GetPVarString(i,"Clanname",str2,sizeof(str2));
	    if(!strcmp(str,str2))SendClientMessage(i,COLOR_DARKOLIVEGREEN,"You're clan's news has updated.");}
	return 1;}
see code:

Код:
CMD:cnews(playerid,params[]){
    #define usused params
	new nfile[256],string[256],handle[1024],str[256],str2[258];
	if(!CheckCommandState("cnews"))return SendClientMessage(playerid,COLOR_RED,"This command is disabled.");
	if(!CheckCommandPerm(playerid,0))return SendClientMessage(playerid,COLOR_RED,"You are not authorized to use this command.");
	if(!GetPVarInt(playerid,"Clan"))return SendClientMessage(playerid,COLOR_RED,"You are not in any clan.");
	GetPVarString(playerid,"Clanname",string,sizeof(string));
	format(nfile,sizeof(nfile),ClanNewsFile,string);
	new File:file=fopen(nfile,io_read);
 	while(fread(file,str)){
 	    format(str2,sizeof(str2),"%s\n",str);
  		strcat(handle,str2);}
    fclose(file);
    ShowPlayerDialog(playerid,ClanNewsDialog,DIALOG_STYLE_MSGBOX,""#COL_GREEN"Your Clan News",handle,"Ok","");
	return 1;}
im enter hehehehehehe\r in dialog but when im type /cnews:

Reply
#2

hi,
Hi, trying to remove the "\n" because I think it bears confusion with the "%s"
try to add the "\n" is the place where you have to add the "hehehehehe"

You can see that : How To Create a Dialog
Reply
#3

Does not work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)