Bug command help
#1

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)
Reply
#2

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);
           }
    }
}
Reply
#3

nope still got the same error
Reply
#4

I had got it, thanks anyways
Reply
#5

or not fixed... hmmm help more please?
Reply
#6

Did you try my last edit?
Reply
#7

Yes sir
Reply
#8

this

Quote:

new playerid, bugtype;

replace:

Quote:

new playerid, bugtype[64];

to use this:
Quote:

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

Reply
#9

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
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)