charity
#1

hey guys i have this cmd and i want if a player donate more than 10k to give the mayor that message from

Код HTML:
if(charity > 10000)
		{
			format(gString, sizeof(gString), "%s a facut o donatie de: $%s.", GetName(playerid), FormatNumber(charity));
			SendMayorMessage(3, COLOR_NEWBIE, gString);
		}
and this is the cmd

Код HTML:
CMD:charity(playerid, params[])
{
	new charity;
	if(gLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Tu nu esti logat si nu poti sa folosesti aceasta comanda!");
	if(PlayerInfo[playerid][pPIN] != -1 && LoggedPIN[playerid] == 0 && PinSecurity == 0) return SendClientMessage(playerid, COLOR_ERROR, "Nu ai acces la aceasta comanda. Trebuie sa te loghezi cu codul tau PIN (/pin).");
	if(sscanf(params,"i", charity)) return SendClientMessage(playerid, COLOR_SYN,"Sintaxa:{FFFFFF} /charity <amount>");
	{
	    if(MoneyACheck(playerid, charity, 1, 5000000)) return 1;
        if(GetPlayerCash(playerid) < charity) return SendClientMessage(playerid, COLOR_ERROR, "Tu nu ai suficienti bani.");
		format(gString, sizeof(gString), "Multumesc pentru donatie $%s.", FormatNumber(charity));
		SendClientMessage(playerid,COLOR_SYN2,gString);
		if(charity > 10000)
		{
			format(gString, sizeof(gString), "%s a facut o donatie de: $%s.", GetName(playerid), FormatNumber(charity));
			SendMayorMessage(3, COLOR_NEWBIE, gString);
		}
		format(gString, sizeof(gString), "Poti sa ii multumesti tastand: /ms <Nume/ID> <Suma>");
		SendMayorMessage(3, COLOR_NEWBIE, gString);
		CharityMoney += charity;
		GivePlayerCash(playerid, -charity);
		gQuery[0] = (EOS);
		mysql_format(handle, gQuery, sizeof(gQuery),"UPDATE `others` SET `Charity`=%d WHERE `ID`='1'", CharityMoney);
		mysql_tquery(handle, gQuery, "", "");
	}
	return 1;
}
Reply
#2

So, what's the problem?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)