/report bug..
#1

Код:
dcmd_report(playerid,params[])
{
	new string[128];
	new ID;
	new cmdreason[100];
	if(sscanf(params,"us[100]",ID,cmdreason))
	{
	    SendClientMessage(playerid,COLOR_GRAD1,"USAGE: /report [playerid/PartOfName] (Reason)");
	    return 1;
	}
	if(!IsPlayerConnected(ID))
	{
		format(string,sizeof(string),"That player is not conneted ");
		SendClientMessage(playerid,COLOR_GRAD1,string);
		return 1;
	}
	format(string,sizeof(string),"Your report has been sent!");
	SendClientMessage(playerid,COLOR_YELLOW,string);

	format(string,sizeof(string),"Report: %s(%d) reported: %s(%d): %s.",PlayerName(playerid),playerid,PlayerName(ID),ID, cmdreason);
	ABroadCast(RED, string, 1);
	return 1;
}
After a while I decided to start/learn scripting again, now I made this command but.. at the place the playername/id should be I can also put something else, how to get it so I can only put a playername/id there?

Thanks..!
Reply
#2

What do you mean on this "how to get is so I can only put a playername/id there?",

Like this,

/report [playerid/playername] ?
Reply
#3

You mean this I believe?

pawn Код:
dcmd_report(playerid,params[])
{
    new string[128];
    new ID;
    if(sscanf(params,"u",ID))
    {
        SendClientMessage(playerid,COLOR_GRAD1,"USAGE: /report [playerid/PartOfName]");
        return 1;
    }
    if(!IsPlayerConnected(ID))
    {
        format(string,sizeof(string),"That player is not conneted ");
        SendClientMessage(playerid,COLOR_GRAD1,string);
        return 1;
    }
    format(string,sizeof(string),"Your report has been sent!");
    SendClientMessage(playerid,COLOR_YELLOW,string);

    format(string,sizeof(string),"Report: %s(%d) reported: %s(%d).",PlayerName(playerid),playerid,PlayerName(ID),ID);
    ABroadCast(RED, string, 1);
    return 1;
}
Reply
#4

Try This :-
pawn Код:
dcmd_report(playerid,params[])
{
    new string[128];
    new ID;
    if(sscanf(params,"us[100]",ID))
    {
        SendClientMessage(playerid,COLOR_GRAD1,"USAGE: /report [playerid/PartOfName]");
        return 1;
    }
    if(!IsPlayerConnected(ID))
    {
        format(string,sizeof(string),"That player is not conneted ");
        SendClientMessage(playerid,COLOR_GRAD1,string);
        return 1;
    }
    format(string,sizeof(string),"Your report has been sent!");
    SendClientMessage(playerid,COLOR_YELLOW,string);

    format(string,sizeof(string),"Report: %s(%d) reported: %s(%d)",PlayerName(playerid),playerid,PlayerName(ID),ID);
    ABroadCast(RED, string, 1);
    return 1;
}
Reply
#5

Fixed, thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)