fix my /reports /setvip commands
#1

whenever i write it in-game /report it always show me twice this command /report (playerid) (reason)
Код:
CMD:report(playerid, params[])
{
	if(pInfo[playerid][pLogged] == 1)
	{

		new text[128],targetid,string[128],sendername[MAX_PLAYER_NAME],giveplayer[MAX_PLAYER_NAME];
		if(sscanf(params, "us[128]", targetid, text)) SendClientMessage(playerid, COLOR_GREY, "Usage: /report [playerid] [reason]");
		else
		{
			if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "Invaild ID - That player is not connected!");
			format(sendername, sizeof(sendername), "%s", PlayerName(playerid));
			format(giveplayer, sizeof(giveplayer), "%s", PlayerName(targetid));
			format(string, sizeof(string), "Report: %s[%d] has reported %s[%d] [Reason: %s]", sendername, playerid, giveplayer, targetid, text);
			SendMessageToAdmins(COLOR_YELLOW,string);
			printf("Report: %s[%d] has reported %s[%d] [Reason: %s]", sendername, playerid, giveplayer, targetid, text);
			SendClientMessage(playerid, COLOR_GREEN,"Thanks for reporting!");
		}
	}
    else if(pInfo[playerid][pLogged] == 0)
	{
		SendClientMessage(playerid,-1,""chat""COL_LIGHTBLUE" Nice try u fucking fag gay!");
		printf("%s has been kicked for trying to use a command without being logged in!", PlayerName(playerid));
		Kick(playerid);
	}
	return 1;
}
this also whenever i write /setvip it shows me the message twice /setvip (id) (level)
Код:
CMD:setvip(playerid,params[])
{
	if(pInfo[playerid][pLogged] == 1)
	{
		if(pInfo[playerid][pAdminLevel] >= 6)
		{
			new targetid,level,string[256];
			if(sscanf(params, "ud", targetid, level)) return  SendClientMessage(playerid,-1,""chat" /setdonor [playerid] [level]");
			if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""chat" Player is not online");
			if(level < 0 || level > 5) return SendClientMessage(playerid,-1,""chat" Vip levels are ONLY between 1-5");

			pInfo[targetid][pVipLevel] = level;

			format(string, sizeof(string), ""chat""COL_LIGHTBLUE" %s %s have given vip status of %d to %s",GetAdminName(playerid),PlayerName(playerid),level,PlayerName(targetid));
			SendClientMessageToAll(-1,string);
			printf(" %s %s have given vip status of %d to %s",GetAdminName(playerid),PlayerName(playerid),level,PlayerName(targetid));
		}
		else {
			SendClientMessage(playerid,-1,""chat""COL_LIGHTBLUE" You do not have the right admin permissions for this command!");
		}
	}
    else if(pInfo[playerid][pLogged] == 0)
	{
		SendClientMessage(playerid,-1,""chat""COL_LIGHTBLUE" Nice try u fucking fag gay!");
		printf("%s has been kicked for trying to use a command without being logged in!", PlayerName(playerid));
		Kick(playerid);
	}
	return 1;
}
Reply
#2

On your CMD:report --
pawn Код:
if(sscanf(params, "us[128]", targetid, text)) SendClientMessage(playerid, COLOR_GREY, "Usage: /report [playerid] [reason]");
Needs to be
pawn Код:
if(sscanf(params, "us[128]", targetid, text)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /report [playerid] [reason]");
Reply
#3

Not working.
Reply
#4

Try this

pawn Код:
if(sscanf(params, "us", targetid, text))
{
    SendClientMessage(playerid, COLOR_GREY, "Usage: /report [playerid] [reason]");
    return 1;
}
Reply
#5

Not working.
Reply
#6

pawn Код:
CMD:report(playerid, params[])
{
    if(pInfo[playerid][pLogged] == 1)
    {
        new text[128], targetid, string[128];
        if(sscanf(params, "us[128]", targetid, text)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /report [playerid] [reason]");
        if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "Invaild ID - That player is not connected!");
        format(string, sizeof(string), "Report: %s[%d] has reported %s[%d] [Reason: %s]", PlayerName(playerid), playerid, PlayerName(targetid), targetid, text);
        SendMessageToAdmins(COLOR_YELLOW, string);
        printf("Report: %s[%d] has reported %s[%d] [Reason: %s]", PlayerName(playerid), playerid, PlayerName(targetid), targetid, text);
        SendClientMessage(playerid, COLOR_GREEN, "Thanks for reporting!");
    }
    else
    {
        SendClientMessage(playerid, -1, ""chat""COL_LIGHTBLUE" Nice try u fucking fag gay!");
        printf("%s has been kicked for trying to use a command without being logged in!", PlayerName(playerid));
        Kick(playerid);
    }
    return 1;
}
Reply
#7

Not working.
Reply
#8

You just saying not working. Explain HOW is not working, does it return anything?
Reply
#9

bro whenever i write it /report it always returning me report (id) (message) twice again!
Reply
#10

have a look
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)