[HELP] Send money
#1

Hello,

I've been working on a /enter command that should send an entrance fee to a special person, this person is using pLeader == 1.

So basicly, if a player is pLeader == 1, he or she should recive money from every player that type the command.

Thanks for any support you can give me.
Reply
#2

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/enter", cmdtext, true, 10) == 0)
	{
                GivePlayerMoney(playerid, -100);
                SendLeaderMoney();
		return 1;
	}
	return 0;
}


forward SendLeaderMoney();
public SendLeaderMoney()
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
		        if(PlayerInfo[i][pLeader] >= 1)
		        {
				GivePlayerMoney(playerid, 100);
			}
		}
	}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)