#1

This don't work, why

pawn Код:
CMD:bug(playerid, params[])
{
    new pID, text[64];
    if(sscanf(params, "s[64]", text)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /bug (bug)");
    new bug[256];
    format(bug, sizeof bug, "%s Has Reported A Bug. Description: %s", PlayerName(pID), text);
    new file[256];
    format(file, sizeof file, "DM/Reports/Bugs.txt", text);
    if(!dini_Exists("DM/Reports/Bugs.txt")) dini_Create("DM/Reports/Bugs.txt");
    return 1;
}
Reply
#2

Bump
Reply
#3

CMD:bug(playerid, params[])
{
new pID, text[64];
if(sscanf(params, "s[64]", text)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /bug (bug)");
new bug[256];
format(bug, sizeof bug, "%s Has Reported A Bug. Description: %s", PlayerName(pID), text);
new file[256];
format(file, sizeof file, "DM/Reports/Bugs.txt", text);
if(!dini_Exists(file)) dini_Create(file);
return 1;
}
Reply
#4

the command is incomplete there is no writing of bug in file command no Send Clinet Messages and many more bugs
Reply
#5

PHP код:
cmd:bug(playerid,params[])
{
    new 
text[256];
    if(
sscanf(params"s"text)) return SendClientMessage(playeridCOLOR_RED"USAGE: /bug (bug)");    
    new 
bug[256];    
    
format(bugsizeof bug"%s Has Reported A Bug. Description: %s"PlayerName(pID), text);
              
//I think u want to send this sentence ^ to the admins :D so just add 1 more sendclientmessage
    
SendClientMessage(playerid,COLOR_RED,"Thank you for reporting a Bug");
    new
    
File:lFile fopen("Bugs.txt"io_append),
    
logData[250],
    
fyearfmonthfday,
    
fhourfminutefsecond;
    
getdate(fyearfmonthfday);
    
gettime(fhourfminutefsecond);
    
format(logDatasizeof(logData),"[%02d/%02d/%04d %02d:%02d:%02d] %s: %s \r\n"fdayfmonthfyearfhourfminutefsecondgetPlayerName(playerid), text);
    
fwrite(lFilelogData);
    
fclose(lFile);
    return 
1;

if there are some misstakes sry
but i think ti should work
Reply
#6

Why u copy other stuff and give me? i want to try to fix mine code
Reply
#7

Quote:
Originally Posted by Ananisiki
Посмотреть сообщение
Why u copy other stuff and give me? i want to try to fix mine code
CMD:bug(playerid, params[]){
new pID, text[64];
if(sscanf(params, "s[64]", text)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /bug (bug)");
new bug[256];
format(bug, sizeof bug, "%s Has Reported A Bug. Description: %s", PlayerName(pID), text);
new file[256];
format(file, sizeof file, "DM/Reports/Bugs.txt", text);
if(!dini_Exists(file)){
dini_Create(file);
dini_Set(file,bug);
}
return 1;
}
Here ready to go this is your code
Reply
#8

Dini cannot be used for that kind of stuff. You don't have "keys" in the file, you only write in it:
pawn Код:
CMD:bug(playerid, params[])
{
    if (isnull(params)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /bug (bug)");
    new bug[128], File: fhandle = fopen("DM/Reports/Bugs.txt", io_append);
    format(bug, sizeof (bug), "By %s: %s\r\n", PlayerName(playerid), params);
    if (fhandle)
    {
        fwrite(fhandle, bug);
        fclose(fhandle);
    }
    else SendClientMessage(playerid, COLOR_RED, "The file couldn't be opened. Try again later!");
    return 1;
}
Reply
#9

Quote:
Originally Posted by NovaGaming
Посмотреть сообщение
CMD:bug(playerid, params[])
{
new pID, text[64];
if(sscanf(params, "s[64]", text)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /bug (bug)");
new bug[256];
format(bug, sizeof bug, "%s Has Reported A Bug. Description: %s", PlayerName(pID), text);
new file[256];
format(file, sizeof file, "DM/Reports/Bugs.txt", text);
if(!dini_Exists(file)) dini_Create(file);
return 1;
}
This creates the file inside there but it dont write the text inside the file....
Reply
#10

Quote:
Originally Posted by Ananisiki
Посмотреть сообщение
This creates the file inside there but it dont write the text inside the file....
Hello read
CMD:bug(playerid, params[]){
new pID, text[64];
if(sscanf(params, "s[64]", text)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /bug (bug)");
new bug[256];
format(bug, sizeof bug, "%s Has Reported A Bug. Description: %s", PlayerName(pID), text);
new file[256];
format(file, sizeof file, "DM/Reports/Bugs.txt", text);
if(!dini_Exists(file)){
dini_Create(file);
dini_Set(file,bug);
}
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)