• 06 Juin 2026, 14:46:41


Auteur Sujet: Paye a la banque dans un RPG  (Lu 1187 fois)

0 Membres et 1 Invité sur ce sujet

Hors ligne TheAlex86

  • Geek
  • *
  • Tueur
  • Messages: 83
    • Voir le profil
Paye a la banque dans un RPG
« le: 16 Mars 2010, 13:17:45 »
Bien le bonjour,

Voila je voudrais faire un truc assez sympas,
je suis sur une base de GF , pour un serveur RP, et voila quand le jour de paye arrive tout les joueur recoivent leur paye sur eux normal quoi , mais moi j'aimerai (pour plus de rp encors) que leur paye arrive directement sur leur compte en banque ig

comment je pourrai faire ça

voici mon jour de paye

public PayDay()
{
new string[128];
new account,interest;
new rent = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pLevel] > 0)
    {
    if(MoneyMessage[i]==1)
{
    SendClientMessage(i, COLOR_LIGHTRED, "Vous n'avez pas payer vos dettes, Prison.");
    GameTextForPlayer(i, "~r~Niker !", 2000, 1);
    SetPlayerInterior(i, 6);
    SetPlayerPos(i, 264.6288,77.5742,1001.0391);
            PlayerInfo[i][pJailed] = 1;
            ResetPlayerWeapons(i);
WantedPoints[i] = 0;
PlayerInfo[i][pJailTime] = 240;
format(string, sizeof(string), "Vous avez été mis en prison pour %d secondes par un Admin.", PlayerInfo[i][pJailTime]);
SendClientMessage(i, COLOR_LIGHTBLUE, string);
}
new playername2[MAX_PLAYER_NAME];
GetPlayerName(i, playername2, sizeof(playername2));
account = PlayerInfo[i][pAccount];
new key = PlayerInfo[i][pPhousekey];
if(key != 255)
{
rent = HouseInfo[key][hRent];
if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
{
rent = 0;
}
else if(rent > GetPlayerMoney(i))
{
PlayerInfo[i][pPhousekey] = 255;
SendClientMessage(i, COLOR_WHITE, "Vous avez été expulsés.");
rent = 0;
}
HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
}
new tmpintrate;
if (key != 255 && strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
{
    if(PlayerInfo[i][pDonateRank] > 0) { tmpintrate = intrate+4; }
else { tmpintrate = intrate+2; }//HouseInfo[key][hLevel]
}
else
{
    if(PlayerInfo[i][pDonateRank] > 0) { tmpintrate = 3; }
else { tmpintrate = 1; }
}
if(PlayerInfo[i][pPayDay] >= 5)
{
    Tax += TaxValue;//Should work for every player online
    PlayerInfo[i][pAccount] -= TaxValue;
    if(PlayerInfo[i][pDonateRank] > 0)
{
    new bonus = PlayerInfo[i][pPayCheck] / 2;
    PlayerInfo[i][pPayCheck] += bonus;
}
new checks = PlayerInfo[i][pPayCheck];
    new ebill = (PlayerInfo[i][pAccount]/10000)*(PlayerInfo[i][pLevel]);
    ConsumingMoney[i] = 1;
    GivePlayerMoney(i, checks);
    if(PlayerInfo[i][pAccount] > 0)
    {
    PlayerInfo[i][pAccount] -= ebill;
    SBizzInfo[4][sbTill] += ebill;
}
else
{
    ebill = 0;
}
interest = (PlayerInfo[i][pAccount]/20000)*(tmpintrate);
PlayerInfo[i][pExp]++;
PlayerPlayMusic(i);
PlayerInfo[i][pAccount] = account+interest;
SendClientMessage(i, COLOR_WHITE, "|___ Compte banquaire ___|");
format(string, sizeof(string), "  Paye: $%d   Taxe : -$%d", checks, TaxValue);
SendClientMessage(i, COLOR_GRAD1, string);
if(PlayerInfo[i][pPhousekey] != 255 || PlayerInfo[i][pPbiskey] != 255)
{
format(string, sizeof(string), "  Facture d'Electricité: -$%d", ebill);
SendClientMessage(i, COLOR_GRAD1, string);
  }
format(string, sizeof(string), "  Balance: $%d", account);
SendClientMessage(i, COLOR_GRAD1, string);
format(string, sizeof(string), "  Interet: 0.%d percent",tmpintrate);
SendClientMessage(i, COLOR_GRAD2, string);
format(string, sizeof(string), "  Interêt aquis %d", interest);
SendClientMessage(i, COLOR_GRAD3, string);
SendClientMessage(i, COLOR_GRAD4, "|--------------------------------------|");
format(string, sizeof(string), "  Nouvelle Balance: $%d", PlayerInfo[i][pAccount]);
SendClientMessage(i, COLOR_GRAD5, string);
format(string, sizeof(string), "  loyer: -$%d", rent);
SendClientMessage(i, COLOR_GRAD5, string);
format(string, sizeof(string), "~y~Jour de Paye~n~~w~Paye");
GameTextForPlayer(i, string, 5000, 1);
rent = 0;
PlayerInfo[i][pPayDay] = 0;
PlayerInfo[i][pPayCheck] = 0;
PlayerInfo[i][pConnectTime] += 1;
if(PlayerInfo[i][pDonateRank] > 0)
{
    PlayerInfo[i][pPayDayHad] += 1;
    if(PlayerInfo[i][pPayDayHad] >= 5)
    {
        PlayerInfo[i][pExp]++;
        PlayerInfo[i][pPayDayHad] = 0;
    }
}
}
else
{
    SendClientMessage(i, COLOR_LIGHTRED, "* Vous n'avez pas joué assez longtemps pour obtenir votre Jour de Paye.");
}
}
}
}
Checkprop();
return 1;
}

Merci beaucoup.
** Traduction : 100% **
** Scripting : 70 % **
** Mapping : 85 % **
** Création de factions : 85 % **
** Ajout de véhicule : 100 % **

Hors ligne TheAlex86

  • Geek
  • *
  • Tueur
  • Messages: 83
    • Voir le profil
Re : Paye a la banque dans un RPG
« Réponse #1 le: 16 Mars 2010, 19:41:24 »
non marche po :( qqun a une idée ?
** Traduction : 100% **
** Scripting : 70 % **
** Mapping : 85 % **
** Création de factions : 85 % **
** Ajout de véhicule : 100 % **

Hors ligne TheAlex86

  • Geek
  • *
  • Tueur
  • Messages: 83
    • Voir le profil
Re : Paye a la banque dans un RPG
« Réponse #2 le: 18 Mars 2010, 18:45:41 »
bah definir justement je met les new mais je ne sais pas quoi dire quoi, c'ets ça le prob.
** Traduction : 100% **
** Scripting : 70 % **
** Mapping : 85 % **
** Création de factions : 85 % **
** Ajout de véhicule : 100 % **

Hors ligne Thiibo0w67

  • *
  • Tueur en série
  • Messages: 111
    • Voir le profil
Re : Paye a la banque dans un RPG
« Réponse #3 le: 16 Avril 2010, 22:27:48 »
Essais avec sa, je ne promet rien non plus, mais comme dit, qui tente rien n'as rien !

public PayDay()
{
   new string[128];
   new account,interest;
   new rent = 0;
   new infostring[256];
   for(new i = 0; i < MAX_PLAYERS; i++)
   {
      if(IsPlayerConnected(i))
      {
          if(PlayerInfo[pLevel] > 0)
          {
              TimeWeather(i);
             if(MoneyMessage==1)
            {
                SendClientMessage(i, COLOR_LIGHTRED, "Vous n'avez pas payer votre dette, vous allez en prison.");
                GameTextForPlayer(i, "~r~Prison !", 2000, 1);
                SetPlayerInterior(i, 6);
                PlayerInfo[pInt] = 6;
                  SetPlayerPos(i, 264.6288,77.5742,1001.0391);
                  PlayerInfo[pJailed] = 1;
                  SafeResetPlayerWeapons(i);
                  SafeResetPlayerMoney(i);
               WantedPoints = 0;
               PlayerInfo[pJailTime] = 240;
               format(string, sizeof(string), "Vous êtes en prison pour %d secondes.   Bail: Aucun", PlayerInfo[pJailTime]);
               SendClientMessage(i, COLOR_WHITE, string);
            }
            new playername2[MAX_PLAYER_NAME];
            GetPlayerName(i, playername2, sizeof(playername2));
            account = PlayerInfo[pAccount];
            new key = PlayerInfo[pPhousekey];
            new nxtlevel = PlayerInfo[pLevel]+1;
            if(key != 255)
            {
               rent = HouseInfo[key][hRent];
               if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
               {
                  rent = 0;
               }
               else if(rent > GetPlayerMoney(i))
               {
                  PlayerInfo[pPhousekey] = 255;
                  SendClientMessage(i, COLOR_WHITE, "Vous avez été virer de chez vous car vous n'avez plus assez pour payer.");
                  rent = 0;
               }
               HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
            }
            new tmpintrate;
            if (key != 255 && strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
            {
                if(PlayerInfo[pDonateRank] > 0) { tmpintrate = intrate+4; }
               else { tmpintrate = intrate+2; }//HouseInfo[key][hLevel]
            }
            else
            {
                if(PlayerInfo[pDonateRank] > 0) { tmpintrate = 3; }
               else { tmpintrate = 1; }
            }
            if(PlayerInfo[pPayDay] >= 5)
            {
                PlayerInfo[pAccount] -= Tax;
               new checks = PlayerInfo[pPayCheck] / 4;
               if(PlayerInfo[pDonateRank] > 0)
               {
                   new bonus = PlayerInfo[pPayCheck] / 10;
                   checks += bonus;
               }
                new ebill = (PlayerInfo[pAccount]/9000);
                //ConsumingMoney = 1;
                //SafeGivePlayerMoney(i, checks);
                account += checks;
                if(PlayerInfo[pAccount] > 0)
                {
                   PlayerInfo[pAccount] -= ebill;
                   SBizzInfo[4][sbTill] += ebill;
               }
               else
               {
                   ebill = 0;
               }
               interest = (PlayerInfo[pAccount]/750)*(tmpintrate);
               PlayerInfo[pExp]++;
               PlayerPlayMusic(i);
               CoffreMaire += Tax;
               PlayerInfo[pAccount] = account+interest;
               SendClientMessage(i, COLOR_GREEN, "|___ BANQUE ___|");
               format(string, sizeof(string), "  Salaire: $%d   Taxe: -$%d", checks, Tax);
               SendClientMessage(i, COLOR_WHITE, string);
               if(PlayerInfo[pPhousekey] != 255 || PlayerInfo[pPbiskey] != 255)
               {
                   format(string, sizeof(string), "  Facture d'élécricité: -$%d", ebill);
                  SendClientMessage(i, COLOR_GRAD1, string);
               }
               format(string, sizeof(string), "  Compte: $%d", account - checks);
               SendClientMessage(i, COLOR_WHITE, string);
               format(string, sizeof(string), "  Pourecent d'intêret: 0.%d percent",tmpintrate);
               SendClientMessage(i, COLOR_GRAD2, string);
               format(string, sizeof(string), "  Interêt gagné : $%d", interest);
               SendClientMessage(i, COLOR_GRAD3, string);
               SendClientMessage(i, COLOR_GREEN, "|--------------------------------------|");
               format(string, sizeof(string), "  Nouveau compte : $%d", PlayerInfo[pAccount]);
               SendClientMessage(i, COLOR_GRAD5, string);
               format(string, sizeof(string), "  Location: -$%d", rent);
               SendClientMessage(i, COLOR_GRAD5, string);
               format(string, sizeof(string), "~y~SAlaire~n~~w~SALAIRE envoye sur votre compte.");
               GameTextForPlayer(i, string, 5000, 1);
               rent = 0;
               SaveStuff();
               PlayerInfo[pPayDay] = 0;
               PlayerInfo[pPayCheck] = 0;
               PlayerInfo[pConnectTime] += 1;
               if(FarmerVar == 0)
               {
                  FarmerP