Help me - Scriptfiles. -
Edin Black - 15.05.2012
Hello. No one will help me. I make this FS, but it doesnґt work. When I type /bug or /sug and [REASOn], the reason will save in the scriptfiles folder at "Bugs" and "Suggestions".
Can anyone help me
pawn Код:
dcmd(bug,3,cmdtext);
dcmd(sug,3,cmdtext);
pawn Код:
dcmd_bug(playerid,params[])
{
new string[128],bug,pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
if(sscanf(params,"s[128]",bug)) return SendClientMessage(playerid, COLOR_RED,"USAGE: /bug [what's the bug ?]");
format(string,sizeof string,"[BUG REPORT] - %s has reported this bug: %s.",pName,bug);
SaveInFile("Bugs.txt",string);
format(string,sizeof string,"[BUG REPORT] - You've reported this bug: %s ; succesfully.",bug);
SendClientMessage(playerid,COLOR_GREEN,string);
return 1;
}
dcmd_sug(playerid,params[])
{
new string[128],pName[MAX_PLAYER_NAME],sug;
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
if(sscanf(params,"s[128]",sug)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /sug [suggestion for the server]");
format(string,sizeof string,"[NEW SUGGESTION] - %s has suggested: %s.",pName,sug);
SaveInFile("Suggestions.txt",string);
format(string,sizeof string,"[NEW SUGGESTION] - Your suggestion has been saved in a file; You have succesfully suggested: %s",sug);
SendClientMessage(playerid,COLOR_GREEN,string);
return 1;
}
It is correct ?
Re: Help me - Scriptfiles. -
doreto - 15.05.2012
Quote:
Originally Posted by Edin Black
It is correct ?
|
haven't try yourself to see if that work ?
Re: Help me - Scriptfiles. -
ViniBorn - 15.05.2012
You don't need to use sscanf in this case, params is enough.
AW: Help me - Scriptfiles. -
Edin Black - 15.05.2012
pawn Код:
C:\Users\E\Desktop\Nove FS\Kapica.pwn(4) : error 001: expected token: ";", but found "("
C:\Users\E\Desktop\Nove FS\Kapica.pwn(5) : error 021: symbol already defined: "dcmd"
C:\Users\E\Desktop\Nove FS\Kapica.pwn(29) : warning 203: symbol is never used: "dcmd"
C:\Users\E\Desktop\Nove FS\Kapica.pwn(29) : warning 203: symbol is never used: "dcmd_bug"
C:\Users\E\Desktop\Nove FS\Kapica.pwn(29) : warning 203: symbol is never used: "dcmd_sug"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Errors.
Re: Help me - Scriptfiles. -
mgd - 15.05.2012
make this
pawn Код:
#include <a_samp>
dcmd_bug(playerid,params[])
{
new string[128],bug,pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
if(sscanf(params,"s[128]",bug)) return SendClientMessage(playerid, COLOR_RED,"USAGE: /bug [what's the bug ?]");
format(string,sizeof string,"[BUG REPORT] - %s has reported this bug: %s.",pName,bug);
SaveInFile("Bugs.txt",string);
format(string,sizeof string,"[BUG REPORT] - You've reported this bug: %s ; succesfully.",bug);
SendClientMessage(playerid,COLOR_GREEN,string);
return 1;
}
dcmd_sug(playerid,params[])
{
new string[128],pName[MAX_PLAYER_NAME],sug;
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
if(sscanf(params,"s[128]",sug)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /sug [suggestion for the server]");
format(string,sizeof string,"[NEW SUGGESTION] - %s has suggested: %s.",pName,sug);
SaveInFile("Suggestions.txt",string);
format(string,sizeof string,"[NEW SUGGESTION] - Your suggestion has been saved in a file; You have succesfully suggested: %s",sug);
SendClientMessage(playerid,COLOR_GREEN,string);
return 1;
}
and complie it.
Re: Help me - Scriptfiles. -
TheDominator - 15.05.2012
Remove the "o" from PAWN and then it will work.
AW: Help me - Scriptfiles. -
Edin Black - 15.05.2012
What "o" ?
Re: Help me - Scriptfiles. -
HaZaRaS™ - 15.05.2012
Add att top of your script "
1 )
pawn Код:
#include <a_samp>
#include <dcmd>
2 ) and
EDIT : and make the command
pawn Код:
dcmd_CMD_bug(playerid,params[])
hope it will work !!!!!
AW: Help me - Scriptfiles. -
Edin Black - 15.05.2012
pawn Код:
#include <a_samp>
#define dcmd(bug,cmdtext);
#define dcmd(sug,cmdtext);
dcmd_bug(playerid,params[])
{
new string[128],bug,pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
if(sscanf(params,"s[128]",bug)) return SendClientMessage(playerid, COLOR_RED,"USAGE: /bug [what's the bug ?]");
format(string,sizeof string,"[BUG REPORT] - %s has reported this bug: %s.",pName,bug);
SaveInFile("Bugs.txt",string);
format(string,sizeof string,"[BUG REPORT] - You've reported this bug: %s ; succesfully.",bug);
SendClientMessage(playerid,COLOR_GREEN,string);
return 1;
}
dcmd_sug(playerid,params[])
{
new string[128],pName[MAX_PLAYER_NAME],sug;
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
if(sscanf(params,"s[128]",sug)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /sug [suggestion for the server]");
format(string,sizeof string,"[NEW SUGGESTION] - %s has suggested: %s.",pName,sug);
SaveInFile("Suggestions.txt",string);
format(string,sizeof string,"[NEW SUGGESTION] - Your suggestion has been saved in a file; You have succesfully suggested: %s",sug);
SendClientMessage(playerid,COLOR_GREEN,string);
return 1;
}]
C:\Users\E\Desktop\saa.pwn(4) : warning 201: redefinition of constant/macro (symbol "dcmd(sug,cmdtext);")
C:\Users\E\Desktop\saa.pwn(2
: warning 203: symbol is never used: "dcmd_bug"
C:\Users\E\Desktop\saa.pwn(2
: warning 203: symbol is never used: "dcmd_sug"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
3 Warnings.
I know it warnings ,but ...
Re: Help me - Scriptfiles. -
mgd - 15.05.2012
try how i told you if dont work try how HaZaRaS™ told you...