SA-MP Forums Archive
How can I do this? - 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: How can I do this? (/showthread.php?tid=69255)



How can I do this? - notec100 - 16.03.2009

I'd like to make it so once a game day every 24 minutes, players on certain teams will get paid and receive a small message informing them. Thanks in advance!


Re: How can I do this? - Mikep - 16.03.2009

https://sampwiki.blast.hk/wiki/SetTimer


Re: How can I do this? - Jack_Fox - 16.03.2009

This should work:

Quote:

forward message();

Quote:

SetTimer("message",1440000,true);

Quote:

public message()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new pteam = GetPlayerTeam(i);
if(pteam == YOUR TEAM HERE)
{
SendClientMessage(i, 0xBFC0C200, "You've earned something!");
GivePlayerMoney(i, 8000);
}
}
}
}




Re: How can I do this? - notec100 - 16.03.2009

Quote:
Originally Posted by Jack_Fox
This should work:

Quote:

forward message();

Quote:

SetTimer("message",1440000,true);

Quote:

public message()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new pteam = GetPlayerTeam(i);
if(pteam == YOUR TEAM HERE)
{
SendClientMessage(i, 0xBFC0C200, "You've earned something!");
GivePlayerMoney(i, 8000);
}
}
}
}

Cool I'll try it out thanks alot!