Command Problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Command Problem (
/showthread.php?tid=375686)
Command Problem -
Eugene. - 07.09.2012
Well, I have a little problem. I made this command but seems that when I do /inventory , it shows only ID 0's Inventory. I already tested it.
Код:
CMD:inventory(playerid, params[])
{
new playerb, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
SendClientMessage(playerid, COLOR_ORANGE, "Your Inventory:");
format(string, sizeof(string), "Packages: %s | Materials: %d | Weed: %d | Crack: %d | Cigar: %d | Sprunk: %d | Ropes: %d | Blindfolds: %d", RPPN(playerb), PlayerInfo[playerb][pMaterials], PlayerInfo[playerb][pWeed], PlayerInfo[playerb][pCrack], PlayerInfo[playerb][pCigar], PlayerInfo[playerb][pSprunk], PlayerInfo[playerb][pRope], PlayerInfo[playerb][pBlindfold]);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
Re: Command Problem -
clarencecuzz - 07.09.2012
Why are you creating playerb, when you do new playerb it is automatically set to a value of 0 by default. Try using if(sscanf(params, ... etc. etc.
Is this for you to check your own inventory, or you can check either your own or others inventories?
Re: Command Problem -
Eugene. - 07.09.2012
Nevermind. I found out the problem. I forgot to write playerb = playerid
Re: Command Problem -
clarencecuzz - 07.09.2012
There's no real need for playerb, just change all playerb values to playerid.