SA-MP Forums Archive
Whats wrong... - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Whats wrong... (/showthread.php?tid=172262)



Whats wrong... - MartinDee - 29.08.2010

Whats wrong with it?

Код:
command(bentrancefee, playerid, params[])
{
    new money;
	if( sscanf( params, "dd", money) )
	{
	    if( Player[playerid][Business] > 0 )
	    {
	        SendClientMessage( playerid, WHITE, "TIP: /bentrancefee [price]" );
		}
		else
		{
			if( Player[playerid][Business] > 0 )
			{
	    		Businesses[Player[playerid][Business]][bEntrance] = money;
	    		SendClientMessage( playerid, WHITE, "Your bizness entrance fee were setted to %s", Businesses[Player[playerid][Business]][bEntrance]); // 24073 this is the warning line
			}
		}
	}
	return 1;
}
Код:
C:\SA-MP Server\gamemodes\Roleplay.pwn(24073) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Whats wrong there?


Re: Whats wrong... - Jeffry - 29.08.2010

Use this, instead of the warning line:
pawn Код:
new string[128];
format(string, 128, "Your bizness entrance fee were setted to %s", Businesses[Player[playerid][Business]][bEntrance]);
SendClientMessage( playerid, WHITE, string);



Re: Whats wrong... - Bumbis - 29.08.2010

pawn Код:
command(bentrancefee, playerid, params[])
{
    new money;
    new string[128];
    if( sscanf( params, "d", money) )
    {
        if( Player[playerid][Business] > 0 )
        {
            SendClientMessage( playerid, WHITE, "PARAUGS: /bentrancefee [cena]" );
        }
        else
        {
            if( Player[playerid][Business] > 0 )
            {
                Businesses[Player[playerid][Business]][bEntrance] = money;
                        format(string,sizeof(string),"Tava biznesa ieejas maksa tika uzstādīta uz %d", money);
                SendClientMessage( playerid, WHITE, string);
                        return 1;
            }
        }
    }
    return 1;
}
Try this


Re: Whats wrong... - MartinDee - 29.08.2010

Thank you.