31.05.2012, 06:20
pawn Код:
if(strfind(Player[i][Ref], "Nothing", false))
{
new Referral = Player[i][Ref];
format(string, sizeof(string), "Accounts/%s.ini", Player[i][Ref]);
if(fexist(string))
{
if (IsPlayerConnected(Referral))
{
Player[Referral][Refs]++;
Player[Referral][Money] += 10000;
Player[Referral][Pot] += 20;
Player[Referral][Cocaine] += 15;
Player[Referral][Materials] += 2000;
SendClientMessage(i, DEPARTMENT_CHAT, "Your referral is online and was rewarded, as you reached your fifth playing hour!.");
SendClientMessage(i, DEPARTMENT_CHAT, "Enjoy the server.");
SendClientMessage(Referral, DEPARTMENT_CHAT, "One of the players you brought to the server reached his fifth played hour!", GetName(i));
SendClientMessage(Referral, DEPARTMENT_CHAT, "You were given a reward! Thanks for your effort to improve the community!");
format(string, sizeof(string), "%s gained 5 playing hours - he was brought by %s.", Referral, i);
RefLog(string);
}
else
{
format(string, sizeof(string), "Accounts/%s.ini", Player[i][Ref]);
dini_IntSet(string, "PendingRef", 1);
SendClientMessage(Referral, DEPARTMENT_CHAT, "Your referral is not online but he'll be rewarded when he's online, for your fifth playing hour!", Player[i][Ref]);
SendClientMessage(Referral, DEPARTMENT_CHAT, "Enjoy the server.");
format(string, sizeof(string), "%s gained 5 playing hours - he was brought by %s but was not online!", Referral, i);
RefLog(string);
}
}
else
{
SendClientMessage(i, WHITE, "Your referral changed his name! Unable to reward him.");
}
}