[Solved] Will this cmd work?
#1

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


Reply
#2

Does the command still work?
Reply
#3

What do you meen?
Reply
#4

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

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;
}
Reply
#6

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)