[HELP] Send money - 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: [HELP] Send money (
/showthread.php?tid=193552)
[HELP] Send money -
Fredden1993 - 26.11.2010
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.
Re: [HELP] Send money -
ExEx - 26.11.2010
Код:
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);
}
}
}
}