Help here Cash Goes in -ve
#7

ralf i can't add it like this way so can u
pawn Code:
if(GameHour == 23 && GameMinute == 59)
    {
        for(new i = 0; i < GetMaxPlayers(); i++)
        {
            for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
            {
                if(IsPlayerConnected(playerid) && spawned[playerid] == 1)
                {
                    pInfo[playerid][DaysAlive] ++;
                    if(pInfo[playerid][DaysAlive] == 1)
                    {
                        if(online != 1)
                        {
                            pInfo[playerid][birthdays] ++;

                            new pmoney, randcash,playername[100];
                            new oldcash,newcash;
                            oldcash = GetPlayerMoney(i);
                            pmoney = GetPlayerMoney(i);
                            GetPlayerName(playerid,playername, sizeof(playername));
                            randcash = random(pmoney/2);
                            GiveCashToPlayer(i,-randcash);
                            GivePlayerMoney(playerid, randcash);
                            newcash = oldcash - GetPlayerMoney(i);
                            SCM(playerid,COLOR_ORANGE,"Happy Birth Day");
                            new str[500],str1[500];
                            format(str,sizeof(str),"~g~h~Happy ~b~~h~Birth ~P~H~Day~N~~W~Recived ~G~$%d",randcash);
                            GameTextForPlayer(playerid,str,5000,3);
                            format(str1,sizeof(str1),"~g~h~Happy ~b~~h~Birth ~P~H~Day~N~~W~%s(%d)~N~Sent ~G~$%d",playername,playerid,newcash);
                            GameTextForAllBut(playerid,str1,5000,3);
                            format(string,sizeof(string),"~P~~H~HAPPY BIRH DAY ~W~%s(%d) ~B~~H~is now ~R~~H~%d ~B~~H~years old",playername,playerid,pInfo[playerid][birthdays]);
                            TextDrawSetString(Textdraw222,string);
                            TextDrawShowForAll(Textdraw222);
                            AUTO_SAVE(playerid);
                        }
                        else
                        {
                            pInfo[playerid][birthdays] ++;
                            new playername[100];
                            GetPlayerName(playerid,playername, sizeof(playername));
                            GivePlayerMoney(playerid, 200000);
                            new str[500];
                            format(str,sizeof(str),"Happy Birth Day Recived "GREEN"$200000");
                            SCM(playerid,COLOR_SKYBLUE,str);
                            format(string,sizeof(string),"~P~~H~HAPPY BIRTH DAY ~W~%s(%d) ~B~~H~is now ~R~~H~%d ~B~~H~years old",playername,playerid,pInfo[playerid][birthdays]);
                            TextDrawSetString(Textdraw222,string);
                            TextDrawShowForAll(Textdraw222);
                            GameTextForPlayer(playerid,"~g~h~Happy ~b~~h~Birth ~P~H~Day~N~~W~Recived ~G~$200000",5000,3);
                            AUTO_SAVE(playerid);
                        }
                    }
                    if(pInfo[playerid][DaysAlive] == 3 && pInfo[playerid][birthdays] == 1)
                    {
                        if(online != 1)
                        {
                            pInfo[playerid][birthdays] ++;
                            new pmoney, randcash,randcash2,playername[100];
                            pmoney = GetPlayerMoney(i);
                            GetPlayerName(playerid,playername, sizeof(playername));
                            randcash = random(pmoney);
                            randcash2 = randcash*2;
                            GiveCashToPlayer(playerid,-randcash);
                            GivePlayerMoney(playerid, randcash2);
                            SCM(playerid,COLOR_ORANGE,"Happy Birth Day");
                            new str[500],str1[500];
                            format(str,sizeof(str),"~g~h~Happy ~b~~h~Birth ~P~H~Day~N~~W~Recived ~G~$%d",randcash2);
                            GameTextForPlayer(playerid,str,5000,3);
                            format(str1,sizeof(str1),"~g~h~Happy ~b~~h~Birth ~P~H~Day~N~~W~%s(%d)~N~Sent ~G~$%d",playername,playerid,randcash);
                            GameTextForAllBut(playerid,str1,5000,3);
                            format(string,sizeof(string),"~P~~H~HAPPY BIRH DAY ~W~%s(%d) ~B~~H~is now ~R~~H~%d ~B~~H~years old",playername,playerid,pInfo[playerid][birthdays]);
                            TextDrawSetString(Textdraw222,string);
                            TextDrawShowForAll(Textdraw222);
                            AUTO_SAVE(playerid);
                        }
                        else
                        {
                            pInfo[playerid][birthdays] ++;
                            new playername[100];
                            GetPlayerName(playerid,playername, sizeof(playername));
                            GivePlayerMoney(playerid, 400000);
                            new str[500];
                            format(str,sizeof(str),"Happy Birth Day Recived "GREEN"$400000");
                            SCM(playerid,COLOR_SKYBLUE,str);
                            format(string,sizeof(string),"~P~~H~HAPPY BIRTH DAY ~W~%s(%d) ~B~~H~is now ~R~~H~%d ~B~~H~years old",playername,playerid,pInfo[playerid][birthdays]);
                            TextDrawSetString(Textdraw222,string);
                            TextDrawShowForAll(Textdraw222);
                            GameTextForPlayer(playerid,"~g~h~Happy ~b~~h~Birth ~P~H~Day~N~~W~Recived ~G~$400000",5000,3);
                            AUTO_SAVE(playerid);
                        }
                    }
                }
            }
        }
    }
Reply


Messages In This Thread
Help here Cash Goes in -ve - by AroseKhanNiazi - 08.05.2014, 10:34
Re: Help here Cash Goes in -ve - by AroseKhanNiazi - 09.05.2014, 13:08
Re: Help here Cash Goes in -ve - by AroseKhanNiazi - 09.05.2014, 14:17
Re: Help here Cash Goes in -ve - by DaniceMcHarley - 09.05.2014, 14:25
Re: Help here Cash Goes in -ve - by AroseKhanNiazi - 09.05.2014, 15:11
Re: Help here Cash Goes in -ve - by AroseKhanNiazi - 09.05.2014, 15:24
Re: Help here Cash Goes in -ve - by AroseKhanNiazi - 11.05.2014, 06:59
Re: Help here Cash Goes in -ve - by AroseKhanNiazi - 13.05.2014, 04:31
Re: Help here Cash Goes in -ve - by AroseKhanNiazi - 13.05.2014, 11:47
Re: Help here Cash Goes in -ve - by AroseKhanNiazi - 13.05.2014, 14:20

Forum Jump:


Users browsing this thread: 2 Guest(s)