ID 0 bug
#1

Now I am having the ID 0 bug but it has nothing to do with outdated plugins or includes, as this is happening just for this one command, which is a report CMD but it fully works however when ID 0 makes a report on any other ID he automatically reports himself, Anyone got a clue?

I am using sscanf,

Код:
YCMD:report(playerid, params[], help) {
	new playa;
	if(help) {
		SendClientMessage(playerid, X11_WHITE, "Used for reporting a player");
		return 1;
	}
	if(!sscanf(params, "k<playerLookup_acc>", playa)) {
		if(!IsPlayerConnectEx(playa)) {
			SendClientMessage(playerid, X11_TOMATO_2, "Invalid User!");
			return 1;
		}
	if(GetPVarInt(playerid, "ReportBanned") == 1) {
		SendClientMessage(playerid, X11_TOMATO_2, "You are report banned!");
		return 1;
	}
	if(noreportsystem) {
		SendClientMessage(playerid, X11_TOMATO_2, "Reports are disabled use /newb");
		return 1;
	}
	if(IsPlayerConnected(playerid)) {
		new time = GetPVarInt(playerid, "RequestChatCooldown");
		new timenow = gettime();
		if(REQUESTCHAT_COOLDOWN-(timenow-time) > 0) {
		SendClientMessage(playerid, X11_TOMATO_2, "You must wait before sending another report!");
		return 1;
		}
		SetPVarInt(playerid, "TargetReportID", playa);
		SendClientMessage(playerid, X11_TOMATO_2, "%s", GetPlayerNameEx(playa, ENameType_CharName));
		SetPVarInt(playerid, "RequestChatCooldown", gettime());
		ShowPlayerDialog(playerid, EAdminDialog_ShowReportOptions, DIALOG_STYLE_LIST, "Report", "Deathmatch\nFailure to RP\nPowergaming\nMetagaming\nRefund Request\nAdmin Request\nStuck\nAjail Appeal\nServer Advertiser\nUNRP Actions\nTrolling\nHacker", "Accept", "Cancel");
		SetPVarInt(playerid, "SentReport", 1);
	} else {
		SendClientMessage(playerid, X11_WHITE, "USAGE: /report [ID]");
		}
	}
	return 1; 
}
Reply
#2

Please put the codes into your thread if you need any help. We can't help without them.
Reply
#3

Quote:
Originally Posted by dominik523
Посмотреть сообщение
Please put the codes into your thread if you need any help. We can't help without them.
Done hope that is enough.
Reply
#4

pawn Код:
YCMD:report(playerid, params[], help)
{
    if(!IsPlayerConnected(playerid)) return 1;
    if(help) return SendClientMessage(playerid, X11_WHITE, "Used for reporting a player");
    if(GetPVarInt(playerid, "ReportBanned") == 1) return SendClientMessage(playerid, X11_TOMATO_2, "You are report banned!");
    if(noreportsystem) return SendClientMessage(playerid, X11_TOMATO_2, "Reports are disabled use /newb");
    new playa;
    if(sscanf(params, "u", playa)) return SendClientMessage(playerid, X11_WHITE, "USAGE: /report [ID]");
    if(!IsPlayerConnectEx(playa) || playa == INVALID_PLAYER_ID) return SendClientMessage(playerid, X11_TOMATO_2, "Invalid User!");
    new time = GetPVarInt(playerid, "RequestChatCooldown"), timenow = gettime();
    if(REQUESTCHAT_COOLDOWN - (timenow - time) > 0) return SendClientMessage(playerid, X11_TOMATO_2, "You must wait before sending another report!");
    SetPVarInt(playerid, "TargetReportID", playa);
    SendClientMessage(playerid, X11_TOMATO_2, "%s", GetPlayerNameEx(playa, ENameType_CharName));
    SetPVarInt(playerid, "RequestChatCooldown", gettime());
    ShowPlayerDialog(playerid, EAdminDialog_ShowReportOptions, DIALOG_STYLE_LIST, "Report", "Deathmatch\nFailure to RP\nPowergaming\nMetagaming\nRefund Request\nAdmin Request\nStuck\nAjail Appeal\nServer Advertiser\nUNRP Actions\nTrolling\nHacker", "Accept", "Cancel");
    SetPVarInt(playerid, "SentReport", 1);
    return 1;
}
Your usage of sscanf was incorrect.
Reply
#5

Quote:
Originally Posted by Threshold
Посмотреть сообщение
This line is wrong:
pawn Код:
GetPVarInt(playerid, "TargetReportID", playa);
It should be:
pawn Код:
playa = GetPVarInt(playerid, "TargetReportID");
This was the problem
Reply
#6

This line is wrong:
pawn Код:
GetPVarInt(playerid, "TargetReportID", playa);
It should be:
pawn Код:
playa = GetPVarInt(playerid, "TargetReportID");
Reply
#7

Don't complain if you're deliberately ignoring warnings. The line Threshold mentioned above should have at least given you a number of arguments does not match definition warning.
Reply
#8

Quote:
Originally Posted by Threshold
Посмотреть сообщение
This line is wrong:
pawn Код:
GetPVarInt(playerid, "TargetReportID", playa);
It should be:
pawn Код:
playa = GetPVarInt(playerid, "TargetReportID");
Thanks found that out for myself

Quote:
Originally Posted by Vince
Посмотреть сообщение
Don't complain if you're deliberately ignoring warnings. The line Threshold mentioned above should have at least given you a number of arguments does not match definition warning.
Hear me complaining?? no so stfu, And I am using a script which already has warnings so its hard to see whats wrong, Next time think before you give these negative comments.
Reply
#9

Quote:
Originally Posted by Glenn332
Посмотреть сообщение
Thanks found that out for myself



Hear me complaining?? no so stfu, And I am using a script which already has warnings so its hard to see whats wrong, Next time think before you give these negative comments.
Please behave yourself. As soon as you see the warnings, solve them.
Vince has tried to help you, not to just give you negative comments. He's one of those guys here that you should trust and take advices from.
Reply
#10

Quote:
Originally Posted by dominik523
Посмотреть сообщение
Please behave yourself. As soon as you see the warnings, solve them.
Vince has tried to help you, not to just give you negative comments. He's one of those guys here that you should trust and take advices from.
Assuming things and saying things like that is not really helping
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)