Getinfo command not displaying info.
#1

Hi, I have this problem with my GetInfo command.

When I do !getinfo [id] on IRC, it just displays this result every time:

Код:
Skin ID: 0 | IP: 49 | Ping: 0 | Score: 0 | Money: 0 | Armour: 100.000000 | Health: 100.000000
Here's the command:

Код:
IRCCMD:getinfo(botid, channel[], user[], host[], params[])
{
	new playerid, reason, skinid, pip[16], ping, score, money, float:armour, float:health, string[500];
	//Playerid

	if (sscanf(params, "dS(No reason.)[64]", playerid, reason))
	{
	    return 1;
	}

    if (IRC_IsHalfop(botid, channel, user))
	{
		if(IsPlayerConnected(playerid))
		{
			GetPlayerSkin(playerid, skinid);
			GetPlayerIp(playerid, pip, 16);
			GetPlayerPing(playerid, ping);
			GetPlayerScore(playerid, score);
			GetPlayerMoney(playerid, money);
			GetPlayerArmour(playerid, armour);
			GetPlayerHealth(playerid, health);
			format(string, 500, "Skin ID: %d | IP: %d | Ping: %d | Score: %d | Money: %d | Armour: %0.f | Health: %0.f", skinid, pip, ping, score, money, armour, health);
			IRC_GroupSay(groupID, channel, string);
		}
	}
	return 1;
}
Also, when compiling I also get these warnings:

Код:
C:\Users\X\Desktop\irc.pwn(981) : warning 202: number of arguments does not match definition
C:\Users\X\Desktop\irc.pwn(983) : warning 202: number of arguments does not match definition
C:\Users\X\Desktop\irc.pwn(984) : warning 202: number of arguments does not match definition
C:\Users\X\Desktop\irc.pwn(985) : warning 202: number of arguments does not match definition
C:\Users\X\Desktop\irc.pwn(986) : warning 213: tag mismatch
C:\Users\X\Desktop\irc.pwn(987) : warning 213: tag mismatch
Reply
#2

Код:
C:\Users\X\Desktop\irc.pwn(981) : warning 202: number of arguments does not match definition
C:\Users\X\Desktop\irc.pwn(983) : warning 202: number of arguments does not match definition
C:\Users\X\Desktop\irc.pwn(984) : warning 202: number of arguments does not match definition
C:\Users\X\Desktop\irc.pwn(985) : warning 202: number of arguments does not match definition
C:\Users\X\Desktop\irc.pwn(986) : warning 213: tag mismatch
C:\Users\X\Desktop\irc.pwn(987) : warning 213: tag mismatch
What is the code on those lines?
Reply
#3

Quote:
Originally Posted by PlayLSX_Founder
Посмотреть сообщение
Код:
C:\Users\X\Desktop\irc.pwn(981) : warning 202: number of arguments does not match definition
C:\Users\X\Desktop\irc.pwn(983) : warning 202: number of arguments does not match definition
C:\Users\X\Desktop\irc.pwn(984) : warning 202: number of arguments does not match definition
C:\Users\X\Desktop\irc.pwn(985) : warning 202: number of arguments does not match definition
C:\Users\X\Desktop\irc.pwn(986) : warning 213: tag mismatch
C:\Users\X\Desktop\irc.pwn(987) : warning 213: tag mismatch
What is the code on those lines?
Код:
			GetPlayerSkin(playerid, skinid);
			GetPlayerIp(playerid, pip, 16);
			GetPlayerPing(playerid, ping);
			GetPlayerScore(playerid, score);
			GetPlayerMoney(playerid, money);
			GetPlayerArmour(playerid, armour);
			GetPlayerHealth(playerid, health);
Reply
#4

Note: Half of these functions returns the values which is called Call by Value! What you were doing is called Call By Reference.

Change This:

pawn Код:
GetPlayerSkin(playerid, skinid);
            GetPlayerIp(playerid, pip, 16);
            GetPlayerPing(playerid, ping);
            GetPlayerScore(playerid, score);
            GetPlayerMoney(playerid, money);
            GetPlayerArmour(playerid, armour);
            GetPlayerHealth(playerid, health);
To This:

pawn Код:
skindid = GetPlayerSkin(playerid);
            GetPlayerIp(playerid, pip, 16);
            ping = GetPlayerPing(playerid);
            score = GetPlayerScore(playerid);
            money = GetPlayerMoney(playerid);
            GetPlayerArmour(playerid,armour );
            GetPlayerHealth(playerid,health);
Reply
#5

OK, I get these errors:

Код:
C:\Users\Noah\Desktop\irc.pwn(986) : warning 202: number of arguments does not match definition
C:\Users\Noah\Desktop\irc.pwn(986) : warning 213: tag mismatch
C:\Users\Noah\Desktop\irc.pwn(987) : warning 202: number of arguments does not match definition
C:\Users\Noah\Desktop\irc.pwn(987) : warning 213: tag mismatch
Lines 986-987:

Код:
            armour = GetPlayerArmour(playerid);
            health = GetPlayerHealth(playerid);
Reply
#6

armour, and health is not float.

actually it must be like this

pawn Код:
new Float:armour, Float:health;
GetPlayerArmour(playerid, armour);
GetPlayerHealth(playerid, health);
Reply
#7

My Bad this one's gonna be fine!

pawn Код:
skindid = GetPlayerSkin(playerid);
            GetPlayerIp(playerid, pip, 16);
            ping = GetPlayerPing(playerid);
            score = GetPlayerScore(playerid);
            money = GetPlayerMoney(playerid);
            GetPlayerArmour(playerid,armour);
            GetPlayerHealth(playerid,health);
Reply
#8

Still Tag Mismatch's with GetPlayerArmour and GetPlayerHealth. Everything else is fixed.
Reply
#9

That means that you're using them as integers and you should use them as floats.
pawn Код:
new Float:armour;
new Float:health;
Reply
#10

FIXED, TY! +REP for you Dwane.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)