SA-MP Forums Archive
Bug command help - 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 command help (/showthread.php?tid=431559)



Bug command help - MichaelWharton101 - 18.04.2013

Okay I need help please...

Код:
CMD:bug(params[])
{
    new  playerid, bugtype;
	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
	if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on Admin Duty.");
	if(sscanf(params, "ss[128]", bugtype, params))
	{
	    SendClientMessage(playerid, COLOR_WHITE, "** [Usage]:/bug [type] [text]");
	    SendClientMessage(playerid, COLOR_WHITE, "Valid types are: Low, Mid, High");
	    return 1;
	}
	else if(!strcmp(bugtype, "low", true)) --- line bug comes from
	{
    	if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    	if(strlen(params) > 128) return SendClientMessage(playerid, COLOR_GREY, "Maximum characters limit is 128.");
	    {
			new File: file = fopen("bugs.cfg", io_append), string[128];
			format(string, sizeof(string), "%s\r\n", params);
			fwrite(file, string);
			fclose(file);
	    }
	}
	return 1;
}
Line error comes from
Код:
C:\Users\Michael\Desktop\A-RP\gamemodes\A-RP.pwn(21616) : error 035: argument type mismatch (argument 1)



Re: Bug command help - HurtLocker - 18.04.2013

Try this: else if(!strcmp(bugtype, "low", true, 3))

EDIT: Try this:
pawn Код:
else
{
    if(!strcmp(bugtype, "low", true)) --- line bug comes from
    {  
        if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
        if(strlen(params) > 128) return SendClientMessage(playerid, COLOR_GREY, "Maximum characters limit is 128.");
           {
                     new File: file = fopen("bugs.cfg", io_append), string[128];
                     format(string, sizeof(string), "%s\r\n", params);
                     fwrite(file, string);
                     fclose(file);
           }
    }
}



Re: Bug command help - MichaelWharton101 - 18.04.2013

nope still got the same error


Re: Bug command help - MichaelWharton101 - 18.04.2013

I had got it, thanks anyways


Re: Bug command help - MichaelWharton101 - 18.04.2013

or not fixed... hmmm help more please?


Re: Bug command help - HurtLocker - 18.04.2013

Did you try my last edit?


Re: Bug command help - MichaelWharton101 - 18.04.2013

Yes sir


Re: Bug command help - Azazelo - 18.04.2013

this

Quote:

new playerid, bugtype;

replace:

Quote:

new playerid, bugtype[64];

to use this:
Quote:

if(!strcmp(bugtype, "low", true)




Re: Bug command help - Giroud12 - 18.04.2013

pawn Код:
else
{
if (strcmp("/buygod", cmdtext, true, 10) == 0)
{  
        if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
        if(strlen(params) > 128) return SendClientMessage(playerid, COLOR_GREY, "Maximum characters limit is 128.");
           {
                     new File: file = fopen("bugs.cfg", io_append), string[128];
                     format(string, sizeof(string), "%s\r\n", params);
                     fwrite(file, string);
                     fclose(file);
           }
    }
}
Try this


Re: Bug command help - MichaelWharton101 - 18.04.2013

Quote:
Originally Posted by Azazelo
Посмотреть сообщение
this



replace:



to use this:
I had got this now

C:\Users\Michael\Desktop\A-RP\gamemodes\A-RP.pwn(21591) : error 001: expected token: ")", but found "{"


edit:

Okay I have NO errors but now IG it will not do what I want it to... I do '/bug low this is a test' and will not change anything on my /bugs command