SA-MP Forums Archive
[Solved] Will this cmd work? - 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: [Solved] Will this cmd work? (/showthread.php?tid=119095)



[Solved] Will this cmd work? - waza75 - 06.01.2010

Have a look. I am new to scripting and I made this.
Will this work?

Код:
COMMAND:pay(playerid, params[])
{
	new
 	 payid,
  	amount;

if (!sscanf(params, "ii", payid, amount))
{
  		if (payid != INVALID_PLAYER_ID)
  		{
			new
		  	 playercash[40]
			playercash = GetPlayerMoney
			if(playercash < amount)
			{
			SendClientMessage(playerid, 0xFFFFFFFF, "You can't afford that");
			}
			else
			{
			GivePlayerMoney(payid, amount);
			}
		
		}
 		else SendClientMessage(playerid, 0xFF0000FF, "That player is not connected");
	}
	return 1;
}
I get this warning tough
Quote:

C:\Users\kids\Desktop\try.pwn(249) : warning 203: symbol is never used: "pay"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.

Thanks





Re: [HELP] Will this cmd work? - ClanDBZVegeta - 06.01.2010

Does the command still work?


Re: [HELP] Will this cmd work? - waza75 - 06.01.2010

What do you meen?


Re: [HELP] Will this cmd work? - ClanDBZVegeta - 06.01.2010

Quote:
Originally Posted by waza75
What do you meen?
if it compiles go check if /pay works :P


Re: [HELP] Will this cmd work? - Sergei - 06.01.2010

pawn Код:
COMMAND:pay(playerid, params[])
{
    new payid,amount;
    if (!sscanf(params, "ui", payid, amount))
    {
        if (payid != INVALID_PLAYER_ID)
        {
            if(GetPlayerMoney(playerid) < amount) SendClientMessage(playerid, 0xFFFFFFFF, "You can't afford that");
            else GivePlayerMoney(payid, amount);
        }
        else SendClientMessage(playerid, 0xFF0000FF, "That player is not connected");
    }
    return 1;
}



Re: [HELP] Will this cmd work? - waza75 - 06.01.2010

Thanks