SA-MP Forums Archive
Bug - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Bug (/showthread.php?tid=507062)



Bug - Ananisiki - 15.04.2014

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;
}



Re: Bug - Ananisiki - 16.04.2014

Bump


Re: Bug - NovaGaming - 16.04.2014

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;
}


Re: Bug - BroZeus - 16.04.2014

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


AW: Bug - BiosMarcel - 16.04.2014

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


Re: Bug - Ananisiki - 16.04.2014

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


Re: Bug - NovaGaming - 16.04.2014

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


Re: Bug - Konstantinos - 16.04.2014

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;
}



Re: Bug - Ananisiki - 16.04.2014

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....


Re: Bug - NovaGaming - 16.04.2014

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;
}