/pay Problem
#1

Код:
CMD:pay(playerid, params[])
{
	new giveplayerid, moneys, string[128];
	if(sscanf(params, "ud"),giveplayerid, moneys) return SyntaxMessage(playerid, "/pay [playerid/name] [amount]");
	if(moneys > 1000 && PlayerInfo[playerid][pLevel] < 3) return SendClientMessage(playerid, GREY, "    You must be level 3 to pay more than $1,000 at a time.");
	if(moneys < 1 || moneys > 150000) return SendClientMessage(playerid, GREY, "    You cannot pay under $1 or more than $150,000 at a time.");
	if(IsPlayerConnected(giveplayerid))
	{
		if(giveplayerid == playerid) return SendClientMessage(playerid, GREY, "    You cannot pay money to yourself.");
		if(giveplayerid != INVALID_PLAYER_ID)
		{
			if(ProxDetectorS(5.0, playerid, giveplayerid))
			{
				new playermoney = PlayerInfo[playerid][pCash];
				if(moneys > 0 && playermoney >= moneys)
				{
					PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-moneys;
					GivePlayerMoney(playerid, (0 - moneys));
					PlayerInfo[giveplayerid][pCash] = PlayerInfo[giveplayerid][pCash]+moneys;
					GivePlayerMoney(giveplayerid, moneys);
					format(string, sizeof(string), "   You have sent %s(player: %d), $%d.", pName(giveplayerid), giveplayerid, moneys);
					SendClientMessage(playerid, GREY1, string);
					format(string, sizeof(string), "   You have recieved $%d from %s(player: %d).", moneys, pName(playerid), playerid);
					SendClientMessage(giveplayerid, GREY1, string);
					if(PlayerInfo[playerid][pMask] == 1) format(string, sizeof(string), "* Stranger takes out some Cash, and hands it to %s.",pName(giveplayerid));
					else format(string, sizeof(string), "* %s takes out some Cash, and hands it to %s.", pName(playerid),pName(giveplayerid));
					ProxDetector(30.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
					PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
					PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
					new plrIP[16];
					new giveplrIP[16];
					GetPlayerIp(playerid, plrIP, sizeof(plrIP));
					GetPlayerIp(giveplayerid, giveplrIP, sizeof(giveplrIP));
					format(string, sizeof(string), "%s (IP:%s) (Key:%d) (ConTime:%d) has paid $%d to %s (IP:%s) (Key:%d)", pName(playerid),plrIP,PlayerInfo[playerid][pKey], PlayerInfo[playerid][pConnectTime],moneys,pName(giveplayerid),giveplrIP,PlayerInfo[giveplayerid][pKey]);
					PayLog(string);
				}
				else return SendClientMessage(playerid, GREY1, "Invalid transaction amount.");

			}
			else return SendClientMessage(playerid, GREY, "    You are too far away.");
		}
	}
	else { SendClientMessage(playerid, WHITE, "	Not an active player!"); }
	return 1;
Not sure whats up but I am getting this error "You cannot pay under $1 or more than $150,000 at a time". Any help will be rep'd thanks!
Reply


Messages In This Thread
/pay Problem - by acade - 20.01.2013, 00:04
Re: /pay Problem - by Stevo127 - 20.01.2013, 00:08
Re: /pay Problem - by acade - 20.01.2013, 00:10
Re: /pay Problem - by Stevo127 - 20.01.2013, 00:13
Re: /pay Problem - by acade - 20.01.2013, 11:38
Re: /pay Problem - by Spyster - 21.01.2013, 16:56
Re: /pay Problem - by Spyster - 22.01.2013, 17:57
Re: /pay Problem - by FUNExtreme - 22.01.2013, 18:02
Re: /pay Problem - by Spyster - 22.01.2013, 18:17
Re: /pay Problem - by FUNExtreme - 22.01.2013, 18:20

Forum Jump:


Users browsing this thread: 5 Guest(s)